:root {
    --primary-yellow: #FFEA00;
    /* Adjusted to match logo brightness */
    --primary-black: #111111;
    --secondary-black: #1a1a1a;
    --text-white: #ffffff;
    --text-grey: #888888;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--primary-black);
    color: var(--text-white);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
    /* GLOBAL NO SCROLL */
    /* Guitar Background adjusted for BODY */
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.5)),
        url('../assets/rock_bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.app-container {
    width: 100%;
    height: 100dvh;
    /* Background removed from here, now on body */
    background-color: rgba(26, 26, 26, 0.95);
    /* Semi-transparent to let body BG show through */
    backdrop-filter: blur(5px);
    /* Optional: slight blur for readability */
    padding: 20px 20px calc(80px + env(safe-area-inset-bottom)) 20px;
    /* Space for tabs + safe area */
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    /* CONTAINER NO SCROLL */
}

/* ... existing media query ... */

/* ... */

/* Main Content Area */
.content-area {
    flex: 1;
    overflow: hidden;
    /* INTERNAL NO SCROLL - Force fit */
    position: relative;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
}

/* Desktop/Large Screen "Phone Mode" */
@media (min-width: 480px) {
    .app-container {
        max-width: 351px;
        /* iPhone 13/14 width approx */
        height: 85vh;
        max-height: 780px;
        padding-bottom: 110px;
        /* Extra safe space for bottom tabs */
        margin: auto;
        border-radius: 40px;
        box-shadow: 0 0 0 12px #111, 0 0 0 14px #333, 0 20px 50px rgba(0, 0, 0, 0.5);
        border: 2px solid #333;
        overflow: hidden;
    }

    /* On Desktop Phone Mockup, keep it absolute to the container */
    .bottom-tabs {
        position: absolute;
        padding: 15px 0 20px 0;
        border-radius: 0 0 35px 35px;
        overflow: hidden;
        z-index: 100;
        bottom: 0px;
    }
}

.hidden {
    display: none !important;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    /* Reduced from 20px to bring logo up */
}

.header-pill {
    background-color: var(--primary-yellow);
    padding: 8px 25px;
    border-radius: 0 0 20px 20px;
    color: var(--primary-black);
    font-weight: 700;
    margin-top: -30px;
    /* Pull it up to stick to top edge look */
    padding-top: 35px;
    /* Compensate for pull up */
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--primary-yellow);
    font-size: 1.2rem;
    cursor: pointer;
}

/* Album Art */
.album-art-container {
    display: flex;
    justify-content: center;
    margin: 5px 0;
    align-items: center;
    width: 100%;
}

.album-art {
    width: 180px;
    height: 180px;
    max-height: 20vh;
    max-width: 20vh;
    flex-shrink: 1;
    background-color: var(--primary-yellow);
    border-radius: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    padding: 15px;
}

.album-art img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Waveform */
.waveform-container {
    margin: 0;
    flex-shrink: 0;
}

.playback-status {
    text-align: center;
    color: var(--text-white);
    letter-spacing: 2px;
    font-weight: 700;
    margin: 2px 0;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.song-meta {
    text-align: center;
    color: var(--primary-yellow);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 2px;
    height: 1.5em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 20px;
    flex-shrink: 0;
}

/* Controls */
.controls-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0px;
    flex-shrink: 0;
    position: relative;
    z-index: 500;
}

/* Media Query for small height screens (e.g. iPhone 6/7/8, SE) */
@media (max-height: 720px) {
    .app-container {
        padding: 10px 15px 70px 15px;
    }

    .header-pill {
        padding: 5px 20px 25px 20px;
        margin-top: -25px;
        font-size: 0.9rem;
    }

    .album-art-container {
        margin: 5px 0;
    }

    .album-art {
        width: 150px;
        height: 150px;
        border-radius: 30px;
        padding: 15px;
    }

    .tab-view.active {
        gap: 5px;
    }

    .song-meta {
        margin-bottom: 5px;
        font-size: 1rem;
    }

    .song-genre {
        font-size: 0.8rem !important;
    }

    .controls-container {
        margin-bottom: 5px;
    }

    .control-btn.primary {
        width: 65px;
        height: 65px;
        font-size: 2rem;
    }

    .waveform {
        height: 40px;
    }
}

.waveform {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3px;
    height: 50px;
}

.bar {
    width: 4px;
    background-color: #555;
    border-radius: 2px;
    height: 10px;
    transition: height 0.05s ease;
    /* Faster transition for real-time feel */
}

.waveform.active .bar {
    background: linear-gradient(to top, #555 0%, var(--primary-yellow) 100%);
    animation: bounce 1.2s infinite ease-in-out;
}

/* Randomize animations for bars */
.bar:nth-child(2n) {
    animation-duration: 1.1s;
}

.bar:nth-child(3n) {
    animation-duration: 1.3s;
}

.bar:nth-child(4n) {
    animation-duration: 0.9s;
}

.bar:nth-child(5n) {
    animation-duration: 1.4s;
}

@keyframes bounce {

    0%,
    100% {
        height: 10px;
        opacity: 0.5;
    }

    50% {
        height: 40px;
        opacity: 1;
    }
}

.time-display {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    color: var(--text-grey);
    font-size: 0.8rem;
    font-weight: 600;
}

/* LIVE / ON AIR Red State */
.time-display span.active-red {
    color: #FF0000;
    /* Red when playing */
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}


.song-genre {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-white);
    margin-top: 5px;
    letter-spacing: 1px;
    font-weight: 500;
}

.genre-label {
    color: var(--text-grey);
    margin-right: 5px;
    font-weight: 700;
    font-size: 0.8rem;
}


.control-btn {
    background: none;
    border: none;
    color: var(--text-white);
    cursor: pointer;
    transition: transform 0.2s;
}

.control-btn:active {
    transform: scale(0.9);
}

.control-btn.secondary {
    font-size: 2rem;
}

.control-btn.primary {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--text-white);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    overflow: visible;
    /* Prevent any clipping */
}

/* Optical centering for play icon ONLY */
.control-btn.primary #playIcon {
    margin-left: 5px;
}

/* Logo Area */
.station-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
}

.station-logo img {
    max-width: 150px;
    height: auto;
    object-fit: contain;
}

/* Main Content Area */
.content-area {
    flex: 1;
    overflow: hidden;
    /* FORCE NO SCROLL */
    position: relative;
    padding-bottom: 0;
    display: flex;
    /* Ensure it behaves as flex parent for height calc */
    flex-direction: column;
    min-height: 0;
    /* Critical for nested flex scrolling rejection */
}

.content-area::-webkit-scrollbar {
    display: none;
}

/* Tabs Views */
.tab-view {
    display: none;
    flex-direction: column;
    height: 100%;
    animation: fadeIn 0.3s ease;
}

.tab-view.active {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Start from top to reduce header-logo gap */
    gap: 10px;
    /* Reduced gap */
    height: 100%;
    /* Take full height of content-area */
    padding-bottom: 0;
    overflow: hidden;
    /* Force no scroll */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Social Content Styles */
.social-embed-container {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: #111;
    border-radius: 20px;
    margin-top: 20px;
}

.embed-placeholder {
    text-align: center;
}

.embed-placeholder h3 {
    color: var(--primary-yellow);
    margin: 15px 0 5px;
}

.embed-placeholder p {
    color: var(--text-grey);
    margin-bottom: 20px;
}

.social-link-btn {
    display: inline-block;
    padding: 10px 25px;
    background: var(--primary-yellow);
    color: var(--primary-black);
    text-decoration: none;
    font-weight: 700;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.2);
}

/* Bottom Tabs Navigation */
.bottom-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #111;
    /* Dark background for contrast */
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px 0 calc(15px + env(safe-area-inset-bottom)) 0;
    border-top: 1px solid #222;
    z-index: 1000;
    /* Ensure on top of everything */
}


.tab-btn {
    background: none;
    border: none;
    color: var(--text-grey);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: color 0.2s;
}

.tab-btn i {
    font-size: 1.4rem;
}

.tab-btn.active {
    color: var(--primary-yellow);
}

.tab-btn.active i {
    transform: translateY(-2px);
}

/* Social Sheet Removed for Tabs */