:root {
    --bg-dark: #070d14;
    --bg-panel: #0d1b2a;
    --primary: #d4213d;
    --secondary: #e8912d;
    --text-main: #fafaf8;
    --text-muted: #8e9bb0;
    --accent: #e8912d;
    --danger: #e63946;
    --glow: rgba(232, 145, 45, 0.4);
    --border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Tajawal', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#stars {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none;
}
.star {
    position: absolute; background: white; border-radius: 50%;
    animation: twinkle linear infinite;
}
@keyframes twinkle {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

.radio-nav {
    background: rgba(13, 27, 42, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 15px 20px;
    position: sticky; top: 0; z-index: 100;
}
.nav-content {
    max-width: 800px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
}
.site-logo {
    color: var(--secondary); font-family: 'Lalezar', cursive; font-size: 1.5rem;
    text-decoration: none; display: flex; align-items: center; gap: 10px;
}
.admin-btn {
    background: none; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer;
    transition: color 0.3s;
}
.admin-btn:hover { color: var(--text-main); }

.radio-container {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    padding: 30px 20px; position: relative;
}
.dunes {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 30vh; z-index: -1;
}

.radio-main {
    background: rgba(13, 27, 42, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 20px;
    width: 100%; max-width: 450px;
    padding: 30px; box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    z-index: 10;
}

.radio-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;
}
.on-air-badge {
    background: rgba(230, 57, 70, 0.2); color: var(--danger);
    padding: 5px 12px; border-radius: 20px; font-weight: bold; font-size: 0.9rem;
    display: flex; align-items: center; gap: 8px;
}
.pulse-dot {
    width: 8px; height: 8px; background: var(--danger); border-radius: 50%;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(230, 57, 70, 0); }
    100% { box-shadow: 0 0 0 0 rgba(230, 57, 70, 0); }
}

.listeners-badge { color: var(--text-muted); font-size: 0.9rem; }

.artwork-stage {
    position: relative; width: 250px; height: 250px; margin: 0 auto 30px;
    border-radius: 20px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.image-slider { width: 100%; height: 100%; }
.slide {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center;
    opacity: 0; transition: opacity 1s ease;
}
.slide.active { opacity: 1; }

.equalizer {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 60px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    display: flex; justify-content: center; align-items: flex-end; gap: 5px;
    padding-bottom: 15px; opacity: 0; transition: opacity 0.3s;
}
.equalizer.playing { opacity: 1; }
.equalizer span {
    width: 6px; background: var(--secondary); border-radius: 3px;
    animation: eq 1s infinite alternate ease-in-out;
}
@keyframes eq { 0% { height: 5px; } 100% { height: 30px; } }
.equalizer span:nth-child(1) { animation-delay: -0.2s; }
.equalizer span:nth-child(2) { animation-delay: -0.5s; }
.equalizer span:nth-child(3) { animation-delay: 0s; }
.equalizer span:nth-child(4) { animation-delay: -0.8s; }
.equalizer span:nth-child(5) { animation-delay: -0.4s; }

.station-info { text-align: center; margin-bottom: 30px; }
.station-name { font-family: 'Lalezar', cursive; font-size: 2rem; color: var(--secondary); margin-bottom: 5px; }
.tagline { color: var(--text-main); font-size: 1.1rem; margin-bottom: 10px; }
.description { color: var(--text-muted); font-size: 0.9rem; line-height: 1.5; }

.player-controls { text-align: center; }
.status-text { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 15px; min-height: 20px; }

.play-btn {
    width: 70px; height: 70px; border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), #d6801c);
    border: none; color: white; font-size: 1.5rem; cursor: pointer;
    box-shadow: 0 5px 20px var(--glow); transition: all 0.3s;
    display: flex; justify-content: center; align-items: center; margin: 0 auto 25px;
}
.play-btn:hover { transform: scale(1.05); box-shadow: 0 8px 25px var(--glow); }

.controls-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.volume-control {
    flex: 1; display: flex; align-items: center; gap: 10px; color: var(--text-muted);
}
#volumeSlider {
    flex: 1; -webkit-appearance: none; height: 4px; background: var(--border); border-radius: 2px;
}
#volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%;
    background: var(--secondary); cursor: pointer;
}
.action-buttons { display: flex; gap: 15px; }
.icon-btn { background: none; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; transition: color 0.3s; }
.icon-btn:hover, .icon-btn.active { color: var(--secondary); }

.sleep-timer-display {
    margin-top: 15px; background: rgba(255,255,255,0.05); padding: 8px 15px; border-radius: 15px;
    display: inline-flex; align-items: center; gap: 10px; font-size: 0.9rem;
}
#cancelSleepTimer { background: none; border: none; color: var(--danger); cursor: pointer; }

/* Ticker */
.ticker-bar {
    margin-top: 30px; display: flex; background: rgba(0,0,0,0.3); border-radius: 10px; overflow: hidden;
}
.ticker-label {
    background: var(--primary); color: white; padding: 8px 15px; font-weight: bold; white-space: nowrap; z-index: 2;
}
.ticker-wrap { flex: 1; overflow: hidden; position: relative; padding: 8px 0; }
.ticker-move {
    display: inline-flex; white-space: nowrap; animation: ticker 20s linear infinite; gap: 50px;
}
@keyframes ticker { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }

/* Ads */
.radio-ads { margin-top: 20px; height: 80px; position: relative; border-radius: 10px; overflow: hidden; }
.ad-slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.5s; }
.ad-slide.active { opacity: 1; }
.ad-slide img { width: 100%; height: 100%; object-fit: cover; }

/* Modals & Admin */
.modal, .admin-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); z-index: 1000; align-items: center; justify-content: center;
}
.modal.show, .admin-overlay.show { display: flex; }
.modal-content { background: var(--bg-panel); padding: 30px; border-radius: 15px; width: 90%; max-width: 350px; text-align: center; }
.timer-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0; }
.timer-options button { padding: 10px; background: rgba(255,255,255,0.1); border: none; color: white; border-radius: 8px; cursor: pointer; }
.timer-options button:hover { background: var(--secondary); }
.btn-cancel { width: 100%; padding: 10px; background: none; border: 1px solid var(--border); color: white; border-radius: 8px; cursor: pointer; }

.admin-panel {
    position: fixed; top: 0; right: -400px; width: 400px; max-width: 100%; height: 100%;
    background: var(--bg-panel); border-left: 1px solid var(--border); z-index: 1001;
    padding: 20px; transition: right 0.3s; overflow-y: auto;
}
.admin-panel.open { right: 0; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
#closeAdmin { background: none; border: none; color: white; font-size: 1.2rem; cursor: pointer; }
.form-group { margin-bottom: 15px; text-align: right; }
.form-group label { display: block; margin-bottom: 5px; color: var(--text-muted); font-size: 0.9rem; }
.form-group input, .form-group textarea {
    width: 100%; padding: 10px; background: rgba(0,0,0,0.3); border: 1px solid var(--border);
    color: white; border-radius: 5px; font-family: inherit;
}
.save-btn {
    width: 100%; padding: 12px; background: var(--primary); color: white; border: none;
    border-radius: 5px; cursor: pointer; font-size: 1rem; font-family: inherit; font-weight: bold;
}

.toast {
    position: fixed; bottom: -50px; left: 50%; transform: translateX(-50%);
    background: var(--secondary); color: white; padding: 10px 20px; border-radius: 30px;
    transition: bottom 0.3s; z-index: 2000;
}
.toast.show { bottom: 20px; }
