/* ============================================
   ESTILOS PERSONALIZADOS - LA MORENITA RADIO
   CON INSTALACIÓN PWA AUTOMÁTICA
============================================ */

/* Estilos generales */
.station-description {
    color: #fff;
    opacity: 0.8;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.station-img {
    border: 3px solid rgba(255, 255, 255, 0.2);
    padding: 0.25rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.station-img:hover {
    border-color: #FF6B00;
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 107, 0, 0.3);
}

.player-artwork {
    padding: 1rem;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255,107,0,0.1), rgba(255,142,83,0.05));
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: all 0.4s ease;
}

.player-artwork:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(255, 107, 0, 0.2);
    border-color: rgba(255, 107, 0, 0.3);
}

.player-artwork img {
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    transition: transform 0.5s ease;
}

.player-artwork:hover img {
    transform: scale(1.02);
}

.player-cover-image {
    animation: backgroundAnimation 90s linear infinite;
    filter: brightness(0.7) blur(5px);
    transform: scale(1.1);
}

@keyframes backgroundAnimation {
    0% {
        transform: scale(1.1) rotate(0deg);
        filter: brightness(0.7) blur(5px) hue-rotate(0deg);
    }
    33% {
        transform: scale(1.15) rotate(120deg);
        filter: brightness(0.8) blur(6px) hue-rotate(120deg);
    }
    66% {
        transform: scale(1.1) rotate(240deg);
        filter: brightness(0.75) blur(5px) hue-rotate(240deg);
    }
    100% {
        transform: scale(1.1) rotate(360deg);
        filter: brightness(0.7) blur(5px) hue-rotate(360deg);
    }
}

.items-start {
    align-items: flex-start;
    margin-top: 15px;
}

/* ============================================
   MEJORAS PARA INSTALACIÓN PWA AUTOMÁTICA
============================================ */

/* Mejoras al botón de instalación automática */
#autoInstallButton {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

#autoInstallButton::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.7s ease;
    z-index: -1;
}

#autoInstallButton:hover::before {
    left: 100%;
}

/* Estados del botón */
#autoInstallButton.installing {
    position: relative;
}

#autoInstallButton.installing::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    background: conic-gradient(transparent, #FF6B00, transparent);
    animation: rotate 2s linear infinite;
    transform: translate(-50%, -50%);
    z-index: -2;
}

@keyframes rotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Toast notifications mejoradas */
.auto-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    background: linear-gradient(135deg, rgba(255,107,0,0.95), rgba(255,142,83,0.95));
    color: white;
    padding: 18px 35px;
    border-radius: 20px;
    z-index: 10000;
    font-size: 16px;
    font-weight: 600;
    animation: toastSlideUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    box-shadow: 0 15px 40px rgba(255, 107, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 90%;
    text-align: center;
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

.auto-toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #FF6B00, #FF8E53, #FF6B00);
    animation: progress 3s linear forwards;
}

@keyframes progress {
    from { width: 0%; }
    to { width: 100%; }
}

@keyframes toastSlideUp {
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Overlay de instalación automática mejorado */
.auto-install-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(0,0,0,0.97) 0%,
        rgba(20,20,20,0.95) 50%,
        rgba(40,40,40,0.93) 100%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 40px 30px;
    animation: overlayFadeIn 0.5s cubic-bezier(0.215, 0.610, 0.355, 1);
    backdrop-filter: blur(25px);
    overflow-y: auto;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(25px);
    }
}

.auto-install-overlay h2 {
    color: #FF6B00;
    font-size: 3rem;
    margin-bottom: 25px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #FF6B00, #FF8E53);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 5px 15px rgba(255, 107, 0, 0.3);
}

.auto-install-overlay p {
    font-size: 1.3rem;
    margin-bottom: 40px;
    max-width: 600px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
}

.auto-install-overlay .steps {
    background: linear-gradient(135deg, 
        rgba(255, 107, 0, 0.15), 
        rgba(255, 142, 83, 0.1));
    padding: 35px;
    border-radius: 25px;
    max-width: 500px;
    margin-bottom: 40px;
    border: 2px solid rgba(255, 107, 0, 0.3);
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 60px rgba(255, 107, 0, 0.2);
}

.auto-install-overlay .step {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    text-align: left;
    padding: 15px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.auto-install-overlay .step:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(10px);
}

.auto-install-overlay .step-number {
    background: linear-gradient(135deg, #FF6B00, #FF8E53);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
    margin-right: 20px;
    flex-shrink: 0;
    box-shadow: 0 5px 15px rgba(255, 107, 0, 0.4);
}

.auto-install-overlay .step-text {
    font-size: 17px;
    line-height: 1.6;
    color: white;
    font-weight: 400;
}

.auto-install-overlay .step-text strong {
    color: #FF8E53;
    font-weight: 600;
}

.auto-install-overlay .close-btn {
    background: linear-gradient(135deg, #FF6B00, #FF8E53);
    color: white;
    border: none;
    padding: 18px 50px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(255, 107, 0, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.auto-install-overlay .close-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.7s ease;
}

.auto-install-overlay .close-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(255, 107, 0, 0.6);
}

.auto-install-overlay .close-btn:hover::before {
    left: 100%;
}

/* ============================================
   MEJORAS RESPONSIVE
============================================ */

@media (max-width: 768px) {
    .player-artwork {
        padding: 0.75rem;
        border-radius: 15px;
    }
    
    .auto-install-overlay h2 {
        font-size: 2.2rem;
    }
    
    .auto-install-overlay p {
        font-size: 1.1rem;
    }
    
    .auto-install-overlay .steps {
        padding: 25px;
        border-radius: 20px;
    }
    
    .auto-install-overlay .step {
        padding: 12px;
        margin-bottom: 20px;
    }
    
    .auto-install-overlay .step-number {
        width: 40px;
        height: 40px;
        font-size: 18px;
        margin-right: 15px;
    }
    
    .auto-install-overlay .step-text {
        font-size: 15px;
    }
    
    .auto-install-overlay .close-btn {
        padding: 16px 40px;
        font-size: 16px;
    }
    
    .auto-toast {
        padding: 16px 25px;
        font-size: 15px;
        border-radius: 18px;
    }
}

@media (max-width: 480px) {
    .player-artwork {
        padding: 0.5rem;
        border-radius: 12px;
    }
    
    .player-artwork img {
        border-radius: 10px;
    }
    
    .auto-install-overlay {
        padding: 20px;
    }
    
    .auto-install-overlay h2 {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }
    
    .auto-install-overlay p {
        font-size: 1rem;
        margin-bottom: 30px;
    }
    
    .auto-install-overlay .steps {
        padding: 20px;
        border-radius: 15px;
    }
    
    .auto-install-overlay .step {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
    
    .auto-install-overlay .step-number {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .auto-install-overlay .step-text {
        font-size: 14px;
    }
    
    .auto-install-overlay .close-btn {
        padding: 14px 30px;
        font-size: 15px;
        width: 100%;
        max-width: 300px;
    }
    
    .auto-toast {
        padding: 14px 20px;
        font-size: 14px;
        border-radius: 15px;
        gap: 10px;
    }
}

/* ============================================
   MEJORAS PARA MODO STANDALONE (PWA INSTALADA)
============================================ */

@media (display-mode: standalone) {
    body {
        background: #000;
    }
    
    .header {
        padding-top: env(safe-area-inset-top);
        background: rgba(0,0,0,0.9);
        backdrop-filter: blur(20px);
    }
    
    .player-cover-image {
        animation: none;
        filter: brightness(0.6) blur(8px);
    }
    
    /* Ocultar botón de instalación cuando ya está instalado */
    #autoInstallButton {
        display: none !important;
    }
    
    /* Mejorar visibilidad en modo standalone */
    .player-artwork {
        background: rgba(0,0,0,0.7);
        border-color: rgba(255, 107, 0, 0.2);
    }
}

/* ============================================
   MEJORAS DE ACCESIBILIDAD
============================================ */

@media (prefers-reduced-motion: reduce) {
    .player-cover-image,
    #autoInstallButton::before,
    .auto-install-overlay,
    .auto-toast,
    .player-artwork,
    .station-img {
        animation: none !important;
        transition: none !important;
    }
}

/* Soporte para navegadores antiguos */
@supports not (backdrop-filter: blur(10px)) {
    .auto-install-overlay {
        background: rgba(0,0,0,0.98);
    }
    
    .auto-toast {
        background: linear-gradient(135deg, #FF6B00, #FF8E53);
    }
    
    .player-artwork {
        background: rgba(0,0,0,0.8);
    }
}

/* Mejoras para modo oscuro/light */
@media (prefers-color-scheme: light) {
    .player-artwork {
        background: linear-gradient(135deg, rgba(255,107,0,0.05), rgba(255,142,83,0.02));
        border-color: rgba(255, 107, 0, 0.1);
    }
    
    .station-img {
        border-color: rgba(255, 107, 0, 0.3);
    }
}

/* Mejoras para alta densidad de píxeles */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .player-artwork img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}