/* =========================================
   1. VARIABLES & THEME
   ========================================= */
:root {
    --bg-black: #000000;
    --surface-dark: #121212;
    --surface-light: #282828;
    --text-main: #ffffff;
    --text-dim: #b3b3b3;
    --accent-color: #c38ef5; /* Neon Purple */
    --player-height: 90px;
    --sidebar-width: 240px;
    --nav-height-mobile: 65px; 
    --transition-fast: 0.2s ease;
}

/* =========================================
   2. GLOBAL RESET
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-black);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    height: 100vh;
    overflow: hidden; 
}

/* =========================================
   3. LAYOUT STRUCTURE (DESKTOP)
   ========================================= */
.main-wrapper {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: 1fr var(--player-height);
    height: 100vh;
    width: 100vw;
}

/* =========================================
   4. SIDEBAR NAVIGATION
   ========================================= */
.sidebar {
    background-color: var(--bg-black);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    border-right: 1px solid #181818;
    grid-row: 1 / 2;
    z-index: 10;
}

.logo h2 {
    color: var(--accent-color);
    letter-spacing: -1px;
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.nav-links ul, .playlists ul {
    list-style: none;
}

.nav-links li {
    padding: 12px 0;
    color: var(--text-dim);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
}

.nav-links li i {
    margin-right: 15px;
    font-size: 1.3rem;
    flex-shrink: 0; 
    min-width: 24px; 
    text-align: center;
}

.nav-links li:hover, .nav-links li.active {
    color: var(--text-main);
}

/* =========================================
   5. MAIN CONTENT AREA & HEADER
   ========================================= */
.main-content {
    background: linear-gradient(to bottom, #1e1e1e, var(--bg-black));
    overflow-y: auto;
    padding: 20px 40px;
    padding-bottom: 120px; 
    grid-column: 2 / 3;
    grid-row: 1 / 2;
}

/* --- NEW HEADER STYLING --- */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    height: 50px;
}

.nav-buttons {
    display: flex;
    gap: 10px;
}

.circle-btn {
    background-color: rgba(0,0,0,0.7);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
}

/* Search Box Styling */
.search-box {
    display: flex;
    align-items: center;
    background-color: #ffffff1a; /* Semi-transparent */
    padding: 8px 20px;
    border-radius: 30px; /* Pill shape */
    width: 300px;
    transition: 0.3s;
}

.search-box:hover, .search-box:focus-within {
    background-color: #ffffff33; 
}

.search-box i {
    color: var(--text-dim);
    margin-right: 10px;
}

.search-box input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.95rem;
    width: 100%;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-dim);
}

/* --- HERO SECTION --- */
.hero-section {
    height: 40vh;
    min-height: 300px;
    display: flex;
    align-items: flex-end;
    padding-bottom: 30px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
}

.hero-content h1 {
    font-size: clamp(2.5rem, 6vw, 6rem);
    font-weight: 900;
    margin: 10px 0;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
    line-height: 1;
}

.stats {
    color: var(--text-dim);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- SONG LIST --- */
.song-list h3 {
    margin: 30px 0 20px;
    font-size: 1.5rem;
}

.song-row {
    display: grid;
    grid-template-columns: 50px 1fr 1fr 80px;
    padding: 10px 15px;
    border-radius: 8px;
    align-items: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.song-row:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* =========================================
   6. PLAYER BAR
   ========================================= */
.player-bar {
    grid-column: 1 / -1;
    grid-row: 2 / 3;
    background-color: #000;
    border-top: 1px solid #282828;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    z-index: 2000;
}

.now-playing {
    display: flex;
    align-items: center;
    width: 25%;
    min-width: 150px;
}

.album-art {
    width: 56px;
    height: 56px;
    background: linear-gradient(45deg, var(--surface-light), var(--accent-color));
    border-radius: 6px;
    margin-right: 15px;
    flex-shrink: 0;
}

.track-info p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.track-artist {
    color: var(--text-dim);
    font-size: 0.85rem;
}

.player-controls {
    width: 45%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 1.2rem;
    color: var(--text-dim);
}

.control-buttons i {
    cursor: pointer;
    flex-shrink: 0; 
}

.control-buttons i:hover {
    color: var(--text-main);
    transform: scale(1.1);
}

.play-main {
    font-size: 2.2rem;
    color: var(--text-main);
}

.progress-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
    color: var(--text-dim);
}

.progress-bar {
    flex-grow: 1;
    height: 4px;
    background-color: #4d4d4d;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background-color: var(--accent-color);
    border-radius: 2px;
}

.volume-controls {
    width: 25%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.volume-controls i {
    flex-shrink: 0;
}

.volume-bar {
    width: 100px;
    height: 4px;
    background-color: #4d4d4d;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.volume-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    background-color: #fff;
}

/* =========================================
   7. MOBILE OPTIMIZATION (UPDATED)
   ========================================= */
@media screen and (max-width: 768px) {

    .main-wrapper {
        display: block;
        position: relative;
    }

    /* Bottom Nav */
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: var(--nav-height-mobile);
        padding: 0;
        flex-direction: row;
        align-items: center;
        justify-content: space-around;
        border-right: none;
        border-top: 1px solid #222;
        background-color: rgba(0,0,0,0.95);
        backdrop-filter: blur(10px);
        z-index: 1001;
    }

    .logo, .playlists, .section-title {
        display: none !important;
    }

    .nav-links ul {
        display: flex;
        width: 100%;
        justify-content: space-around;
        align-items: center;
    }

    .nav-links li {
        flex-direction: column;
        justify-content: center;
        font-size: 0.7rem;
        padding: 0;
        gap: 5px;
        width: 60px;
    }

    .nav-links li i {
        margin: 0;
        font-size: 1.4rem;
        color: var(--text-dim);
    }
    
    .nav-links li.active i {
        color: var(--text-main);
    }

    /* --- MOBILE HEADER FIX --- */
    .top-bar {
        padding: 0;
        margin-bottom: 15px;
    }

    /* Hide arrows on mobile */
    .nav-buttons {
        display: none;
    }

    /* Expand Search Box */
    .search-box {
        width: 100%;
        background-color: #333;
    }

    /* Ensure Input is visible and text is large enough */
    .search-box input {
        display: block;
        font-size: 16px; /* Prevents iPhone zoom */
    }

    /* Content Area */
    .main-content {
        width: 100%;
        padding: 15px;
        padding-bottom: 180px;
    }

    /* Floating Player */
    .player-bar {
        position: fixed;
        bottom: var(--nav-height-mobile);
        left: 0;
        width: 100%;
        height: 70px;
        padding: 0 15px;
        background-color: #1a1a1a;
        border-top: 1px solid #333;
        border-bottom: 1px solid #111;
        z-index: 1002;
    }

    .now-playing {
        width: 65%; 
    }

    .player-controls {
        width: 35%;
        align-items: flex-end;
        gap: 0;
        flex-direction: row;
        justify-content: flex-end;
    }

    #shuffle, #prev, #repeat, .progress-container, .volume-controls {
        display: none !important;
    }

    .control-buttons {
        gap: 20px;
        width: auto;
    }

    .play-main {
        font-size: 2.2rem;
        display: block;
    }
    
    #next {
        font-size: 1.4rem;
        display: block;
    }

    .song-row {
        grid-template-columns: 50px 1fr 40px; 
        font-size: 0.9rem;
    }
    
    .song-row > div:nth-child(3) {
        display: none;
    }
}
