:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.5);
    --secondary: #a855f7;
    --bg-dark: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.3);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --surface: rgba(255, 255, 255, 0.05);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazirmatn FD NL', sans-serif;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

body {
    min-height: 100dvh;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 50% -20%, #1e1b4b, var(--bg-dark) 70%);
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out;
    transition: background 1s ease;
}

.orb-1 { width: 400px; height: 400px; top: -130px; left: -130px; background: var(--primary); }
.orb-2 { width: 300px; height: 300px; bottom: -50px; right: -50px; background: var(--secondary); animation-delay: -5s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 50px); }
}

.app-wrapper {
    width: 100%;
    max-width: 480px;
    height: 100dvh;
    max-height: 900px;
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

@media (min-width: 768px) {
    .app-wrapper {
        height: 90vh;
        border-radius: 40px;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(20px);
        border: 1px solid var(--glass-border);
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    }
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5px;
    margin-bottom: 20px;
}

.menu-btn {
    background: var(--surface);
    border: 1px solid var(--glass-border);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
    color: var(--text-main);
}

.menu-btn:hover { background: rgba(255,255,255,0.1); transform: scale(1.05); }

.brand {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.player-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
}

.art-container {
    position: relative;
    width: 260px;
    height: 260px;
    margin-bottom: 30px;
}

.art-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02));
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 60px var(--primary-glow);
    transition: box-shadow 0.5s ease;
}

.art-circle::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent, var(--primary), transparent 30%);
    animation: rotate 8s linear infinite;
    opacity: 0.5;
    z-index: -1;
}

.art-circle.playing::before { animation-duration: 2s; }

@keyframes rotate { 100% { transform: rotate(360deg); } }

.track-info {
    text-align: center;
    margin-bottom: 30px;
    user-select: none;
}

.track-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

.track-status {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* ویژوالایزر */
.visualizer-wrapper {
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    position: relative;
}

canvas {
    width: 100%;
    height: 100%;
}

.controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: rgba(15, 23, 42, 0.4);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.main-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

.play-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px -5px var(--primary-glow);
    transition: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.play-btn:hover { transform: scale(1.05); box-shadow: 0 15px 35px -5px var(--primary-glow); }
.play-btn:active { transform: scale(0.95); }

.volume-container {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 10px;
}

.volume {
    font-size: 12px;
    border: 1px solid var(--glass-border);
    padding: 1px 5px;
    border-radius: 10px;
    width: 55px;
    text-align: center;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-main);
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
    transition: 0.2s;
}

.sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 350px;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(30px);
    z-index: 100;
    padding: 25px;
    box-shadow: -10px 0 40px rgba(0,0,0,0.6);
    transition: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    user-select: none;
}

.sidebar.active { right: 0; }

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
}

.station-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
    padding-left: 5px;
}

.station-list::-webkit-scrollbar { width: 4px; }
.station-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

.station-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid transparent;
    cursor: pointer;
    transition: 0.2s;
}

.station-item:hover { background: rgba(255,255,255,0.08); }
.station-item.active { background: rgba(99, 102, 241, 0.15); border-color: var(--primary); }

.s-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    margin-left: 15px;
    color: #fff;
}

.s-details { flex: 1; }
.s-name { font-weight: 600; font-size: 1rem; margin-bottom: 4px; }
.s-group {
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid;
    width: 60px;
    border-radius: 15px;
    text-align: center;
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.overlay.active { opacity: 1; visibility: visible; }