:root {
    --primary: #7A1F35;
    --primary-glow: rgba(122, 31, 53, 0.4);
    --secondary: #5DA7D1;
    --secondary-glow: rgba(93, 167, 209, 0.3);
    --bg-dark: #08080A;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-heavy: rgba(255, 255, 255, 0.07);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #FFFFFF;
    --text-dim: rgba(255, 255, 255, 0.6);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

@keyframes flow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Outfit', 'Inter', sans-serif;
    height: 100vh;
    height: -webkit-fill-available;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.app-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 50% -20%, var(--primary-glow) 0%, transparent 50%),
        radial-gradient(circle at 0% 100%, var(--secondary-glow) 0%, transparent 40%);
}

/* Organic Background Mesh */
.bg-mesh {
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0.4;
    background: linear-gradient(-45deg, #08080a, #120509, #050d12, #08080a);
    background-size: 400% 400%;
    animation: flow 15s infinite ease-in-out;
}

/* Header Refinement */
.app-header {
    padding: 2rem 1.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.app-logo {
    height: 34px;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.1));
    transition: transform 0.3s ease;
}

.app-logo:hover {
    transform: scale(1.05);
}

.nav-btn-highlight {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 10px 18px;
    border-radius: 14px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn-highlight:hover {
    background: var(--glass-heavy);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.status-badge {
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
}

/* Main Display */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1vh 2rem;
    z-index: 5;
    min-height: 0;
}

.player-section {
    width: 100%;
    max-width: 420px;
    height: 100%;
    max-height: 600px;
    /* Prevent stretching on tall screens */
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
}

.art-container {
    position: relative;
    width: min(280px, 45vh);
    height: min(280px, 45vh);
    margin: 0 auto;
    perspective: 1000px;
    flex-shrink: 1;
}

.disc-rotating {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    padding: clamp(6px, 2vh, 12px);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.6),
        inset 0 0 20px rgba(255, 255, 255, 0.02);
    animation: rotate 25s linear infinite;
    animation-play-state: paused;
}

.playing .disc-rotating {
    animation-play-state: running;
}

.disc-shadow {
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: var(--primary);
    filter: blur(40px);
    opacity: 0;
    transition: opacity 1s ease;
    z-index: -1;
}

.playing .disc-shadow {
    opacity: 0.15;
}

.disc-rotating img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-dark);
}

/* Reflective Overlay */
.disc-rotating::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, transparent 50%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Visualizer Style */
.visualizer {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    height: 50px;
    display: flex;
    align-items: center;
    gap: 4px;
    pointer-events: none;
}

.v-bar {
    background: linear-gradient(to top, var(--secondary), #fff);
    box-shadow: 0 0 10px var(--secondary-glow);
    transition: height 0.1s ease;
}

/* Track Info Refined */
.track-info {
    margin-bottom: 1.5rem;
    animation: float 6s infinite ease-in-out;
}

.station-name {
    font-weight: 800;
    font-size: clamp(1.8rem, 5vh, 2.4rem);
    letter-spacing: -1px;
    background: linear-gradient(to bottom, #fff, #ccc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.slogan {
    color: var(--text-dim);
    font-size: clamp(0.85rem, 2vh, 1rem);
    font-weight: 300;
    letter-spacing: 1px;
}

/* Advanced Controls Card */
.controls-container {
    background: var(--glass);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    padding: clamp(1.5rem, 3vh, 2rem) 2rem;
    border-radius: 35px;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.main-play-btn {
    width: clamp(70px, 10vh, 90px);
    height: clamp(70px, 10vh, 90px);
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    border-radius: 50%;
    color: white;
    font-size: clamp(1.8rem, 4vh, 2.2rem);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.2rem;
    box-shadow: 0 10px 25px var(--primary-glow);
    position: relative;
}

.main-play-btn::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    opacity: 0.3;
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.9);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.main-play-btn:hover {
    transform: scale(1.05) rotate(5deg);
}

.main-play-btn:active {
    transform: scale(0.95);
}

/* Premium Volume Slider */
.volume-container {
    display: flex;
    align-items: center;
    gap: 20px;
    color: var(--text-dim);
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    border: 3px solid var(--primary);
}

/* Footer & Nav */
.bottom-nav {
    padding: 1rem 2rem calc(1rem + var(--safe-area-bottom));
    background: rgba(8, 8, 10, 0.9);
    backdrop-filter: blur(25px);
    display: flex;
    justify-content: space-around;
    border-top: 1px solid var(--glass-border);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-item i {
    font-size: 1.4rem;
    margin-bottom: 2px;
}

.nav-item.active {
    color: var(--secondary);
    text-shadow: 0 0 15px var(--secondary-glow);
}

.nav-item:hover {
    color: #fff;
}