:root {
    --primary-blue: #212F5B;
    --primary-orange: #E08E48;
    --light-gray: #f0f2f5;
    --dark-text: #333;
    --light-text: #fff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--light-gray);
    color: var(--dark-text);
    overflow: hidden;
    padding-top: 60px;
    padding-bottom: 80px;
}

/* Splash Screen */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-blue);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.splash-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

#splash-text {
    color: var(--light-text);
    font-size: 3em;
    font-weight: bold;
    text-align: center;
    animation: textPulse 2s infinite ease-in-out;
}

@keyframes textPulse {
    0% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.7; }
}

.loading-text {
    color: var(--light-text);
    margin-top: 20px;
    font-size: 1.2em;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    transition: opacity 0.5s ease-in;
}

.main-content.hidden {
    display: none;
}

/* Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 10px;
    background-color: var(--primary-blue);
    color: var(--light-text);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    z-index: 1000;
}

.app-header h1 {
    margin: 0;
    font-size: 1.8em;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Homepage */
.homepage-stations {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    padding: 20px;
    gap: 30px;
    padding-top: 20px;
    padding-bottom: 20px;
}

.station-logo-container {
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.station-logo-container:hover {
    transform: scale(1.05);
}

.station-logo {
    width: 150px;
    height: 150px;
    border-radius: 15px;
    object-fit: cover;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.station-logo-container p {
    margin-top: 10px;
    font-weight: bold;
    color: var(--dark-text);
}

/* Tab Content */
.station-content {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    flex-grow: 1;
    text-align: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.station-content.active {
    display: flex;
}

.station-page-logo {
    width: 180px;
    height: 180px;
    object-fit: contain;
    margin-bottom: 20px;
}

.play-button {
    padding: 12px 25px;
    font-size: 1.1em;
    background-color: var(--primary-orange);
    color: var(--light-text);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: background-color 0.3s ease;
}

.play-button:hover {
    filter: brightness(0.9);
}

/* Image Slider */
.image-slider {
    width: 450px;
    height: 159px;
    overflow: hidden;
    position: relative;
    margin: 20px auto;
    border-radius: 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000; /* fills space around contained image */
}

.image-slider img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* always show full image */
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    background-color: #000;
}

.image-slider img.active-slide {
    opacity: 1;
}

/* Bottom Navigation */
.bottom-tabs {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: var(--primary-blue);
    padding: 15px 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    box-shadow: 0 -4px 8px rgba(0,0,0,0.2);
    z-index: 1000;
}

.tab-item {
    color: var(--light-text);
    text-decoration: none;
    padding: 12px 18px;
    font-weight: bold;
    font-size: 1.1em;
    border-radius: 8px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
    flex-grow: 1;
    text-align: center;
}

.tab-item:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

.tab-item.active {
    background-color: var(--primary-orange);
    color: var(--light-text);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

/* Floating Chat Button */
.floating-button {
    position: fixed;
    bottom: 90px;
    right: 20px;
    background-color: var(--primary-orange);
    color: var(--light-text);
    border-radius: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8em;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 900;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.floating-button:hover {
    background-color: #c77b3b;
    transform: scale(1.05);
}

/* Chat iframe */
#chat-content iframe {
    width: 95%;
    max-width: 600px;
    height: 70vh;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin-top: 20px;
}

/* Chat Player */
.chat-player {
    background-color: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.chat-player h3 {
    margin: 0 0 5px 0;
    color: var(--primary-blue);
}

.chat-player select {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ddd;
    font-size: 1em;
    background-color: #f8f8f8;
    color: var(--dark-text);
}

#chat-player-now-playing {
    font-size: 0.9em;
    color: #555;
    margin: 5px 0;
    min-height: 1.2em;
}

.chat-player .play-button {
    margin-top: 0;
    width: 80%;
}

/* Responsive */
@media (max-width: 600px) {
    #splash-text {
        font-size: 2.2em;
    }

    .homepage-stations {
        gap: 20px;
    }

    .station-logo {
        width: 120px;
        height: 120px;
    }

    .station-page-logo {
        width: 150px;
        height: 150px;
    }

    .play-button {
        font-size: 1em;
        padding: 10px 20px;
    }

    .bottom-tabs {
        padding: 10px 0;
    }

    .tab-item {
        font-size: 0.9em;
        padding: 10px 8px;
    }

    #chat-content iframe {
        height: 60vh;
    }

    .chat-player {
        width: 95%;
    }

    .floating-button {
        width: 50px;
        height: 50px;
        font-size: 1.5em;
        bottom: 75px;
        right: 15px;
    }

    /* Responsive slider keeps ratio */
    .image-slider {
        width: 100%;
        max-width: 450px;
        height: auto;
        aspect-ratio: 450 / 159;
    }
}
