:root {
    --bg-dark: #0f111a;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.5);
    --secondary: #ec4899;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --nav-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
    /* Prevent body scroll, handle inside app-main */
}

/* Mobile App Container to constrain width on desktop */
.app-container {
    width: 100%;
    max-width: 450px;
    /* Simulate mobile width on desktop */
    height: 100vh;
    height: 100dvh;
    /* Modern viewport height */
    position: relative;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at top right, #1f2235, #0f111a);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* --- Header --- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 1.5rem;
    color: var(--primary);
}

.logo h1 {
    font-size: 1.4rem;
    font-weight: 700;
}

.logo span {
    color: var(--primary);
    font-weight: 300;
}

.icon-btn {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.icon-btn:hover,
.icon-btn:active {
    background: var(--bg-card-hover);
    transform: scale(1.05);
}

/* --- Main Content Area --- */
.app-main {
    flex: 1;
    overflow-y: auto;
    position: relative;
    padding-bottom: var(--nav-height);
    /* Space for bottom nav */
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 20px 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
    transform: translateX(20px);
    overflow-y: auto;
    /* Hide scrollbar for clean look */
    scrollbar-width: none;
}

.screen::-webkit-scrollbar {
    display: none;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
    transform: translateX(0);
}

/* --- Radio Player Screen --- */
.now-playing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    margin-bottom: 40px;
}

.album-art {
    width: 220px;
    height: 220px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin-bottom: 30px;
    z-index: 2;
}

.album-art i {
    font-size: 4rem;
    color: white;
    z-index: 5;
}

.ripple-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px solid var(--primary);
    opacity: 0;
    z-index: 1;
}

.glow-effect.playing .ripple-ring {
    animation: ripple 3s linear infinite;
}

.glow-effect.playing .ring-2 {
    animation-delay: 1s;
}

.glow-effect.playing .ring-3 {
    animation-delay: 2s;
}

@keyframes ripple {
    0% {
        width: 220px;
        height: 220px;
        opacity: 0.8;
    }

    100% {
        width: 400px;
        height: 400px;
        opacity: 0;
        border-color: var(--secondary);
    }
}

.glow-effect.playing {
    animation: breathe 3s ease-in-out infinite alternate;
}

@keyframes breathe {
    0% {
        box-shadow: 0 0 20px var(--primary-glow);
    }

    100% {
        box-shadow: 0 0 50px var(--primary-glow), 0 0 20px var(--secondary);
    }
}

.track-info {
    text-align: center;
}

.track-info h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.track-info p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Player Controls */
.player-controls {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 30px;
    backdrop-filter: blur(20px);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    color: var(--text-muted);
}

.volume-control input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--text-main);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.main-buttons {
    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;
    font-size: 1.8rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.play-btn:active {
    transform: scale(0.9);
}

.play-btn i {
    margin-left: 5px;
    /* Offset to center the play icon visually */
}

.play-btn i.fa-pause,
.play-btn i.fa-spinner {
    margin-left: 0;
}

/* --- Schedule Screen --- */
.section-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--glass-border);
}

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.schedule-item {
    display: flex;
    gap: 20px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    padding: 15px;
    border-radius: 15px;
    transition: transform 0.3s;
}

.schedule-item.active {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    border-left: 4px solid var(--primary);
}

.schedule-item .time {
    font-weight: 700;
    color: var(--primary);
    min-width: 70px;
}

.schedule-item .details h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.schedule-item .details p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- Settings Screen --- */
.settings-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    padding: 15px 20px;
    border-radius: 15px;
}

.settings-item.link {
    cursor: pointer;
}

.settings-item.link:active {
    background: var(--bg-card-hover);
}

.setting-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.setting-info i {
    color: var(--primary);
    width: 20px;
    text-align: center;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
    background-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(24px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* --- Bottom Navigation --- */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(15, 17, 26, 0.85);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: color 0.3s ease;
    width: 33%;
}

.nav-item i {
    font-size: 1.3rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-item span {
    font-size: 0.75rem;
    font-weight: 600;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary);
}

.nav-item.active i {
    transform: translateY(-3px) scale(1.1);
}

/* =========================================
   ADMIN STUDIO STYLES (Extracted from admin.html)
   ========================================= */

.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

/* Login Screen Override */
#screen-login {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 40px 30px;
}

.login-logo {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px rgba(99, 102, 241, 0.5));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.login-input {
    width: 100%;
    padding: 18px 20px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    font-size: 1.1rem;
    outline: none;
    transition: all 0.3s;
    font-family: inherit;
}

.login-input:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.login-btn {
    padding: 18px;
    border-radius: 16px;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
    font-family: inherit;
}

.login-btn:hover,
.login-btn:active {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(99, 102, 241, 0.4);
}

.error-msg {
    color: #ef4444;
    margin-top: 15px;
    display: none;
    text-align: center;
    font-weight: 500;
    background: rgba(239, 68, 68, 0.1);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Broadcast Screen */
#screen-broadcast {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 30px;
}

.status-badge {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 25px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 40px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
    transition: all 0.3s;
}

.status-dot.live {
    background: #10b981;
    box-shadow: 0 0 15px #10b981;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

#status-text {
    font-weight: 700;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.mic-button {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-card), rgba(0, 0, 0, 0.5));
    border: 2px solid var(--glass-border);
    color: white;
    font-size: 3.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-bottom: 20px;
    position: relative;
}

.mic-button::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: all 0.4s;
    pointer-events: none;
}

.mic-button.is-live {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: #f87171;
    box-shadow: 0 15px 35px rgba(239, 68, 68, 0.4);
    animation: float 3s ease-in-out infinite;
}

.mic-button.is-live::before {
    border-color: rgba(239, 68, 68, 0.3);
    animation: ripple-mic 2s infinite;
}

@keyframes ripple-mic {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

.mic-button:active {
    transform: scale(0.9);
}

#timer {
    font-family: monospace;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 30px;
    color: var(--primary);
}

.meter-container {
    width: 80%;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.meter-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #10b981, #34d399);
    transition: width 0.1s linear;
}

/* Analytics Screen */
.analytics-container {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
}

.live-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

.live-stat i {
    font-size: 2.5rem;
    color: var(--secondary);
    background: rgba(236, 72, 153, 0.15);
    padding: 15px;
    border-radius: 15px;
}

.stat-text {
    text-align: right;
}

.stat-text h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.stat-text p {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.chart-wrapper {
    width: 100%;
    height: 250px;
    position: relative;
}