@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@700&display=swap');

body {
    background: #000;
    color: white;
    font-family: 'Chakra Petch', sans-serif;
    margin: 0;
    padding: 0;
    overflow: hidden;
    user-select: none; /* Prevent text selection on tap */
    -webkit-tap-highlight-color: transparent; /* No blue flash on tap */
    position: relative;
}

/* GTA-style grid background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(rgba(0, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    z-index: -2;
}

/* Glowing particles effect */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(0, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(0, 150, 255, 0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(0, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 160px 30px, rgba(0, 150, 255, 0.2), transparent),
        radial-gradient(1px 1px at 200px 60px, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 240px 20px, rgba(0, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 280px 70px, rgba(0, 150, 255, 0.3), transparent),
        radial-gradient(2px 2px at 320px 40px, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 360px 80px, rgba(0, 255, 255, 0.3), transparent);
    background-repeat: repeat;
    background-size: 400px 100px;
    animation: particlesMove 15s linear infinite;
    z-index: -1;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

@keyframes particlesMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-400px, -100px); }
}

/* Main container to hold everything */
#radio-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    position: relative;
    z-index: 1;
}

/* Add a subtle glow effect around the radio wheel */
#radio-wheel::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(0, 255, 255, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
}

/* The invisible circle that positions the icons */
#radio-wheel {
    position: relative;
    width: 75vmin; /* Slightly larger for closer spacing */
    height: 75vmin;
}

/* Styling for each station icon */
.station-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12%; /* Further reduced size to eliminate overlap */
    height: 12%;
    background-color: transparent;
    background-size: 100%;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    opacity: 0.7;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.station-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* The style for the SELECTED station */
.station-icon.selected {
    opacity: 1;
    border-color: #00e5ff;
    box-shadow: 0 0 15px 3px #00e5ff, inset 0 0 10px rgba(0, 229, 255, 0.5);
    background-color: rgba(255, 255, 255, 0.2);
}

/* The Now Playing info box in the middle */
#now-playing-info {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    text-transform: uppercase;
    width: 80%;
}

#now-playing-info h2 { /* Station Name */
    font-size: 2em;
    margin: 0;
    text-shadow: 2px 2px 4px #000;
}

#now-playing-info p { /* Artist & Title */
    font-size: 1.2em;
    margin: 5px 0 0 0;
    text-shadow: 2px 2px 4px #000;
}

/* Hide the actual audio player controls */
#audio-player {
    display: none;
}

/* Mobile - bigger circle and proper centering */
@media (max-width: 768px) {
    body {
        margin: 0;
        padding: 0;
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }
    
    #radio-container {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100vh;
        width: 100vw;
        padding: 0;
        margin: 0;
        position: fixed;
        top: 0;
        left: 0;
    }
    
    #radio-wheel {
        width: 90vmin; /* Bigger for mobile */
        height: 90vmin;
        position: relative;
        margin: 0 auto;
        transform: translate(0, 0);
    }
    
    /* Prevent station buttons from shrinking on mobile */
    .station-icon {
        min-width: 45px;
        min-height: 45px;
        width: 12% !important;
        height: 12% !important;
    }
    
    /* Smaller text for mobile */
    #now-playing-info h2 {
        font-size: 1.4em; /* Smaller station name */
    }
    
    #now-playing-info p {
        font-size: 0.9em; /* Smaller artist/title text */
    }
    
    #now-playing-info {
        width: 70%; /* Narrower text box */
        max-width: 200px; /* Limit maximum width */
    }
}

/* Prevent shrinking on very small screens */
@media (max-width: 480px) {
    .station-icon {
        min-width: 40px;
        min-height: 40px;
        width: 10% !important;
        height: 10% !important;
    }
    
    /* Even smaller text for very small screens */
    #now-playing-info h2 {
        font-size: 1.2em; /* Even smaller station name */
    }
    
    #now-playing-info p {
        font-size: 0.8em; /* Even smaller artist/title text */
    }
    
    #now-playing-info {
        width: 65%; /* Even narrower text box */
        max-width: 180px; /* Smaller maximum width */
    }
}

/* Prevent shrinking on window resize */
@media (max-width: 1200px) {
    .station-icon {
        min-width: 50px;
        min-height: 50px;
    }
}

/* Background audio indicator */
#background-audio-indicator {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 229, 255, 0.9);
    color: #000;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: bold;
    z-index: 1000;
    display: none;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* Ensure app works in background mode */
body.background-mode {
    background-color: #000;
}

/* PWA specific styles for better background handling */
@media (display-mode: standalone) {
    body {
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    #radio-container {
        height: 100vh;
        height: -webkit-fill-available;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
    }
    
    #radio-wheel {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 85vmin; /* Bigger wheel for PWA mobile */
        height: 85vmin; /* Bigger wheel for PWA mobile */
    }
    
    /* Ensure station icons stay in place with more spacing */
    .station-icon {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 10% !important; /* Smaller for more spacing */
        height: 10% !important; /* Smaller for more spacing */
        min-width: 40px !important;
        min-height: 40px !important;
    }
    
    /* Prevent wheel movement on resize */
    #radio-wheel {
        will-change: auto;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }
    
    /* Lock the container in place */
    #radio-container {
        overflow: hidden;
        touch-action: none;
    }
}