/* Base styles */
* { box-sizing: border-box; }
body {
    font-family: 'Segoe UI', Roboto, sans-serif;
    background: #121212;
    color: #fff;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* Header styles */
.site-header {
    background: #1e1e1e;
    border-bottom: 1px solid #333;
    position: relative;
}

/* On wider screens (over 900px), align header with container */
@media (min-width: 900px) {
    .site-header {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 15px 0;
    }

    .header-content {
        width: 760px;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
}

/* On smaller screens, keep original header behavior */
@media (max-width: 899px) {
    .site-header {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 15px 25px;
    }

    .header-content {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        max-width: 800px;
        width: 100%;
    }
}


.logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.logo img {
    height: 40px;
}

.tagline {
    font-size: 0.9rem;
    color: #ccc;
    padding-right: 60px; /* Space for menu button */
}

/* Container */
.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 20px;
}

/* Radio stations */
.stations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.station-card {
    background: #1e1e1e;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.station-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.station-card.playing {
    border: 2px solid #1db954;
}

.station-header {
    display: flex;
    align-items: center;
    padding: 15px;
    gap: 15px;
}

.station-logo {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.station-info h3 {
    margin: 0;
    font-size: 1.1rem;
}

.play-indicator {
    margin-left: auto;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #333;
    border-radius: 50%;
}

.play-indicator::before {
    content: '▶';
    font-size: 12px;
}

.station-card.playing .play-indicator::before {
    content: '■';
}

/* Country selector */
.country-selector {
    background: #1e1e1e;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 0; /* Remove bottom margin */
}

.country-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.country-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #ccc;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.3s;
}

.country-item:hover {
    background: #333;
    color: #fff;
}

.country-item.active {
    background: #1db954;
    color: #fff;
}

.country-flag {
    width: 40px;
    height: 27px;
    border-radius: 4px;
    margin-bottom: 5px;
    object-fit: cover;
}

.country-name {
    font-size: 0.8rem;
    text-align: center;
}

/* Menu button */
.menu-button {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: #333;
    border-radius: 8px;
    cursor: pointer;
    z-index: 10; /* Needs to be above header content but below overlays */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* On wider screens, align menu button with the container */
@media (min-width: 900px) {
    .menu-button {
        right: calc(50% - 380px + 15px); /* 50% - half of header content width (760px/2) + original right padding */
    }
}

.menu-button span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    margin: 3px 0;
    transition: 0.3s;
}

/* Menu overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 999;
    display: none;
}

/* Menu content */
.menu-content {
    position: fixed;
    top: 0;
    right: -250px;
    width: 250px;
    height: 100%;
    background: #1e1e1e;
    z-index: 1000;
    padding: 70px 20px 20px;
    transition: 0.3s;
    overflow-y: auto;
}

.menu-content.active {
    right: 0;
}

.menu-heading {
    padding: 15px;
    font-weight: bold;
    color: #fff;
    border-bottom: 1px solid #444;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.menu-item {
    display: block;
    padding: 15px;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    margin: 5px 0;
    transition: 0.3s;
}

.menu-item:hover {
    background: #333;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 15px;
    color: #777;
    font-size: 0.9rem;
    margin-top: 0; /* Remove top margin */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tagline {
        font-size: 0.8rem;
        padding-right: 50px;
    }
    
    .menu-button {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
    }
    
    .menu-button span {
        width: 18px;
    }
    
    .stations-grid {
        grid-template-columns: 1fr;
    }
    
    .country-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}
