/* File: /css/style.css */

:root {
    --player-height: 90px;
    --primary-accent: #0d6efd; /* Bootstrap blue */
    --seek-before-width: 0%;
}

body {
    padding-bottom: var(--player-height);
    background-color: #121212 !important;
}

/* --- Radio Station Card Styling --- */
.radio-card {
    transition: all 0.2s ease-in-out;
    border: 1px solid #333;
    cursor: pointer;
    background-color: #1e1e1e;
}
.radio-card:hover {
    transform: scale(1.03);
    border-color: var(--primary-accent);
}
.radio-card img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #444;
}

.radio-card.active-station {
    background-color: #2a2a2a;
    border-color: var(--primary-accent);
    box-shadow: 0 0 15px rgba(13, 110, 253, 0.5);
}

/* --- Player Styling --- */
.player-container {
    height: var(--player-height);
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid #333;
    transition: height 0.3s ease; /* Smooth height transition for mobile */
}
.player-logo {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    transition: width 0.3s ease, height 0.3s ease; /* Smooth logo transition */
}
.track-info { min-width: 250px; }
/* NEW: Ensure track info text doesn't cause weird wrapping */
#player-station-name {
    white-space: nowrap;
}

.play-button {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.play-button .bi-play-fill { margin-left: 5px; }

#now-playing i { vertical-align: middle; }
#now-playing span { vertical-align: middle; }

/* --- Custom Range Input (Seek & Volume) --- */
.form-range {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}
.form-range:focus { box-shadow: none; }
.form-range::-webkit-slider-runnable-track {
    height: 5px;
    border-radius: 5px;
    background: linear-gradient(to right, var(--primary-accent) 0%, var(--primary-accent) var(--seek-before-width), #444 var(--seek-before-width), #444 100%);
}
.form-range::-moz-range-track {
    height: 5px;
    border-radius: 5px;
    background: linear-gradient(to right, var(--primary-accent) 0%, var(--primary-accent) var(--seek-before-width), #444 var(--seek-before-width), #444 100%);
}
.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    margin-top: -5px;
    width: 15px;
    height: 15px;
    background-color: #fff;
    border-radius: 50%;
    transition: background-color 0.2s;
}
.form-range::-moz-range-thumb {
    border: none;
    width: 15px;
    height: 15px;
    background-color: #fff;
    border-radius: 50%;
    transition: background-color 0.2s;
}
.form-range:hover::-webkit-slider-thumb { background-color: var(--primary-accent); }
.form-range:hover::-moz-range-thumb { background-color: var(--primary-accent); }
.volume-control { width: 150px; }

/* --- Live Indicator Styling --- */
#live-indicator {
    font-size: 0.75rem;
    font-weight: bold;
    vertical-align: middle;
    transition: background-color 0.3s ease;
    flex-shrink: 0; /* Prevents the indicator from shrinking */
}
#live-indicator i {
    font-size: 0.5rem;
    vertical-align: 0.1em;
}
#live-indicator.live {
    background-color: #dc3545 !important;
    color: white;
}
#live-indicator.live i {
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}


/* --- Mobile Responsiveness --- */

/* For smaller desktops and large tablets, just hide the timeline */
@media (max-width: 992px) {
    .timeline { display: none !important; }
}

/* --- NEW MOBILE LAYOUT --- */
/* For tablets and phones */
@media (max-width: 768px) {
    :root {
        /* A more compact player height */
        --player-height: 125px;
    }

    .player-container .container > .d-flex {
        /* Allow elements to wrap onto multiple lines */
        flex-wrap: wrap;
        align-content: center; /* Center the wrapped content vertically */
        padding: 10px 0;
    }
    
    /* Row 1: Track Info and Controls */
    .track-info {
        min-width: 0; /* Allow track info to shrink */
        order: 2;
    }
    .player-controls {
        order: 3;
    }
    .player-logo {
        /* Make the logo smaller on mobile */
        width: 50px;
        height: 50px;
    }

    /* Row 2: Timeline (bring it back for mobile) */
    .timeline {
        display: flex !important; /* Override the hide rule */
        order: 1; /* Place it at the top */
        width: 100%;
        margin: 0 0 10px 0 !important; /* Full width and add margin below */
    }
    
    /* Hide time text on very small screens to give more space to the seekbar */
    @media (max-width: 400px) {
        .timeline #current-time,
        .timeline #end-time {
            display: none;
        }
    }

    /* Hide desktop-only elements */
    .volume-control {
        display: none !important;
    }
}