:root {
    --bg-color: #FFC700;
    --card-bg: #FFF8F0;
    --text-color: #000000;
    --border-width: 2.5px;
    --shadow-offset: 4px;
    --accent-yellow: #FFD600;
    --accent-red: #FF5A5F;
    --accent-blue: #3D8BFF;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Work Sans', sans-serif;
    background-color: var(--card-bg);
    background-image: radial-gradient(#000 5%, transparent 6%);
    background-size: 30px 30px;
    min-height: 100vh;
    display: block; 
    overflow-x: hidden;
}

/* --- LANDING PAGE STYLES --- */
.landing-container {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100vh;
    background: var(--accent-yellow);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.landing-bg-pattern i {
    position: absolute;
    font-size: 40px;
    opacity: 0.2;
    animation: floatMusic 5s infinite ease-in-out;
    color: black;
}
.note-1 { top: 10%; left: 10%; animation-delay: 0s; font-size: 60px; }
.note-2 { top: 20%; right: 15%; animation-delay: 1s; transform: rotate(15deg); }
.note-3 { bottom: 15%; left: 20%; animation-delay: 2s; }
.note-4 { bottom: 30%; right: 10%; animation-delay: 0.5s; font-size: 80px; }
.note-5 { top: 50%; left: 5%; animation-delay: 3s; }
.note-6 { top: 5%; right: 40%; animation-delay: 1.5s; }

@keyframes floatMusic {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
}

.landing-content {
    z-index: 2;
    text-align: center;
    width: 90%;
    max-width: 500px;
}

.landing-title {
    font-family: 'Space Mono', monospace;
    font-size: 60px;
    font-weight: 900;
    line-height: 0.9;
    margin-bottom: 20px;
    text-shadow: 5px 5px 0 white;
    transform: rotate(-3deg);
}

.landing-card {
    background: white;
    border: var(--border-width) solid black;
    padding: 30px;
    box-shadow: 8px 8px 0 black;
    border-radius: 20px;
    margin-bottom: 40px;
}

.start-btn {
    margin-top: 20px;
    font-size: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.marquee-container {
    position: absolute;
    bottom: 50px;
    width: 100%;
    background: black;
    color: white;
    padding: 10px 0;
    transform: rotate(2deg) scale(1.1);
    white-space: nowrap;
    overflow: hidden;
    border-top: 2px solid white;
    border-bottom: 2px solid white;
}

.marquee-text {
    font-family: 'Space Mono';
    font-weight: bold;
    animation: scrollText 10s linear infinite;
    display: inline-block;
}

@keyframes scrollText {
    from { transform: translateX(100%); }
    to { transform: translateX(-100%); }
}

/* --- SIDEBAR STYLES --- */
.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    backdrop-filter: blur(3px);
    display: flex;
    justify-content: flex-end; 
}

.sidebar-content {
    width: 80%;
    max-width: 350px;
    background: var(--card-bg);
    height: 100%;
    border-left: var(--border-width) solid black;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 0 rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid black;
}
.sidebar-header h3 { font-weight: 800; font-size: 24px; }
.close-sidebar {
    background: var(--accent-red);
    border: 2px solid black;
    width: 35px; height: 35px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
}

.sidebar-section { margin-bottom: 30px; }
.sidebar-section h4 {
    font-family: 'Space Mono';
    margin-bottom: 15px;
    font-size: 14px;
    color: #555;
    text-transform: uppercase;
}

.credit-box {
    background: white;
    border: 2px solid black;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 4px 4px 0 black;
}
.credit-box h3 { font-size: 18px; margin: 5px 0 10px 0; background: var(--accent-yellow); display: inline-block; padding: 2px 5px; }
.dev-link {
    display: block;
    margin-top: 10px;
    text-decoration: none;
    color: white;
    background: #25D366;
    padding: 8px;
    text-align: center;
    border-radius: 5px;
    border: 2px solid black;
    font-weight: bold;
    font-size: 12px;
}

.rec-list { list-style: none; }
.rec-list li { margin-bottom: 10px; }
.rec-list a {
    display: block;
    padding: 12px;
    background: white;
    border: 2px solid black;
    text-decoration: none;
    color: black;
    font-weight: bold;
    border-radius: 8px;
    transition: 0.2s;
    display: flex;
    justify-content: space-between;
}
.rec-list a:hover {
    background: var(--accent-blue);
    color: white;
    transform: translate(-2px, -2px);
    box-shadow: 3px 3px 0 black;
}

.sidebar-footer {
    margin-top: auto;
    text-align: center;
    font-family: 'Space Mono';
    font-size: 12px;
    opacity: 0.6;
}


/* --- MAIN APP & LAYOUT --- */
.app-container {
    width: 100%;
    min-height: 100vh;
    background: var(--card-bg);
    border: none;
    border-radius: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: none;
}

/* Header Adjustments */
.app-header {
    padding: 15px 24px; /* Sedikit lebih tipis paddingnya */
    background: var(--accent-yellow);
    border-bottom: var(--border-width) solid black;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-content, .search-wrapper-limit, .content-limit {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

/* UPDATE: Profile di header diperkecil */
.profile-card {
    display: flex;
    align-items: center;
    gap: 10px; /* Gap diperkecil */
}

.avatar {
    width: 38px; /* Ukuran avatar diperkecil */
    height: 38px;
    border: var(--border-width) solid black;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    overflow: hidden;
}

.real-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info h3 { font-size: 14px; font-weight: 800; } /* Font nama user diperkecil */
.user-info p { font-size: 11px; }

.header-actions {
    margin-left: auto;
}

.menu-btn {
    background: transparent;
    border: none;
    font-size: 20px; /* Icon titik tiga diperkecil dikit */
    cursor: pointer;
    padding: 5px;
    border: 2px solid black;
    border-radius: 8px;
    background: white;
    box-shadow: 2px 2px 0 black;
    width: 35px; height: 35px;
    transition: 0.1s;
    display: flex; align-items: center; justify-content: center;
}
.menu-btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 black; }


/* Search & Content */
.search-container {
    padding: 20px;
    background: var(--card-bg);
}

.search-box {
    display: flex;
    align-items: center;
    border: var(--border-width) solid black;
    border-radius: 50px;
    padding: 8px 10px 8px 20px;
    background: white;
    box-shadow: 4px 4px 0 black;
}

.search-icon { font-size: 18px; margin-right: 10px; }

#searchInput {
    border: none;
    outline: none;
    flex: 1;
    font-family: 'Work Sans', sans-serif;
    font-size: 16px;
}

.action-btn {
    background: var(--accent-yellow);
    border: var(--border-width) solid black;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
}
.action-btn:active { transform: translate(2px, 2px); }

.content-area {
    flex: 1;
    padding: 0 20px 100px 20px; 
}

/* Playlist View Specifics */
.playlist-header {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border: 2px solid black;
    border-radius: 16px;
    box-shadow: 4px 4px 0 black;
}
.playlist-header h2 { color: var(--accent-red); margin-bottom: 5px; }
.playlist-header p { font-family: 'Space Mono'; font-size: 12px; color: #666; }

/* Result Item */
.result-item {
    background: white;
    border: var(--border-width) solid black;
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 4px 4px 0 #000;
    cursor: pointer;
    transition: transform 0.1s;
    position: relative;
}
.result-item:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 black; }

.delete-btn {
    margin-left: auto;
    background: #ffcccb;
    border: 2px solid black;
    width: 35px; height: 35px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: red;
}

.song-icon {
    width: 50px; height: 50px;
    background: #f0f0f0;
    border: 2px solid black;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}
.song-icon img { width: 100%; height: 100%; object-fit: cover; }

.song-details { flex: 1; }
.song-title { font-weight: bold; font-size: 16px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.song-artist { font-size: 14px; color: #666; font-family: 'Space Mono'; }

/* Overlay & Lyrics */
.overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.lyrics-card {
    background: var(--card-bg);
    border: var(--border-width) solid black;
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 10px 10px 0 black;
    position: relative;
    animation: popUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popUp {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lyrics-top-actions {
    position: absolute;
    top: 20px; right: 20px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.icon-btn, .close-btn {
    border: 2px solid black;
    width: 35px; height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.1s;
}

.close-btn {
    background: var(--accent-red);
    color: white;
}
.fav-btn {
    background: white;
    color: #ccc; 
}
.fav-btn.active {
    background: #ffcccc;
    color: red;
    box-shadow: 2px 2px 0 black;
}
.fav-btn i { font-size: 16px; }


/* UPDATE: Lyrics Header tanpa Image & Style Judul Keren */
.lyrics-header-section {
    display: block; /* Ganti jadi block agar bisa centering text */
    text-align: center; /* Rata tengah */
    margin-bottom: 25px;
    padding-right: 0; /* Hapus padding kanan */
    padding-top: 10px;
}

.lyrics-meta-full h2 {
    font-size: 32px; /* Judul Besar */
    line-height: 1.1;
    font-weight: 900;
    margin-bottom: 5px;
    text-transform: uppercase;
    font-family: 'Work Sans', sans-serif;
    /* Style Text Keren: Outline/Stroke Hitam, Isi Kuning */
    color: var(--accent-yellow);
    -webkit-text-stroke: 1.5px black;
    text-shadow: 3px 3px 0 black; /* Shadow tebal */
    letter-spacing: -1px;
}

.lyrics-meta-full h4 { 
    color: #333; 
    margin-top: 5px; 
    font-family: 'Space Mono'; 
    font-weight: bold;
    font-size: 16px;
    background: black;
    color: white;
    display: inline-block;
    padding: 4px 10px;
    transform: rotate(-2deg); /* Miring dikit biar artistik */
}

pre {
    white-space: pre-wrap;
    font-family: 'Space Mono', monospace;
    font-size: 15px;
    margin: 20px 0;
    line-height: 1.8;
    color: #333;
}

.btn-yellow {
    width: 100%;
    padding: 15px;
    background: var(--accent-yellow);
    border: var(--border-width) solid black;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 4px 4px 0 black;
    cursor: pointer;
    border-radius: 12px;
    transition: transform 0.1s;
}
.btn-yellow:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 black; }

/* UPDATE: Nav Bar Alignment Fix */
.bottom-nav {
    position: fixed;
    bottom: 30px; 
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    background: white;
    border: var(--border-width) solid black;
    border-radius: 50px;
    height: 70px;
    display: flex;
    justify-content: space-around;
    align-items: center; /* Pastikan center vertikal */
    box-shadow: 6px 6px 0 black;
    z-index: 900;
    padding: 0 10px; /* Tambah padding kiri kanan */
}

.nav-item {
    font-size: 14px;
    font-weight: bold;
    display: flex;
    gap: 8px;
    align-items: center;
    opacity: 0.5;
    cursor: pointer;
    padding: 10px; /* Adjust padding ini jika masih terasa turun */
    transition: 0.2s;
    height: 100%; /* Pastikan item full height agar flex center bekerja */
    justify-content: center;
}
.nav-item.active {
    opacity: 1;
    background: var(--accent-yellow);
    padding: 0 20px; /* Kurangi padding atas bawah, gunakan flex center */
    height: 45px; /* Tinggi fix untuk active state */
    border-radius: 30px;
    border: 2px solid black;
    transform: rotate(-2deg);
}

.hidden { display: none !important; }
.loader { text-align: center; font-family: 'Space Mono'; font-weight: bold; padding: 40px; }

/* Shapes in Welcome Card */
.geometric-shapes {
    position: relative;
    height: 120px;
    margin-bottom: 20px;
}
.shape-circle {
    width: 80px; height: 80px;
    background: white;
    border: var(--border-width) solid black;
    border-radius: 50%;
    position: absolute;
    left: 50%; transform: translateX(-50%); z-index: 2;
}
.shape-triangle {
    width: 0; height: 0;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 70px solid var(--accent-blue);
    position: absolute;
    top: 40px; left: 53%; z-index: 1;
    filter: drop-shadow(3px 3px 0 black);
}

.stats-row { display: flex; justify-content: center; gap: 15px; margin-top: 30px; }
.stat-box {
    border: var(--border-width) solid black;
    padding: 10px 25px;
    background: white;
    box-shadow: 4px 4px 0 black;
    display: flex; flex-direction: column; font-family: 'Space Mono';
}
.stat-box .num { font-size: 24px; font-weight: bold; }

/* --- DESKTOP STYLES (Min-width 768px) --- */
@media (min-width: 768px) {
    /* Reset untuk desktop */
    body {
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 100vh;
        padding: 20px;
        background-color: var(--bg-color);
        background-image: radial-gradient(#000 8%, transparent 9%);
        background-size: 40px 40px;
    }

    /* App Container - Membuat kartu utama di tengah desktop */
    .app-container {
        width: 100%;
        max-width: 420px; /* Lebar tetap untuk mobile feel */
        min-height: 90vh;
        max-height: 900px;
        border: var(--border-width) solid black;
        border-radius: 30px;
        box-shadow: 15px 15px 0 rgba(0, 0, 0, 0.2);
        position: relative;
        overflow: hidden;
        background: var(--card-bg);
    }

    /* Landing page di desktop */
    .landing-container {
        position: relative;
        height: 90vh;
        max-height: 900px;
        width: 100%;
        max-width: 420px;
        border: var(--border-width) solid black;
        border-radius: 30px;
        overflow: hidden;
        box-shadow: 15px 15px 0 rgba(0, 0, 0, 0.2);
        margin: 0 auto;
    }

    /* Marquee di desktop */
    .marquee-container {
        bottom: 30px;
        width: 90%;
        border-radius: 50px;
        transform: rotate(1deg);
    }

    /* Sidebar overlay - lebih lebar di desktop */
    .sidebar-overlay {
        justify-content: flex-end;
        padding-right: calc(50vw - 210px); /* Pusatkan dengan app container */
    }
    
    .sidebar-content {
        max-width: 400px;
        border-radius: 20px 0 0 20px;
        margin-right: calc(50vw - 590px); /* Menyesuaikan dengan app container */
    }

    /* Header di desktop */
    .app-header {
        border-radius: 30px 30px 0 0;
    }

    /* Bottom nav di desktop */
    .bottom-nav {
        bottom: 20px;
        max-width: 380px;
        height: 65px;
    }

    /* Lyrics overlay - lebih besar di desktop */
    .lyrics-card {
        max-width: 700px;
        max-height: 85vh;
    }
    
    .lyrics-meta-full h2 {
        font-size: 40px;
        -webkit-text-stroke: 2px black;
    }

    /* Content area di desktop */
    .content-area {
        padding: 0 25px 90px 25px;
    }

    /* Result item - lebih besar di desktop */
    .result-item {
        padding: 20px;
        border-radius: 20px;
    }
    
    .song-icon {
        width: 60px;
        height: 60px;
    }
    
    .song-title {
        font-size: 18px;
    }
    
    .song-artist {
        font-size: 15px;
    }

    /* Search box di desktop */
    .search-box {
        padding: 10px 15px 10px 25px;
    }
    
    #searchInput {
        font-size: 18px;
    }
    
    .action-btn {
        width: 50px;
        height: 50px;
    }

    /* Welcome state di desktop */
    .state-card {
        padding: 30px;
        border-radius: 25px;
    }
    
    .state-card h2 {
        font-size: 28px;
    }
    
    .state-card p {
        font-size: 16px;
    }

    /* Playlist header di desktop */
    .playlist-header {
        padding: 25px;
        border-radius: 20px;
    }
    
    .playlist-header h2 {
        font-size: 24px;
    }

    /* Stats row di desktop */
    .stat-box {
        padding: 15px 30px;
    }
    
    .stat-box .num {
        font-size: 28px;
    }
    
    .stat-box .label {
        font-size: 14px;
    }
}

/* --- LAYAR LEBIH BESAR (Min-width 1024px) --- */
@media (min-width: 1024px) {
    .app-container {
        max-width: 450px;
        max-height: 920px;
    }
    
    .landing-container {
        max-width: 450px;
        max-height: 920px;
    }
    
    .landing-title {
        font-size: 70px;
    }
    
    .bottom-nav {
        max-width: 400px;
    }
    
    .sidebar-content {
        margin-right: calc(50vw - 625px);
    }
}

/* --- LAYAR SANGAT BESAR (Min-width 1200px) --- */
@media (min-width: 1200px) {
    .app-container {
        max-width: 480px;
    }
    
    .landing-container {
        max-width: 480px;
    }
    
    .landing-title {
        font-size: 80px;
    }
    
    .sidebar-content {
        margin-right: calc(50vw - 660px);
    }
}

/* --- FITUR TAMBAHAN UNTUK DESKTOP --- */

/* Animasi hover untuk desktop */
@media (hover: hover) and (min-width: 768px) {
    .menu-btn:hover {
        background: var(--accent-blue);
        color: white;
        transform: translate(-1px, -1px);
        box-shadow: 3px 3px 0 black;
    }
    
    .action-btn:hover {
        background: var(--accent-blue);
        color: white;
        transform: translate(-1px, -1px);
    }
    
    .btn-yellow:hover {
        background: var(--accent-blue);
        transform: translate(-2px, -2px);
        box-shadow: 6px 6px 0 black;
    }
    
    .nav-item:hover {
        opacity: 0.8;
    }
    
    .delete-btn:hover {
        background: #ff9999;
        transform: scale(1.05);
    }
    
    .rec-list a:hover {
        transform: translate(-3px, -3px);
        box-shadow: 4px 4px 0 black;
    }
    
    .dev-link:hover {
        background: #128C7E;
        transform: translateY(-2px);
        box-shadow: 0 4px 0 black;
    }
}

/* Touch device optimization */
@media (hover: none) and (min-width: 768px) {
    .menu-btn:active,
    .action-btn:active,
    .btn-yellow:active,
    .delete-btn:active {
        transform: translate(2px, 2px);
        box-shadow: 2px 2px 0 black;
    }
}

/* --- FIX UNTUK DESKTOP SPECIFIC ISSUES --- */

/* Pastikan konten tidak melebar terlalu jauh */
.header-content,
.search-wrapper-limit,
.content-limit {
    max-width: 100%;
    padding: 0 20px;
}

/* Scrollbar styling untuk desktop */
@media (min-width: 768px) {
    ::-webkit-scrollbar {
        width: 10px;
    }
    
    ::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
        border: 2px solid black;
    }
    
    ::-webkit-scrollbar-thumb {
        background: var(--accent-yellow);
        border-radius: 10px;
        border: 2px solid black;
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: var(--accent-blue);
    }
    
    /* Custom scroll untuk lyrics card */
    .lyrics-card::-webkit-scrollbar {
        width: 8px;
    }
    
    .lyrics-card::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .lyrics-card::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.3);
        border-radius: 4px;
    }
}

/* --- ANIMATION ENHANCEMENTS FOR DESKTOP --- */
@media (min-width: 768px) {
    @keyframes floatMusic {
        0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
        33% { transform: translateY(-20px) rotate(10deg) scale(1.1); }
        66% { transform: translateY(10px) rotate(-5deg) scale(0.95); }
    }
    
    .landing-bg-pattern i {
        font-size: 50px;
        opacity: 0.25;
    }
    
    .note-1 { font-size: 70px; }
    .note-4 { font-size: 90px; }
}