/* Lekali Radio Player - Mobile First Responsive CSS */
.lekali-radio-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d3436 100%);
    color: white;
    border-radius: clamp(12px, 4vw, 20px);
    padding: clamp(15px, 5vw, 25px);
    width: min(95vw, 320px);
    margin: 10px auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    border: 1px solid #333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    position: relative;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: manipulation;
    box-sizing: border-box;
    /* Remove white hover effects from player */
    transition: none;
}

/* Remove white hover effect from player container */
.lekali-radio-player:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.3); /* Keep original shadow, no white glow */
    transform: none; /* Remove any scaling */
}

.lekali-radio-player * {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.player-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

#station-logo {
    width: min(30vw, 120px);
    height: min(30vw, 120px);
    object-fit: cover;
    border-radius: clamp(8px, 3vw, 15px);
    margin-bottom: clamp(10px, 4vw, 20px);
    border: 2px solid #007bff;
    box-shadow: 0 6px 20px rgba(0,123,255,0.3);
    background: #000;
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(8px, 3vw, 15px);
    width: 100%;
}

.button-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(25vw, 100px);
    height: min(25vw, 100px);
    position: relative;
}

.play-button {
    width: min(22vw, 80px);
    height: min(22vw, 80px);
    border-radius: 50%;
    border: 2px solid #007bff;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    position: relative;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-width: 44px;
    min-height: 44px;
}

/* Remove white hover effects from play button */
.play-button:hover {
    transform: none; /* Remove scaling */
    box-shadow: 0 6px 20px rgba(0,0,0,0.4); /* Keep original shadow */
    border-color: #007bff; /* Keep original border color */
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%); /* Keep original background */
}

.play-button:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Play state - triangle */
.play-button.play .button-icon::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: min(5vw, 20px) solid #ffffff;
    border-top: min(3.5vw, 14px) solid transparent;
    border-bottom: min(3.5vw, 14px) solid transparent;
    left: 54%;
    top: 50%;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Pause state - two bars */
.play-button.pause .button-icon::before,
.play-button.pause .button-icon::after {
    content: '';
    position: absolute;
    background: #ffffff;
    width: min(1.5vw, 6px);
    height: min(7vw, 28px);
    top: 50%;
    transform: translateY(-50%);
    border-radius: 2px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.play-button.pause .button-icon::before {
    left: 40%;
}

.play-button.pause .button-icon::after {
    right: 40%;
}

/* Square/loading state */
.play-button.square .button-icon::before,
.play-button.loading .button-icon::before {
    content: '';
    position: absolute;
    width: min(5.5vw, 22px);
    height: min(5.5vw, 22px);
    background: #ffffff;
    border-radius: 4px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Loading animation - CHANGED to #ff00ff */
.play-button.square,
.play-button.loading {
    border-color: #ff00ff;
    background: linear-gradient(135deg, #2a1a1a 0%, #1a0a0a 100%);
}

.play-button.square::after,
.play-button.loading::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #ff00ff; /* Animation color changed to #ff00ff */
    animation: spin 1.2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.status-text {
    margin-top: clamp(5px, 2vw, 8px);
    font-size: clamp(12px, 3.5vw, 14px);
    text-align: center;
    font-weight: 500;
    min-height: 20px;
    color: #e0e0e0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    transition: color 0.3s ease;
    width: 100%;
    line-height: 1.4;
    padding: 0 5px;
}

/* Status colors - CHANGED loading/buffering text to #ff00ff */
.lekali-radio-player.playing .status-text {
    color: #4dabf7;
    font-weight: 600;
}

.lekali-radio-player.loading .status-text {
    color: #ff00ff; /* Buffering text color changed to #ff00ff */
}

.lekali-radio-player.error .status-text {
    color: #ff00ff;
}

.lekali-radio-player.interrupted .status-text {
    color: #ff00ff;
    animation: pulse-text 1.5s infinite;
}

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

/* Connection status */
.connection-status {
    width: min(2.5vw, 10px);
    height: min(2.5vw, 10px);
    border-radius: 50%;
    background: #666;
    position: absolute;
    top: clamp(8px, 3vw, 15px);
    right: clamp(8px, 3vw, 15px);
    transition: background-color 0.3s ease;
    animation: connection-pulse 2s infinite;
}

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

.lekali-radio-player.playing .connection-status {
    background: #00ff00;
}

.lekali-radio-player.loading .connection-status {
    background: #ff00ff; /* Loading connection indicator changed to #ff00ff */
}

.lekali-radio-player.error .connection-status {
    background: #ff00ff;
    animation: connection-blink 1s infinite;
}

@keyframes connection-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* Pulse animation for active playback - CHANGED to #ff00ff */
@keyframes player-pulse {
    0% { box-shadow: 0 8px 32px rgba(255, 0, 255, 0.3); } /* Changed to #ff00ff */
    50% { box-shadow: 0 8px 40px rgba(255, 0, 255, 0.6); } /* Changed to #ff00ff */
    100% { box-shadow: 0 8px 32px rgba(255, 0, 255, 0.3); } /* Changed to #ff00ff */
}

.lekali-radio-player.playing {
    animation: player-pulse 3s infinite;
}

/* Specific breakpoints for fine-tuning */
@media (max-width: 320px) {
    .lekali-radio-player {
        width: 95vw;
        padding: 12px 10px;
    }
    
    .play-button {
        min-width: 50px;
        min-height: 50px;
    }
    
    .status-text {
        font-size: 11px;
    }
}

@media (min-width: 768px) {
    .lekali-radio-player {
        width: min(80vw, 350px);
        padding: 25px;
    }
    
    #station-logo {
        width: 140px;
        height: 140px;
    }
    
    .button-container {
        width: 110px;
        height: 110px;
    }
    
    .play-button {
        width: 90px;
        height: 90px;
    }
    
    .status-text {
        font-size: 15px;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .lekali-radio-player {
        border: 2px solid #fff;
    }
    
    .play-button {
        border-width: 2px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .play-button.square::after,
    .play-button.loading::after {
        animation: none;
    }
    
    .lekali-radio-player.playing {
        animation: none;
    }
    
    .connection-status {
        animation: none;
    }
}

/* Focus styles for accessibility */
.play-button:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Error state styling */
.lekali-radio-player.error {
    background: linear-gradient(135deg, #2a1a1a 0%, #1a0a0a 100%);
    border-color: #ff00ff;
}

/* Ensure proper scaling on very small devices */
@media (max-width: 240px) {
    .lekali-radio-player {
        width: 98vw;
        padding: 8px;
        border-radius: 8px;
    }
    
    #station-logo {
        width: 60px;
        height: 60px;
        margin-bottom: 8px;
    }
    
    .button-container {
        width: 70px;
        height: 70px;
    }
    
    .play-button {
        width: 50px;
        height: 50px;
        min-width: 44px;
        min-height: 44px;
    }
    
    .status-text {
        font-size: 10px;
    }
}

/* Fix for iOS Safari viewport issues */
@supports (-webkit-touch-callout: none) {
    .lekali-radio-player {
        /* iOS specific fixes */
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* Ensure content doesn't get cut off on small screens */
html, body {
    overflow-x: hidden;
}

/* WordPress specific fixes to prevent theme conflicts */
.wp-site-blocks .lekali-radio-player,
.entry-content .lekali-radio-player,
.widget .lekali-radio-player {
    max-width: 100% !important;
    width: min(95vw, 320px) !important;
}

/* Force responsive behavior in all contexts */
.lekali-radio-player {
    max-width: 100% !important;
    width: min(95vw, 320px) !important;
}