/* Basic Reset and Font */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #ffffff;
    /* Default dark bluish gradient */
    background: linear-gradient(160deg, #232a44 0%, #151823 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    /* Prevent body from scrolling on mobile */
    overscroll-behavior-y: contain;
}

/* --- Mobile Container --- */
.mobile-container {
    width: 375px; 
    height: 812px; 
    /* Background is now transparent to let the body background show */
    background: transparent;
    border-radius: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden; /* This is key for the sticky footer */
    position: relative;
    display: flex;
    flex-direction: column;
}

/* --- Header & Player --- */
.header {
    text-align: center;
    padding: 25px 20px 15px 20px;
    /* Flex properties to keep it at the top */
    flex-shrink: 0;
    width: 100%;
    z-index: 10;
}

.logo-container {
    margin: 0 auto 15px auto;
    width: 100px;
    height: 100px;
    transition: all 0.3s ease;
}
.logo-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    background-color: #fff;
}

/* Style for the first-load banner */
.logo-container.banner {
    /* Override the 100px width/height */
    width: 100%;
    height: auto; /* Let the image's aspect ratio set the height */
    margin-bottom: 15px;
}
.logo-container.banner img {
    /* Make the banner image full-width */
    width: 100%;
    height: auto; /* Maintain aspect ratio */
    
    /* Remove styles meant for station logos */
    border-radius: 0;
    box-shadow: none;
    background-color: transparent;
    object-fit: contain; /* Ensures the whole image is visible */
}


.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 20px;
}

/* Selects the h1 tag *only* when it comes after the .banner */
.logo-container.banner + h1 {
    display: none; /* Hides the title element completely */
}


/* This holds all player controls */
.player-ui {
    padding-top: 15px;
}

.player-controls {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px 40px 10px 40px; 
}
.control-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.75rem;
    cursor: pointer;
    transition: color 0.2s;
}
.control-btn:hover {
    color: #fff;
}
/* Main Play/Pause Button */
.play-btn {
    background-color: #ffffff;
    color: #232a44; /* Match dark bg */
    width: 70px;
    height: 70px;
    border-radius: 50%;
    font-size: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
.play-btn .fa-play { margin-left: 5px; }
.play-btn .fa-pause { margin-left: 0; }

/* Header Star Button */
.star-btn i.active {
    font-family: "Font Awesome 6 Free";
    font-weight: 900; /* Solid */
    color: #ffd700;
    transform: scale(1.1);
}

/* Volume Slider */
.volume-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 40px 5px 40px;
}
.volume-container i {
    color: rgba(255, 255, 255, 0.6);
}
.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    outline: none;
}
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
}
.volume-slider::-moz-range-thumb {
    width: 15px;
    height: 15px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
}

/* --- Visualizer & Loading --- */
.loading-indicator {
    display: none; /* Hidden by default */
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    height: 40px;
    line-height: 40px;
}
#audio-visualizer {
    display: none; /* Hidden by default */
    height: 40px;
    width: 100%;
}

/* CSS Fallback Visualizer */
.visualizer-fallback {
    display: none; /* Hidden by default */
    height: 40px;
    align-items: center;
    justify-content: center;
    gap: 2px;
}
.visualizer-fallback span {
    width: 4px;
    background: rgba(255, 255, 255, 0.8);
    animation: fallback-wave 0.8s infinite ease-in-out;
}
/* When stopped, bars are low */
.visualizer-fallback.stopped span {
    height: 4px;
    animation: none;
}
/* Stagger the animation */
.visualizer-fallback span:nth-child(1) { height: 15px; animation-delay: 0.1s; }
.visualizer-fallback span:nth-child(2) { height: 25px; animation-delay: 0.3s; }
.visualizer-fallback span:nth-child(3) { height: 35px; animation-delay: 0.5s; }
.visualizer-fallback span:nth-child(4) { height: 30px; animation-delay: 0.2s; }
.visualizer-fallback span:nth-child(5) { height: 15px; animation-delay: 0.4s; }
.visualizer-fallback span:nth-child(6) { height: 25px; animation-delay: 0.1s; }
.visualizer-fallback span:nth-child(7) { height: 35px; animation-delay: 0.3s; }
.visualizer-fallback span:nth-child(8) { height: 30px; animation-delay: 0.5s; }
.visualizer-fallback span:nth-child(9) { height: 15px; animation-delay: 0.2s; }
.visualizer-fallback span:nth-child(10) { height: 25px; animation-delay: 0.4s; }

@keyframes fallback-wave {
    0%, 100% { transform: scaleY(0.2); }
    50% { transform: scaleY(1.0); }
}

/* --- Search Bar --- */
.search-container {
    padding: 0 25px 15px 25px;
    position: relative;
    flex-shrink: 0; /* Prevents shrinking */
    z-index: 10;
}
.search-container .fa-search {
    position: absolute;
    top: 13px;
    left: 45px;
    color: #333333; /* CHANGED */
}
.search-container input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border: none;
    border-radius: 20px;
    background-color: #ffffff; /* CHANGED */
    color: #000000; /* CHANGED */
    font-size: 1rem;
}
.search-container input::placeholder {
    color: #777777; /* CHANGED */
    font-weight: 500;
}

/* --- Content List (Scrollable) --- */
.content-list {
    flex-grow: 1; /* This makes it fill the remaining space */
    padding: 0 25px;
    overflow-y: auto; /* This makes ONLY the list scroll */
}
/* Custom scrollbar */
.content-list::-webkit-scrollbar {
    width: 6px;
}
.content-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.list-item {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.05); 
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.list-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
.item-logo-container {
    width: 60px; 
    height: 60px;
    border-radius: 12px; 
    background-color: #ffffff; 
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; 
    flex-shrink: 0; 
}
.item-logo-container img {
    width: 100%; 
    height: 100%; 
    object-fit: contain; 
    padding: 5px; 
}

.item-details {
    flex-grow: 1;
    margin-left: 15px; 
    display: flex;
    flex-direction: column;
    /* Prevent text from overflowing */
    min-width: 0; 
}
.item-details .title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 3px;
    /* Ellipsis for long titles */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.item-details .subtitle {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px; 
    display: flex;
    align-items: center;
}
.item-details .subtitle .fa-location-dot {
    margin-right: 5px;
    font-size: 0.7rem; 
}

.genre-tags {
    display: flex;
    flex-wrap: wrap; 
    gap: 6px; 
}
.tag {
    background-color: transparent; 
    border: 1px solid rgba(255, 255, 255, 0.7); 
    color: #ffffff;
    font-size: 0.7rem;
    padding: 4px 10px; 
    border-radius: 20px; 
    white-space: nowrap; 
}

.item-actions {
    margin-left: 10px;
}
.item-actions .fa-star {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}
.item-actions .fa-star.active {
    color: #ffd700;
    transform: scale(1.1);
}

/* --- Bottom Navigation (Sticky) --- */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    padding: 15px 0;
    /* Semi-transparent dark bg */
    background-color: rgba(0, 0, 0, 0.2);
    flex-shrink: 0; /* Prevents shrinking */
    z-index: 10;
    /* Only round top corners if the container is rounded */
    border-bottom-left-radius: 40px;
    border-bottom-right-radius: 40px;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    transition: color 0.2s;
}
.nav-item .fa-solid {
    font-size: 1.25rem;
    margin-bottom: 5px;
}
.nav-item.active {
    color: #ffffff;
    font-weight: 600;
}

/* --- Responsive Media Query --- */
@media (max-width: 480px) {
    html, body {
        height: 100%;
        margin: 0;
        padding: 0;
    }
    body {
        display: block; 
        min-height: 100%;
    }
    .mobile-container {
        width: 100%;
        height: 100%; /* Fill the body */
        min-height: 100vh; /* Ensure it fills viewport */
        border-radius: 0;
        box-shadow: none;
        margin: 0;
    }
    .header {
        padding-top: 25px;
    }
    #main-header-logo-container {
        width: 90px;
        height: 90px;
    }
    
    .logo-container.banner {
        width: 100%;
        height: auto;
    }
    .logo-container.banner img {
        width: 100%;
        height: auto;
    }

    .player-controls {
        padding: 15px 25px 5px 25px;
    }
    .volume-container {
        padding: 0 30px 5px 30px;
    }
    .search-container {
        padding: 0 20px 15px 20px;
    }
    .search-container .fa-search {
        left: 40px;
    }
    .content-list {
        padding: 0 20px;
    }
    .list-item {
        padding: 12px;
        margin-bottom: 12px;
    }
    .item-logo-container {
        width: 50px;
        height: 50px;
        border-radius: 10px; 
    }
    .item-logo-container img {
        padding: 3px; 
    }
    .item-details {
        margin-left: 10px;
    }
    .item-details .title {
        font-size: 1rem;
    }
    .item-details .subtitle {
        font-size: 0.75rem;
    }
    .tag {
        font-size: 0.65rem;
        padding: 3px 8px; 
    }
    .bottom-nav {
        padding: 12px 0 25px 0; /* Add padding to bottom for safe area on phones */
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }
    .nav-item {
        font-size: 0.7rem;
    }
    .nav-item .fa-solid {
        font-size: 1.1rem;
    }
}