/* থিম ইঞ্জিন (CSS Variables) */
:root {
    /* Light Theme Default */
    --bg-main: #fbfbfb;
    --bg-sidebar: #ffffff;
    --bg-player: #ffffff;
    --text-main: #222222;
    --text-muted: #777777;
    --border-color: #eeeeee;
    --accent-color: #2bc5b4;
    --card-bg: #ffffff;
    --hover-bg: #f5f5f5;

    /* Spotify-Style Layout Variables added from source */
    --bg-header: rgba(248, 249, 250, 0.9);
    --bg-card-hover: #eaeaea;
    --accent: #1db954;
}

[data-theme="dark"] {
    /* Dark Theme */
    --bg-main: #121212;
    --bg-sidebar: #181818;
    --bg-player: #181818;
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
    --border-color: #333333;
    --accent-color: #2bc5b4;
    --card-bg: #222222;
    --hover-bg: #2a2a2a;

    /* Spotify-Style Layout Variables added from source */
    --bg-sidebar: #000000;
    --bg-header: rgba(18, 18, 18, 0.9);
    --bg-card: #181818;
    --bg-card-hover: #282828;
    --text-muted: #b3b3b3;
    --accent: #1db954;
    --border-color: #282828;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }

body { display: flex; height: 100vh; background-color: var(--bg-main); color: var(--text-main); overflow: hidden; }

/* সাইডবার ডিজাইন */
.sidebar { width: 250px; background-color: var(--bg-sidebar); border-right: 1px solid var(--border-color); padding: 20px; display: flex; flex-direction: column; }
.logo h2 { margin-bottom: 30px; }
.nav-links a { display: block; padding: 10px 15px; color: var(--text-main); text-decoration: none; font-weight: 500; border-radius: 8px; margin-bottom: 5px; }
.nav-links a:hover { background-color: var(--hover-bg); }
.theme-switch { margin-top: auto; padding-top: 20px; border-top: 1px solid var(--border-color); font-size: 14px; }
.theme-switch select { width: 100%; margin-top: 5px; padding: 5px; border-radius: 5px; border: 1px solid var(--border-color); background: var(--bg-main); color: var(--text-main); }

/* মেইন কন্টেন্ট এবং 'View All' */
.main-content { flex: 1; padding: 30px; overflow-y: auto; padding-bottom: 100px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.view-all-btn { background: none; border: none; color: var(--accent-color); font-weight: 600; cursor: pointer; font-size: 14px; }
.view-all-btn:hover { text-decoration: underline; }

/* মিউজিক গ্রিড */
.music-grid { display: flex; gap: 20px; flex-wrap: wrap; }
.music-card { width: 160px; cursor: pointer; background: var(--card-bg); padding: 10px; border-radius: 10px; transition: background 0.3s; }
.music-card:hover { background: var(--hover-bg); }
.album-art { width: 140px; height: 140px; background-color: var(--border-color); border-radius: 8px; margin-bottom: 10px; }
.song-title { font-size: 14px; font-weight: 600; }
.artist-name { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* স্টিকি বটম প্লেয়ার */
.music-player { position: fixed; bottom: 0; left: 0; width: 100%; height: 80px; background-color: var(--bg-player); border-top: 1px solid var(--border-color); display: flex; align-items: center; padding: 0 30px; justify-content: space-between; z-index: 1000; box-shadow: 0 -2px 10px rgba(0,0,0,0.05); }
.player-info { display: flex; align-items: center; gap: 15px; width: 250px; }
.player-art { width: 50px; height: 50px; background-color: var(--border-color); border-radius: 4px; }
.player-details h4 { font-size: 14px; }
.player-details p { font-size: 12px; color: var(--text-muted); }

.player-controls { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.player-controls button { background: none; border: none; color: var(--text-main); font-size: 18px; cursor: pointer; margin: 0 15px; }
.play-btn { background: var(--accent-color) !important; color: white !important; border-radius: 50%; width: 35px; height: 35px; display: flex; align-items: center; justify-content: center; }

.progress-container { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 400px; font-size: 12px; color: var(--text-muted); }
#progress-bar { width: 100%; cursor: pointer; accent-color: var(--accent-color); }

.player-actions { width: 250px; text-align: right; }
.action-btn { padding: 6px 15px; border: 1px solid var(--border-color); border-radius: 20px; background: var(--bg-main); color: var(--text-main); cursor: pointer; margin-left: 10px; font-size: 13px; font-weight: 500; }
.action-btn.tip-btn { border-color: var(--accent-color); color: var(--accent-color); }
/* --- রেসপন্সিভ ডিজাইন (Mobile & Tablet) --- */

@media (max-width: 768px) {
    body {
        flex-direction: column; 
    }
    .sidebar {
        display: none; 
    }
    .main-content {
        padding: 15px;
        padding-bottom: 160px; 
    }
    .music-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    .music-card {
        width: 100%; 
    }
    .album-art {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1; 
    }
    .music-player {
        height: auto;
        flex-direction: column; 
        padding: 10px;
        bottom: 60px; 
    }
    .player-info {
        width: 100%;
        margin-bottom: 10px;
    }
    .player-controls {
        width: 100%;
        margin-bottom: 10px;
    }
    .player-actions {
        width: 100%;
        display: flex;
        justify-content: center;
        gap: 10px;
    }
    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background-color: var(--bg-sidebar);
        border-top: 1px solid var(--border-color);
        justify-content: space-around;
        align-items: center;
        z-index: 1001;
    }
    .mobile-nav a {
        text-decoration: none;
        color: var(--text-main);
        font-size: 11px;
        text-align: center;
        line-height: 1.4;
    }
}

@media (min-width: 769px) {
    .mobile-nav {
        display: none;
    }
}
/* ==========================================
   পপ-আপ (Modal) ডিজাইন
========================================== */
.modal-overlay { 
    display: none; 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.6); z-index: 2000; 
    justify-content: center; align-items: center; 
}
.modal-content { 
    background: var(--bg-main); width: 90%; max-width: 400px; 
    padding: 25px; border-radius: 15px; position: relative; 
    text-align: center; box-shadow: 0 5px 25px rgba(0,0,0,0.2); 
}
.close-modal { 
    position: absolute; top: 15px; right: 20px; font-size: 24px; 
    cursor: pointer; color: var(--text-muted); 
}
.close-modal:hover { color: var(--accent-color); }
.modal-btn { 
    background: var(--accent-color); color: white; border: none; 
    padding: 12px 20px; border-radius: 25px; font-weight: bold; 
    cursor: pointer; width: 100%; margin-top: 15px; font-size: 15px; 
}
.amount-input { 
    width: 100%; padding: 12px; margin-top: 10px; border-radius: 8px; 
    border: 1px solid var(--border-color); background: var(--bg-sidebar); 
    color: var(--text-main); font-size: 18px; text-align: center; font-weight: bold;
}

/* ==========================================
   Main Layout Container
   ========================================== */
.app-container {
    display: flex;
    height: 100vh;
    padding-bottom: 90px; 
    box-sizing: border-box;
}
.sidebar {
    width: 320px;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 10px;
    resize: horizontal;
    overflow: auto;
}
.sidebar-box {
    background: var(--bg-main);
    border-radius: 8px;
    padding: 15px;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: bold;
    font-size: 15px;
    padding: 10px 0;
    transition: 0.3s;
    cursor: pointer;
}
.nav-link:hover, .nav-link.active {
    color: var(--text-main);
}
.library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-weight: bold;
    margin-bottom: 15px;
}
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}
.sidebar-item:hover {
    background: var(--bg-card-hover);
}
.sidebar-item img {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    object-fit: cover;
}

/* ==========================================
   Main Content Area (Right)
   ========================================== */
.main-area {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-main);
    border-radius: 8px;
    margin: 10px 10px 10px 0;
    position: relative;
}
.top-header {
    position: sticky;
    top: 0;
    background: var(--bg-header);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 15px; }
.search-box {
    background: var(--bg-card-hover);
    border-radius: 25px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    width: 300px;
}
.search-box input {
    background: transparent;
    border: none;
    color: var(--text-main);
    outline: none;
    width: 100%;
    margin-left: 10px;
}
.filter-pills {
    display: flex;
    gap: 10px;
    margin-left: 15px;
}
.pill {
    background: var(--bg-card-hover);
    color: var(--text-main);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}
.pill.active {
    background: var(--text-main);
    color: var(--bg-main);
}
.header-right { display: flex; align-items: center; gap: 15px; }
.btn-outline { background: transparent; color: var(--text-muted); font-weight: bold; border: none; cursor: pointer; transition: 0.2s; font-size: 15px;}
.btn-outline:hover { color: var(--text-main); transform: scale(1.05); }
.btn-solid { background: var(--text-main); color: var(--bg-main); font-weight: bold; border: none; padding: 12px 25px; border-radius: 25px; cursor: pointer; font-size: 15px; transition: 0.2s;}
.btn-solid:hover { transform: scale(1.05); }
.theme-btn {
    background: rgba(0,0,0,0.5);
    border: none;
    color: var(--text-main);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================
   Content Grid System (Cards)
   ========================================== */
.content-padding { padding: 20px 25px; }
.section-title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--text-main);
}
.recent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}
.recent-card {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: background 0.3s;
}
.recent-card:hover { background: rgba(255, 255, 255, 0.15); }
.recent-card img { width: 65px; height: 65px; object-fit: cover; }
.recent-card span { padding: 0 15px; font-weight: bold; font-size: 15px; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.spotify-card {
    background: var(--bg-card);
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
    position: relative;
}
.spotify-card:hover { background: var(--bg-card-hover); }

.card-img-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: 15px;
    border-radius: 6px;
    overflow: hidden;
}
.spotify-card.artist .card-img-container { border-radius: 50%; } 
.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 45px;
    height: 45px;
    background: var(--accent);
    color: black;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    box-shadow: 0 8px 8px rgba(0,0,0,0.3);
}
.spotify-card:hover .play-overlay {
    opacity: 1;
    transform: translateY(0);
}

.card-title { font-size: 16px; font-weight: bold; margin: 0 0 5px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
.card-desc { font-size: 13px; color: var(--text-muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.5); }

.auth-container {
    background: #121212;
    padding: 40px;
    border-radius: 10px;
    max-width: 400px;
    margin: 50px auto;
    color: white;
}
.auth-container input {
    background: #333;
    border: none;
    padding: 15px;
    margin: 10px 0;
    color: white;
    width: 100%;
}