/* ==========================================
   SIDEBAR DE CRISTAL (menu.css) - UPDATED 2026
   ========================================== */

/* 1. Capa de desenfoque de fondo */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 2. El Cajón Lateral */
.glass-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    max-width: 85%;
    height: 100%;
    z-index: 2100;
    
    background: rgba(15, 15, 15, 0.75);
    backdrop-filter: blur(30px) saturate(150%);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 10px 0 50px rgba(0, 0, 0, 0.8);

    transform: translateX(-100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    
    display: flex;
    flex-direction: column;
}

.glass-sidebar.active {
    transform: translateX(0);
}

/* 3. Cabecera del Menú */
.sidebar-header-premium {
    padding: 40px 20px 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.sidebar-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--color-marca);
    box-shadow: 0 0 20px rgba(var(--color-marca-rgb), 0.3);
}

.sidebar-title {
    font-family: 'Montserrat Black', sans-serif;
    color: white;
    letter-spacing: 3px;
    font-size: 0.9rem;
    text-transform: uppercase;
    text-align: center;
}

.close-sidebar-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    opacity: 0.4;
    transition: 0.3s;
}

.close-sidebar-btn:hover { 
    opacity: 1; 
    color: var(--color-marca); 
}

/* 4. Lista de Enlaces */
.sidebar-list {
    list-style: none;
    padding: 20px;
    margin: 0;
    flex-grow: 1;
    overflow-y: auto;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 18px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-family: 'Montserrat SemiBold', sans-serif;
    font-size: 0.95rem;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.menu-link i {
    font-size: 1.2rem;
    width: 25px;
    text-align: center;
}

.menu-link:hover, .menu-link.active {
    background: rgba(var(--color-marca-rgb), 0.1);
    color: white;
    transform: translateX(5px);
}

.menu-link.active {
    border-left: 4px solid var(--color-marca);
    background: rgba(var(--color-marca-rgb), 0.2);
}

/* 5. Footer del Menú */
.sidebar-footer-premium {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.app-version-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 10px;
    font-family: 'Montserrat', sans-serif;
}

/* ..........................................
   Z-INDEX HIERARCHY 2026
   .......................................... */
.quality-selector-wrapper { z-index: 999999 !important; }
.quality-menu { z-index: 1000000 !important; }
.redes-container { z-index: 1000 !important; } /* Redes por debajo del menú */

/* ==========================================
   SELECTOR DE CALIDAD PREMIUM 2026 (Inline)
   ========================================== */
.quality-selector-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    z-index: 110;
}

.quality-main-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    padding: 0 4px;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Montserrat SemiBold', sans-serif;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.quality-main-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.quality-main-btn i {
    font-size: 0.8rem;
    color: var(--color-marca);
    transition: transform 0.6s ease;
}

.quality-selector-wrapper:hover .quality-main-btn i {
    transform: rotate(90deg);
}

.quality-label {
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Menú de opciones - Ajustado para aparecer arriba del badge a la DERECHA */
.quality-menu {
    position: absolute;
    bottom: 35px; /* Arriba del badge */
    right: -10px; /* Alineado a la derecha con margen de seguridad */
    background: rgba(20, 22, 30, 0.98);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 8px;
    width: 170px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    gap: 6px;
    
    /* Oculto por defecto */
    opacity: 0;
    transform: translateY(15px) scale(0.92);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 2000; /* Aseguramos que nada lo tape */
}

.quality-selector-wrapper.active .quality-menu {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.quality-opt {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 8px 12px;
    text-align: left;
    font-family: 'Montserrat SemiBold', sans-serif;
    font-size: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.quality-opt i {
    font-size: 0.85rem;
    width: 18px;
    text-align: center;
}

.quality-opt:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.quality-opt.active {
    background: rgba(var(--color-marca-rgb), 0.12);
    color: var(--color-marca);
    font-family: 'Montserrat Bold', sans-serif;
}

.sch-avatar-container {
    position: relative;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

/* Efecto de apilado para múltiples locutores */
.sch-avatar-group .sch-avatar-container:not(:first-child) {
    margin-left: -20px;
    z-index: 1;
}

.sch-avatar-group .sch-avatar-container:hover {
    transform: translateY(-5px) scale(1.1);
    z-index: 10;
}

.sch-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: #222;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.sch-avatar-container.live::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--color-marca, #ff6b00);
    transform: translate(-50%, -50%);
    animation: radarPulse 2s ease-out infinite;
    opacity: 0.8;
}

.sch-avatar-container.live .sch-avatar {
    border-color: var(--color-marca, #ff6b00);
    box-shadow: 0 0 15px rgba(var(--color-marca-rgb), 0.6);
}

@keyframes radarPulse {
    0% { 
        transform: translate(-50%, -50%) scale(1); 
        opacity: 0.8; 
    }
    100% { 
        transform: translate(-50%, -50%) scale(2.5); 
        opacity: 0; 
    }
}

/* Info de programa extra */
.sch-info h4 {
    margin: 0 0 4px 0;
    font-size: 0.95rem;
    color: white;
}

.sch-info p {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sch-item-time-info {
    color: var(--color-marca);
    font-weight: 600;
    font-size: 0.75rem;
    opacity: 0.9;
}


.schedule-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 15px;
    padding: 12px 18px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    transition: all 0.3s ease;
    position: relative;
}

.sch-item-active {
    background: rgba(var(--color-marca-rgb), 0.08);
    border: 1px solid rgba(var(--color-marca-rgb), 0.3);
}

/* ==========================================
   ✨ MODAL: CANCIONES SONADAS (REDISEÑADO TOTAL)
   Mobile First - Sin Desbordamiento - Perfect Fit
   ========================================== */

.modal-sonadas {
    max-width: 95vw;
    width: 100%;
}

/* Contenedor principal - MOBILE FIRST */
.sonadas-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    
    /* Mobile: Con scroll */
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Estado Vacío */
.sonadas-empty {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.4);
}

.sonadas-empty i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.sonadas-empty p {
    font-size: 1.1rem;
    margin: 10px 0;
}

.sonadas-empty small {
    font-size: 0.85rem;
}

/* ==========================================
   TARJETA DE CANCIÓN - MOBILE FIRST (< 576px)
   Diseño VERTICAL para evitar desbordamiento
   ========================================== */
.sonada-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    
    width: 100%;
    box-sizing: border-box;
    
    transition: all 0.3s ease;
}

.sonada-card:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

/* Carátula - Mobile */
.sonada-cover {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.sonada-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Info - Mobile */
.sonada-info {
    width: 100%;
}

.sonada-info h4 {
    margin: 0 0 5px 0;
    font-size: 0.95rem;
    font-family: 'Montserrat SemiBold', sans-serif;
    color: white;
    line-height: 1.3;
    
    /* Máximo 2 líneas */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sonada-info p {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    
    /* Máximo 1 línea */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Botones - Mobile (Centrados, buen tamaño) */
.sonada-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    width: 100%;
}

.action-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    
    text-decoration: none;
    font-size: 1.1rem;
    
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.action-btn.spotify {
    background: #1DB954;
    color: white;
}

.action-btn.spotify:hover {
    background: #1ed760;
    transform: scale(1.1);
}

.action-btn.youtube {
    background: #FF0000;
    color: white;
}

.action-btn.youtube:hover {
    background: #ff3333;
    transform: scale(1.1);
}

/* ==========================================
   TABLET - 576px+ (Diseño horizontal compacto)
   ========================================== */
@media (min-width: 576px) {
    .modal-sonadas {
        max-width: 550px;
    }
    
    /* Tarjeta horizontal */
    .sonada-card {
        flex-direction: row;
        text-align: left;
        align-items: center;
        padding: 12px;
        gap: 12px;
    }
    
    .sonada-cover {
        width: 70px;
        height: 70px;
    }
    
    .sonada-info {
        flex: 1;
        min-width: 0; /* Importante para truncamiento */
    }
    
    .sonada-actions {
        width: auto;
        flex-shrink: 0;
    }
    
    .action-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* ==========================================
   TABLET GRANDE - 768px+ (2 columnas)
   ========================================== */
@media (min-width: 768px) {
    .modal-sonadas {
        max-width: 750px;
    }
    
    .sonadas-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        max-height: 65vh;
    }
}

/* ==========================================
   DESKTOP - 1024px+ (2 columnas optimizadas, SIN SCROLL)
   ========================================== */
@media (min-width: 1024px) {
    .modal-sonadas {
        max-width: 900px;
    }
    
    .sonadas-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 20px;
        
        /* SIN SCROLL: Altura fija para 5 filas */
        max-height: none;
        overflow-y: visible;
        
        /* Grid de exactamente 5 filas */
        grid-template-rows: repeat(5, 1fr);
    }
    
    .sonada-card {
        padding: 14px;
    }
    
    .sonada-cover {
        width: 75px;
        height: 75px;
    }
    
    .sonada-info h4 {
        font-size: 1rem;
    }
    
    .sonada-info p {
        font-size: 0.85rem;
    }
    
    .action-btn {
        width: 42px;
        height: 42px;
    }
}

/* ==========================================
   DESKTOP EXTRA GRANDE - 1400px+
   ========================================== */
@media (min-width: 1400px) {
    .modal-sonadas {
        max-width: 1100px;
    }
    
    .sonadas-grid {
        gap: 18px;
        padding: 25px;
    }
    
    .sonada-card {
        padding: 16px;
    }
    
    .sonada-cover {
        width: 80px;
        height: 80px;
    }
}

/* ==========================================
   SCROLLBAR PERSONALIZADO (Solo desktop)
   ========================================== */
@media (min-width: 768px) {
    .sonadas-grid::-webkit-scrollbar {
        width: 6px;
    }
    
    .sonadas-grid::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
        border-radius: 10px;
    }
    
    .sonadas-grid::-webkit-scrollbar-thumb {
        background: var(--color-marca);
        border-radius: 10px;
    }
    
    .sonadas-grid::-webkit-scrollbar-thumb:hover {
        background: #ff8533;
    }
}

/* ==========================================
   🎯 MODAL: ANUNCIA (MEJORADO)
   ========================================== */
.modal-anuncia {
    max-width: 500px;
    width: 95%;
}

.anuncia-content {
    padding: 20px;
}

.anuncia-intro {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

.anuncia-intro strong {
    color: var(--color-marca);
    display: block;
    margin-top: 10px;
}

.anuncia-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-family: 'Montserrat SemiBold', sans-serif;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label i {
    color: var(--color-marca);
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-marca);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(var(--color-marca-rgb), 0.1);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.btn-whatsapp {
    width: 100%;
    padding: 14px 20px;
    
    background: #25D366;
    border: none;
    border-radius: 12px;
    
    color: white;
    font-family: 'Montserrat Black', sans-serif;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    
    cursor: pointer;
    
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    
    transition: all 0.3s ease;
}

.btn-whatsapp:hover {
    background: #20ba5a;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(37, 211, 102, 0.4);
}

.btn-whatsapp:active {
    transform: translateY(0);
}

.btn-whatsapp i {
    font-size: 1.3rem;
}

/* ==========================================
   📱 RESPONSIVE - AJUSTES GENERALES
   ========================================== */
@media (max-width: 767px) {
    .modal-card {
        max-height: 85vh;
        overflow-y: auto;
    }
}