/* ---------- Global Styles ---------- */
body {
    margin: 0;
    font-family: "Inter", "Segoe UI", sans-serif;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ---------- Header ---------- */
h1 {
    width: 100%;
    margin: 0;
    padding: 1rem;
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
a {
    position: absolute;
    top: 2px;
    right: 20px;
    -webkit-text-decoration: none;
    -moz-text-decoration: none;
    text-decoration: none;
    color: #ffffff;
    font-size: 16px;
    z-index: 10;
}
/* ---------- Toolbar ---------- */
#toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.7rem;
    padding: 1rem;
    margin: 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

#toolbar > * {
    margin: 0;
}

/* ---------- Controls ---------- */
select,
button {
    font: inherit;
    border: none;
    outline: none;
    border-radius: 12px;
    padding: 0.7rem 1rem;
    cursor: pointer;
    transition: all 0.25s ease;
    background: rgba(255,255,255,0.1);
    color: #f8fafc;
    backdrop-filter: blur(10px);
}

/* ---------- Buttons ---------- */
button {
    min-width: 2.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

button:hover,
select:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.18);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

button:active {
    transform: scale(0.96);
}

/* ---------- Active Button ---------- */
button.active {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    box-shadow: 0 4px 14px rgba(59,130,246,0.4);
}

/* ---------- Copy Button ---------- */
button#copyBtn {
    margin-left: auto;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    color: white;
}

button#copyBtn:hover {
    opacity: 0.9;
}

/* ---------- Color Picker ---------- */
input[type="color"] {
    width: 3rem;
    height: 3rem;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    background: transparent;
    cursor: pointer;
}

/* ---------- Editor ---------- */
#editor {
    flex: 1;
    margin: 0 1rem 1rem;
    padding: 1.5rem;
    border-radius: 24px;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 12px 32px rgba(0,0,0,0.25);
    overflow-y: auto;
    outline: none;
    line-height: 1.8;
    font-size: 16px;
    color: #f8fafc;
    white-space: pre-wrap;
    transition: all 0.3s ease;
}

/* ---------- Editor Focus ---------- */
#editor:focus {
    border-color: rgba(59,130,246,0.5);
    box-shadow: 0 0 0 4px rgba(59,130,246,0.2);
}

/* ---------- Scrollbar ---------- */
#editor::-webkit-scrollbar {
    width: 10px;
}

#editor::-webkit-scrollbar-track {
    background: transparent;
}

#editor::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
}

#editor::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.35);
}