/* iOS Liquid Glass Player Styles - Mobile-Friendly & Touch-Optimized */

#wx-background {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    width: 100%;
    min-height: clamp(120px, 15vh, 160px);
    height: auto;
    padding: clamp(12px, 2vw, 20px);
    padding-bottom: max(clamp(12px, 2vw, 20px), env(safe-area-inset-bottom));
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: clamp(8px, 1.5vw, 12px);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: none;
    border-radius: 0 0 0 0;
    box-shadow: 0 -8px 32px 0 rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

#wx-display {
    position: relative;
    width: min(355px, calc(100vw - clamp(24px, 5vw, 40px)));
    max-width: 100%;
    min-height: clamp(60px, 8vh, 80px);
    padding: clamp(12px, 2vw, 20px) clamp(14px, 2.5vw, 24px);
    border: 0;
    border-radius: clamp(4px, 0.5vw, 8px);
    background: linear-gradient(135deg, rgba(150, 180, 220, 0.95) 0%, rgba(180, 210, 240, 0.95) 100%);
    border: 2px solid rgba(100, 130, 160, 0.6);
    box-shadow: 
        inset 0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 -2px 8px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    box-sizing: border-box;
    margin: 0;
    margin-bottom: 0;
}

#wx-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.03) 0px,
            rgba(0, 0, 0, 0.03) 1px,
            transparent 1px,
            transparent 2px
        );
    pointer-events: none;
    z-index: 1;
}

#wx-status {
    position: relative;
    width: 100%;
    color: #000000;
    font-size: clamp(14px, 4vw, 20px) !important;
    font-weight: 700;
    font-family: "Digital", "Orbitron", "Courier New", monospace;
    letter-spacing: clamp(1px, 0.3vw, 2px);
    margin-bottom: clamp(6px, 1vw, 10px);
    text-shadow: 
        1px 1px 0 rgba(100, 100, 100, 0.3),
        2px 2px 2px rgba(80, 80, 80, 0.2);
    line-height: 1.4;
    z-index: 2;
}

#wx-title {
    position: relative;
    width: 100%;
    overflow: hidden;
    color: #000000;
    font-size: clamp(14px, 4vw, 20px) !important;
    font-weight: 700;
    font-family: "Digital", "Orbitron", "Courier New", monospace;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-shadow: 
        1px 1px 0 rgba(100, 100, 100, 0.3),
        2px 2px 2px rgba(80, 80, 80, 0.2);
    line-height: 1.4;
    letter-spacing: clamp(1px, 0.3vw, 2px);
    z-index: 2;
}

#wx-loading {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-top-color: rgba(0, 0, 0, 0.9);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

#wx-loading.spinner-border {
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-top-color: rgba(0, 0, 0, 0.9);
    width: 16px;
    height: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#wx-button-play,
#wx-button-stations {
    position: relative;
    width: clamp(44px, 8vw, 56px) !important;
    height: clamp(44px, 8vw, 56px) !important;
    min-width: clamp(44px, 8vw, 56px) !important;
    min-height: clamp(44px, 8vw, 56px) !important;
    max-width: clamp(44px, 8vw, 56px) !important;
    max-height: clamp(44px, 8vw, 56px) !important;
    border: none;
    border-radius: clamp(8px, 1.5vw, 12px);
    background: rgba(180, 180, 180, 0.5) !important;
    border: 1px solid rgba(160, 160, 160, 0.4) !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: clamp(8px, 1.5vw, 12px);
    color: #000000 !important;
    font-size: clamp(11px, 2vw, 14px) !important;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
    flex-shrink: 0;
    box-sizing: border-box;
    box-shadow: 
        inset 0 -2px 0 rgba(180, 180, 180, 0.6),
        inset 0 -1px 0 rgba(160, 160, 160, 0.4) !important;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

#wx-button-play:hover:not(.disabled),
#wx-button-stations:hover:not(.disabled) {
    background: rgba(200, 200, 200, 0.6) !important;
}

#wx-button-play:active:not(.disabled),
#wx-button-stations:active:not(.disabled) {
    transform: scale(0.95);
    transform-origin: center;
}

/* Play button glows when playing (not paused) */
#wx-button-play.btn-secondary:not(.disabled).playing {
    background: rgba(150, 200, 255, 0.6) !important;
    box-shadow: 
        inset 0 1px 4px rgba(0, 150, 255, 0.3),
        inset 0 -1px 4px rgba(0, 150, 255, 0.15),
        0 0 8px rgba(0, 150, 255, 0.4),
        0 0 16px rgba(0, 150, 255, 0.25),
        0 0 24px rgba(0, 150, 255, 0.15) !important;
    border-color: rgba(100, 180, 255, 0.5) !important;
}

/* Stations button glows when enabled (not disabled) */
#wx-button-stations.btn-secondary:not(.disabled) {
    background: rgba(150, 200, 255, 0.6) !important;
    box-shadow: 
        inset 0 1px 4px rgba(0, 150, 255, 0.3),
        inset 0 -1px 4px rgba(0, 150, 255, 0.15),
        0 0 8px rgba(0, 150, 255, 0.4),
        0 0 16px rgba(0, 150, 255, 0.25),
        0 0 24px rgba(0, 150, 255, 0.15) !important;
    border-color: rgba(100, 180, 255, 0.5) !important;
}

/* Stations button glows when offcanvas is open */
#wx-button-stations.btn-secondary.stations-open {
    background: rgba(150, 200, 255, 0.6) !important;
    box-shadow: 
        inset 0 1px 4px rgba(0, 150, 255, 0.3),
        inset 0 -1px 4px rgba(0, 150, 255, 0.15),
        0 0 8px rgba(0, 150, 255, 0.4),
        0 0 16px rgba(0, 150, 255, 0.25),
        0 0 24px rgba(0, 150, 255, 0.15) !important;
    border-color: rgba(100, 180, 255, 0.5) !important;
}

#wx-button-play.btn-secondary.disabled,
#wx-button-stations.btn-secondary.disabled {
    background: rgba(180, 180, 180, 0.5) !important;
    color: #000000 !important;
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: 
        inset 0 -2px 0 rgba(180, 180, 180, 0.5),
        inset 0 -1px 0 rgba(160, 160, 160, 0.3) !important;
    border-color: rgba(160, 160, 160, 0.4) !important;
}

#wx-button-play i,
#wx-button-stations i {
    color: #000000 !important;
    font-size: clamp(18px, 3.5vw, 24px) !important;
}

#wx-button-stations {
    width: auto !important;
    min-width: clamp(85px, 15vw, 110px) !important;
    max-width: none !important;
    padding: clamp(8px, 1.5vw, 12px) clamp(12px, 2.5vw, 16px) !important;
    font-weight: 700 !important;
}

.wx-buttons-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(10px, 2vw, 16px);
    width: fit-content;
    max-width: 100%;
    margin-right: clamp(4px, 1vw, 12px);
    flex-wrap: nowrap;
}

/* Mobile Responsive - Enhanced for touch */
@media (max-width: 768px) {
    #wx-background {
        max-width: 100%;
        padding: clamp(12px, 3vw, 16px);
        padding-bottom: max(clamp(12px, 3vw, 16px), env(safe-area-inset-bottom));
        align-items: center;
    }

    .wx-buttons-container {
        gap: clamp(8px, 2vw, 12px);
        justify-content: center;
        width: 100%;
    }
}

/* Tablet portrait (768x1024) - center display */
@media (min-width: 481px) and (max-width: 1024px) {
    #wx-background {
        align-items: center;
    }
}

/* Desktop and wide screens (1025px and above) - center display and buttons */
@media (min-width: 1025px) {
    #wx-background {
        align-items: center;
    }
    
    .wx-buttons-container {
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 480px) {
    #wx-background {
        padding: clamp(10px, 2.5vw, 14px);
        padding-bottom: max(clamp(10px, 2.5vw, 14px), env(safe-area-inset-bottom));
        align-items: center;
    }

    #wx-display {
        width: 100%;
        max-width: 100%;
    }

    .wx-buttons-container {
        justify-content: center;
        width: 100%;
        gap: clamp(6px, 1.5vw, 10px);
        flex-wrap: nowrap;
    }

    #wx-button-play,
    #wx-button-stations {
        width: clamp(40px, 7vw, 52px) !important;
        height: clamp(40px, 7vw, 52px) !important;
        min-width: clamp(40px, 7vw, 52px) !important;
        min-height: clamp(40px, 7vw, 52px) !important;
        max-width: clamp(40px, 7vw, 52px) !important;
        max-height: clamp(40px, 7vw, 52px) !important;
    }

    #wx-button-stations {
        min-width: clamp(70px, 12vw, 95px) !important;
        padding: clamp(6px, 1.2vw, 10px) clamp(10px, 2vw, 14px) !important;
        font-size: clamp(10px, 1.8vw, 13px) !important;
    }
}

/* Extra narrow screens (360px and below) */
@media (max-width: 360px) {
    .wx-buttons-container {
        gap: clamp(4px, 1vw, 8px);
    }

    #wx-button-play,
    #wx-button-stations {
        width: clamp(38px, 6.5vw, 48px) !important;
        height: clamp(38px, 6.5vw, 48px) !important;
        min-width: clamp(38px, 6.5vw, 48px) !important;
        min-height: clamp(38px, 6.5vw, 48px) !important;
        max-width: clamp(38px, 6.5vw, 48px) !important;
        max-height: clamp(38px, 6.5vw, 48px) !important;
    }

    #wx-button-stations {
        min-width: clamp(65px, 11vw, 85px) !important;
        padding: clamp(5px, 1vw, 8px) clamp(8px, 1.5vw, 12px) !important;
        font-size: clamp(9px, 1.6vw, 12px) !important;
    }

    #wx-display {
        width: calc(100% - clamp(8px, 2vw, 16px));
    }
}
