:root {
    --accent: #FF8C00;
    --accent-glow: rgba(255, 140, 0, 0.4);
    --bg-dark: #000000;
    --bg-panel: #121212;
    --bg-glass: rgba(255, 255, 255, 0.05);
    --text-main: #FFFFFF;
    --text-dim: #A0A0A0;
    --sidebar-width: 260px;
    --player-height: 90px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-dark);
    height: 100vh;
    overflow: hidden;
}

/* --- COMMON UTILS --- */
.mobile-header {
    display: none;
}

/* --- DESKTOP LAYOUT --- */
.app-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: 1fr var(--player-height);
    height: 100vh;
}

.sidebar {
    background-color: #050505;
    padding: 30px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 100;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 50px;
}

.mini-logo {
    height: 35px;
}

.brand-name {
    font-weight: 900;
    letter-spacing: 2px;
    font-size: 1.3rem;
    color: var(--accent);
}

.sidebar-nav li {
    padding: 14px 20px;
    margin-bottom: 10px;
    border-radius: 15px;
    cursor: pointer;
    color: var(--text-dim);
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.sidebar-nav li:hover {
    color: var(--text-main);
    background: var(--bg-glass);
}

.sidebar-nav li.active {
    color: white;
    background: linear-gradient(135deg, var(--accent), #FF4500);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.main-view {
    background: radial-gradient(circle at top right, #1a1a1a 0%, #000 100%);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: relative;
}

.main-header {
    height: 80px;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.search-bar {
    background: var(--bg-glass);
    padding: 12px 24px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    gap: 15px;
    width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.search-bar input {
    background: none;
    border: none;
    color: white;
    width: 100%;
    outline: none;
}

.live-status {
    color: var(--accent);
    font-weight: 900;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
}

.pulse {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.content-scroll {
    padding: 30px 40px;
}

.grid-title {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 30px;
    letter-spacing: -1px;
}

/* Cards */
.stations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 30px;
}

.station-card {
    background: #111;
    border-radius: 20px;
    padding: 18px;
    transition: transform 0.3s, background 0.3s;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.station-card:hover {
    background: #181818;
    transform: translateY(-5px);
}

.card-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Desktop Player Bar */
.player-bar {
    grid-column: 1 / 3;
    background: #000;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: grid;
    grid-template-columns: 350px 1fr 350px;
    align-items: center;
    padding: 0 40px;
    z-index: 1000;
}

.now-playing {
    display: flex;
    align-items: center;
    gap: 20px;
}

.track-artwork {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
}

.track-artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.track-info h3 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.track-info p {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 30px;
}

.control-buttons button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
}

.play-main {
    width: 50px;
    height: 50px;
    background: white;
    color: black;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1rem;
}

.bottom-nav {
    display: none;
}

/* --- POPUP MODE (TOTAL TRANSFORMATION) --- */

body.popup-mode {
    background: #000;
}

body.popup-mode .desktop-only {
    display: none !important;
}

body.popup-mode .app-container {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    grid-template-rows: none;
    height: 100vh;
}

body.popup-mode .main-view {
    height: 100%;
    background: #000;
}

/* App Header */
body.popup-mode .mobile-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 60px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 1001;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.popup-mode .mobile-logo {
    height: 28px;
}

body.popup-mode .mobile-brand {
    font-weight: 900;
    letter-spacing: 2px;
    font-size: 1rem;
    color: var(--accent);
}

/* App Content */
body.popup-mode .content-scroll {
    padding: 20px;
    padding-bottom: 180px;
    /* Space for absolute floating elements */
}

body.popup-mode .grid-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
}

body.popup-mode .stations-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

/* Floating App Player Bar */
body.popup-mode .player-bar {
    position: fixed;
    bottom: 85px;
    /* Above bottom nav */
    left: 12px;
    right: 12px;
    width: auto;
    height: 75px;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 1);
    grid-template-columns: none;
}

body.popup-mode .now-playing {
    width: 70%;
    gap: 12px;
}

body.popup-mode .track-artwork {
    width: 50px;
    height: 50px;
}

body.popup-mode .track-info h3 {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.popup-mode .track-info p {
    font-size: 0.75rem;
}

body.popup-mode .player-controls {
    width: auto;
    flex-direction: row;
}

body.popup-mode .control-buttons {
    gap: 0;
}

body.popup-mode .play-main {
    width: 42px;
    height: 42px;
}

body.popup-mode #prev-btn,
body.popup-mode #next-btn,
body.popup-mode .progress-container,
body.popup-mode .player-volume,
body.popup-mode .favorite-btn {
    display: none !important;
}

/* App Bottom Navigation */
body.popup-mode .bottom-nav {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 75px;
    background: #080808;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 1002;
    padding-bottom: env(safe-area-inset-bottom);
}

body.popup-mode .bottom-nav ul {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    list-style: none;
    max-width: 500px;
    margin: 0 auto;
}

body.popup-mode .bottom-nav li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-dim);
    transition: color 0.2s;
    cursor: pointer;
    flex: 1;
}

body.popup-mode .bottom-nav li i {
    font-size: 1.4rem;
}

body.popup-mode .bottom-nav li span {
    font-size: 0.7rem;
    font-weight: 600;
}

body.popup-mode .bottom-nav li.active {
    color: var(--accent);
}