/* =========================================================================
   MELODIFI — MASTER STYLE SHEET
   Satu-satunya tempat definisi warna & CSS komponen custom.
   Ubah warna di :root di bawah ini, seluruh site ikut.
   ========================================================================= */

:root {
    /* ===================== PALET WARNA ===================== */

    /* --- Cadangan palet lama (warm coral) — uncomment untuk balik ---
    --color-coral: #FF6B6B;
    --color-coral-soft: #FFB4B4;
    --color-coral-deep: #E85555;
    --color-peach: #FFDAB9;
    --color-peach-light: #FFF0E5;
    --color-cream: #FFFBF7;
    --color-cream-dark: #F5EDE4;
    --color-gold: #F0C27A;
    --color-border-warm: #F0E4DC;
    --color-ink: #2D2424;
    --color-ink-light: #6B5B5B;
    --color-ink-muted: #A89898;
    --color-lavender: #C3A6E0;
    --color-lavender-soft: #E8D5F5;
    --color-cyan: #4ECDC4;
    --color-cyan-soft: #A8E6CF;
    --color-cyan-deep: #2DB5AC;
    */

    /* --- Palet AKTIF: Lilac Violet --- */

    /* Primary (brand) */
    --color-primary: #7C5AC4;
    --color-primary-deep: #5F3FA3;
    --color-primary-soft: #C4B0E8;

    /* Secondary (aksen hangat / rose) */
    --color-secondary: #E89BB8;
    --color-secondary-deep: #9B3D6E;
    --color-secondary-soft: #F0C4DC;

    /* Tertiary (aksen dingin / cyan) */
    --color-tertiary: #4ECDC4;
    --color-tertiary-deep: #2DB5AC;
    --color-tertiary-soft: #A8E6CF;

    /* Surfaces */
    --color-surface: #FFFFFF;
    --color-surface-soft: #FAEBF4;
    --color-bg: #F1ECF8;
    --color-bg-deep: #E4DAF1;

    /* Text */
    --color-ink: #2D2424;
    --color-ink-light: #6B5B5B;
    --color-ink-muted: #A89898;

    /* Border */
    --color-border: #D2C4E7;

    /* Lavender (aksen dekoratif) */
    --color-lavender: #C3A6E0;
    --color-lavender-soft: #E8D5F5;

    /* Alias ke nama Tailwind lama (agar class bg-coral dll tetap jalan) */
    --color-coral: var(--color-primary);
    --color-coral-soft: var(--color-primary-soft);
    --color-coral-deep: var(--color-primary-deep);
    --color-peach: var(--color-secondary);
    --color-peach-light: var(--color-surface-soft);
    --color-cream: var(--color-bg);
    --color-cream-dark: var(--color-bg-deep);
    --color-gold: var(--color-secondary);
    --color-cyan: var(--color-tertiary);
    --color-cyan-deep: var(--color-tertiary-deep);
    --color-cyan-soft: var(--color-tertiary-soft);
    --color-border-warm: var(--color-border);

    /* RGB triplets untuk rgba() dinamis */
    --color-primary-rgb: 124, 90, 196;
    --color-secondary-rgb: 232, 155, 184;
    --color-ink-rgb: 45, 36, 36;

    /* ===================== SHADOWS ===================== */
    --shadow-brand: 0 6px 18px -4px rgba(var(--color-primary-rgb), 0.5);
    --shadow-brand-lg: 0 6px 20px -4px rgba(var(--color-primary-rgb), 0.5);
    --shadow-brand-hover: 0 8px 24px -4px rgba(var(--color-primary-rgb), 0.6);
    --shadow-brand-btn: 0 8px 20px rgba(var(--color-primary-rgb), 0.4);
    --shadow-brand-play: 0 4px 16px rgba(var(--color-primary-rgb), 0.5);
    --shadow-card: 0 16px 40px -8px rgba(var(--color-primary-rgb), 0.15), 0 4px 16px -2px rgba(0, 0, 0, 0.04);
    --shadow-card-active: 0 12px 28px -4px rgba(var(--color-primary-rgb), 0.22);
    --shadow-card-hover: 0 12px 28px -4px rgba(var(--color-primary-rgb), 0.15);
    --shadow-nav: 0 10px 40px -24px rgba(var(--color-ink-rgb), 0.25);
    --ring-focus: 0 0 0 4px rgba(var(--color-primary-rgb), 0.12);

    /* ===================== GRADIENTS ===================== */
    --grad-brand: linear-gradient(135deg, var(--color-primary), var(--color-primary-deep), var(--color-secondary));
    --grad-brand-btn: linear-gradient(90deg, var(--color-primary), var(--color-primary-deep));
    --grad-accent-line: linear-gradient(90deg, var(--color-primary), var(--color-secondary), var(--color-primary-soft));
    --grad-logo: linear-gradient(to bottom right, var(--color-primary), var(--color-primary-deep), var(--color-secondary));

    /* ===================== FONTS ===================== */
    --font-sans: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
    --font-display: 'Instrument Serif', serif;
    --font-body: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
}

/* =========================================================================
   BASE RESET RINGAN
   ========================================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* =========================================================================
   MATERIAL SYMBOLS
   ========================================================================= */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

.material-symbols-outlined.filled {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* =========================================================================
   KEYFRAMES
   ========================================================================= */
@keyframes navDrop {
    from { opacity: 0; transform: translateY(-18px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes navFade {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes panelIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes eq {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(2.2); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.4); }
}

/* =========================================================================
   NAVBAR
   ========================================================================= */
.nav-enter {
    animation: navDrop 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.nav-enter .nav-item {
    animation: navFade 0.45s ease both;
}

#mobileMenu:not(.hidden) {
    animation: panelIn 0.22s ease both;
}

.nav-surface {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-nav);
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-ink-light);
    text-decoration: none;
    transition: color 0.2s, background-color 0.2s;
    position: relative;
}

.nav-link:hover {
    color: var(--color-primary);
    background: rgba(250, 235, 244, 0.7);
}

.nav-link.is-active {
    color: var(--color-primary);
    font-weight: 600;
    background: var(--color-surface-soft);
}

.nav-link.is-active::after {
    content: '';
    position: absolute;
    bottom: 0.25rem;
    left: 50%;
    transform: translateX(-50%);
    width: 1rem;
    height: 3px;
    border-radius: 9999px;
    background: var(--color-primary);
}

/* Brand */
.brand-tile {
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 1rem;
    background: var(--grad-logo);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: var(--shadow-brand);
    flex-shrink: 0;
    transition: transform 0.2s;
}

@media (min-width: 768px) {
    .brand-tile {
        width: 2.75rem;
        height: 2.75rem;
    }
}

.group:hover .brand-tile,
.brand-tile:active {
    transform: scale(1.05);
}

.brand-eq {
    position: absolute;
    bottom: -0.25rem;
    right: -0.25rem;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    padding: 0.25rem 0.375rem;
    border-radius: 9999px;
    background: var(--color-ink);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.brand-eq span {
    width: 2.5px;
    border-radius: 9999px;
}

.brand-eq span:nth-child(1) {
    height: 5px;
    background: var(--color-primary);
    animation: eq 0.9s ease-in-out infinite;
}

.brand-eq span:nth-child(2) {
    height: 8px;
    background: var(--color-secondary);
    animation: eq 0.7s ease-in-out 0.15s infinite;
}

.brand-eq span:nth-child(3) {
    height: 4px;
    background: var(--color-primary-soft);
    animation: eq 1.1s ease-in-out 0.3s infinite;
}

.brand-wordmark {
    font-family: var(--font-display);
    font-size: 1.5rem;
    line-height: 1;
    letter-spacing: -0.025em;
    color: var(--color-ink);
}

@media (min-width: 768px) {
    .brand-wordmark {
        font-size: 1.625rem;
    }
}

/* =========================================================================
   SEARCH FIELD (recessed)
   ========================================================================= */
.search-field {
    display: flex;
    align-items: center;
    width: 100%;
    background: var(--color-bg-deep);
    border: 2px solid var(--color-border);
    box-shadow: inset 0 2px 8px rgba(var(--color-ink-rgb), 0.09);
    transition: all 0.25s;
}

.search-field--lg {
    border-radius: 1rem;
}

.search-field--sm {
    border-radius: 0.75rem;
    border-width: 1.5px;
    box-shadow: inset 0 1.5px 5px rgba(var(--color-ink-rgb), 0.08);
}

.search-field:focus-within {
    border-color: var(--color-primary);
    background: var(--color-surface);
    box-shadow: inset 0 2px 8px rgba(var(--color-ink-rgb), 0.05), var(--ring-focus);
}

.search-field .search-icon {
    flex-shrink: 0;
    color: var(--color-ink-muted);
    transition: color 0.2s;
}

.search-field:focus-within .search-icon {
    color: var(--color-primary);
}

.search-field input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--color-ink);
    outline: none;
}

.search-field input::placeholder {
    color: var(--color-ink-muted);
}

.search-field .kbd-hint {
    display: none;
    align-items: center;
    margin-right: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--color-ink-muted);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    user-select: none;
}

@media (min-width: 1024px) {
    .search-field .kbd-hint {
        display: inline-flex;
    }
}

/* Search hero (halaman /cari) */
.search-hero {
    width: 100%;
    padding: 1rem 1.5rem 1rem 3.5rem;
    border-radius: 9999px;
    border: 1.5px solid var(--color-border);
    background: var(--color-bg-deep);
    font-size: 1rem;
    color: var(--color-ink);
    box-shadow: inset 0 2px 6px rgba(var(--color-ink-rgb), 0.08);
    transition: all 0.25s;
    outline: none;
}

.search-hero::placeholder {
    color: var(--color-ink-muted);
}

.search-hero:focus {
    border-color: var(--color-primary);
    background: var(--color-surface);
    box-shadow: inset 0 2px 6px rgba(var(--color-ink-rgb), 0.05), 0 0 0 4px rgba(var(--color-primary-rgb), 0.1);
}

/* =========================================================================
   BUTTONS
   ========================================================================= */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    background: var(--grad-brand-btn);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: var(--shadow-brand-lg);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 0;
    cursor: pointer;
}

.btn-primary:hover {
    transform: scale(1.04);
    box-shadow: var(--shadow-brand-hover);
}

.btn-primary:active {
    transform: scale(0.95);
}

.btn-play {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 9999px;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-brand-play);
    transition: transform 0.2s;
    border: 0;
    cursor: pointer;
}

.btn-play:hover {
    transform: scale(1.05);
}

.btn-play:active {
    transform: scale(0.95);
}

/* =========================================================================
   LYRIC LINES (focused reading)
   ========================================================================= */
.lyric-pair {
    padding: 0.75rem;
    border-radius: 1rem;
    transition: background-color 0.2s;
}

.lyric-orig {
    font-family: var(--font-display);
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--color-ink);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.lyric-trans {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--color-ink-light);
    line-height: 1.6;
    font-weight: 600;
}

/* =========================================================================
   LYRICS CONSOLE (floating glass bar)
   ========================================================================= */
.lyrics-console {
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow:
        0 4px 24px -4px rgba(var(--color-ink-rgb), 0.08),
        0 1px 3px rgba(var(--color-ink-rgb), 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.console-group {
    display: inline-flex;
    align-items: center;
    background: rgba(var(--color-primary-rgb), 0.07);
    border-radius: 9999px;
    padding: 2px;
}

.console-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    height: 2.25rem;
    min-width: 2.25rem;
    padding: 0 0.5rem;
    border-radius: 9999px;
    background: transparent;
    color: var(--color-ink-light);
    border: none;
    cursor: pointer;
    transition: color 0.15s, background-color 0.15s, transform 0.1s;
    font-family: inherit;
    position: relative;
}

.console-btn:hover {
    color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.1);
}

.console-btn:active {
    transform: scale(0.9);
}

.console-btn--social {
    padding: 0 0.65rem;
}

.console-divider {
    width: 1px;
    height: 1.25rem;
    background: var(--color-border);
    margin: 0 0.2rem;
    flex-shrink: 0;
}

.console-count {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--color-ink-muted);
    transition: color 0.15s;
    line-height: 1;
}

.console-btn:hover .console-count {
    color: var(--color-primary);
}

/* Liked state */
.console-btn.is-liked {
    color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.1);
}

.console-btn.is-liked .material-symbols-outlined {
    font-variation-settings: 'FILL' 1;
    animation: heartPop 0.4s ease;
    color: var(--color-primary);
}

.console-btn.is-liked .console-count {
    color: var(--color-primary);
}

@keyframes heartPop {
    0% { transform: scale(1); }
    30% { transform: scale(1.4); }
    60% { transform: scale(0.85); }
    100% { transform: scale(1); }
}

/* Font A- A+ inside group: no bg on hover to avoid double pill */
.console-group .console-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    color: var(--color-primary);
}

@media (prefers-reduced-motion: reduce) {
    .console-btn.is-liked .material-symbols-outlined {
        animation: none;
    }
}

/* =========================================================================
   PLAYER DOCK (floating sticky → menempel jadi section saat mentok footer)
   ========================================================================= */
.player-dock {
    position: sticky;
    bottom: 0;
    z-index: 40;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -10px 30px rgba(var(--color-ink-rgb), 0.08);
}

.player-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    background: transparent;
    color: var(--color-ink-light);
    border: none;
    cursor: pointer;
    transition: color 0.15s, background-color 0.15s, transform 0.1s;
}

.player-icon-btn:hover {
    color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.1);
}

.player-icon-btn:active {
    transform: scale(0.9);
}

.player-icon-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.player-icon-btn:disabled:hover {
    color: var(--color-ink-light);
    background: transparent;
}

.btn-play:disabled {
    transform: none !important;
}

/* =========================================================================
   HERO SLIDER (section 1 — kutipan harian carousel)
   ========================================================================= */
.hero-slider {
    display: grid;
}

.hero-slide {
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.45s ease, transform 0.45s ease, visibility 0s linear 0.45s;
    pointer-events: none;
}

.hero-slide.is-active {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.45s ease, transform 0.45s ease, visibility 0s linear 0s;
    pointer-events: auto;
}

.hero-dots {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: var(--color-border);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.hero-dot:hover {
    background: var(--color-primary-soft);
    transform: scale(1.25);
}

.hero-dot.is-active {
    background: var(--color-primary);
    width: 1.375rem;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .hero-slide {
        transition: none;
    }
}

/* =========================================================================
   AUTOPLAY UNMUTE HINT (muncul saat browser memblokir autoplay berbunyi)
   ========================================================================= */
.autoplay-hint {
    position: fixed;
    left: 50%;
    bottom: 6.5rem;
    transform: translateX(-50%);
    z-index: 45;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem 0.625rem 1rem;
    background: var(--color-ink);
    color: #fff;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    animation: panelIn 0.3s ease both;
    white-space: nowrap;
    max-width: calc(100vw - 2rem);
}

.autoplay-hint button {
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 9999px;
    padding: 0.375rem 0.875rem;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.15s;
}

.autoplay-hint button:hover {
    background: var(--color-primary-deep);
}

/* =========================================================================
   WAVEFORM LOOP (dekorasi hero — tile sepanjang card)
   ========================================================================= */
.waveform-loop {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 200px;
    opacity: 0.15;
    pointer-events: none;
    user-select: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='200' viewBox='0 0 480 200' fill='none'%3E%3Cpath d='M0 100 C 60 40, 120 160, 180 100 C 240 40, 300 170, 360 90 C 420 10, 460 60, 480 100' stroke='%237C5AC4' stroke-linecap='round' stroke-width='8'/%3E%3Cpath d='M0 130 C 70 80, 140 180, 210 110 C 280 40, 350 150, 420 110 C 450 95, 470 120, 480 130' stroke='%23E89BB8' stroke-linecap='round' stroke-width='4'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-position: bottom left;
    background-size: 480px 200px;
}

/* =========================================================================
   ICON BUTTON (hamburger / mobile)
   ========================================================================= */
.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: var(--color-bg-deep);
    color: var(--color-ink-light);
    border: 1.5px solid var(--color-border);
    cursor: pointer;
    transition: color 0.2s, background-color 0.2s;
}

.icon-btn:hover {
    color: var(--color-primary);
    background: var(--color-surface-soft);
}

/* =========================================================================
   ACCENT LINE (garis bawah navbar)
   ========================================================================= */
.accent-line {
    height: 3px;
    width: 100%;
    background: var(--grad-accent-line);
    opacity: 0.9;
}

/* =========================================================================
   FOOTER
   ========================================================================= */
.site-footer {
    width: 100%;
    background: rgba(250, 235, 244, 0.6);
    padding: 2.5rem 0;
    border-top: 1px solid var(--color-border);
}

.site-footer a {
    transition: color 0.2s;
}

.site-footer a:hover {
    color: var(--color-primary);
}

/* =========================================================================
   ESSENCE CARD (hero kanan)
   ========================================================================= */
.card-essence {
    font-size: 15px;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 7;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-save-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.625rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--color-ink-light);
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: color 0.2s, background-color 0.2s, transform 0.15s;
}

.btn-save-card:hover {
    color: var(--color-primary);
    background: #fff;
    transform: scale(1.08);
}

.btn-save-card:active {
    transform: scale(0.94);
}

/* =========================================================================
   REDUCED MOTION
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
    .nav-enter,
    .nav-enter .nav-item,
    #mobileMenu:not(.hidden),
    .brand-eq span {
        animation: none !important;
    }
}
