/* ===== ESTILOS PERFECCIONADOS PARA TARJETAS - VERSIÓN EXPANDIDA Y OSCURA ===== */
.cmr-radio-cards-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px;
    background: linear-gradient(135deg, #0f172a, #1e1b4b, #0f0f0f);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.cmr-radio-section {
    margin-bottom: 40px;
}

.cmr-section-title {
    text-align: center;
    color: #ffffff;
    margin: 30px auto;
    padding: 15px;
    font-size: 2.5rem;
    font-weight: bold;
    text-shadow: -2px -2px 0 #000, 2px 2px 0 #000, 0 0 6px #ffffff;
    animation: blink-animation 1.5s infinite;
    letter-spacing: 2px;
    max-width: 1080px;
}

@keyframes blink-animation {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* ===== GRID ADAPTATIVO CON TARJETAS MÁS ANCHAS ===== */
.cmr-radio-grid {
    display: grid;
    gap: 15px;
    margin-top: 15px;
}

/* Grid para emisoras principales: se adapta al número de tarjetas, mínimo 340px */
.cmr-principal-grid {
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

/* Grid para emisoras aliadas: mínimo 300px */
.cmr-aliadas-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* Opcional: para pantallas muy grandes, limitar el crecimiento */
@media (min-width: 1600px) {
    .cmr-principal-grid {
        grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    }
}

/* ===== TARJETA MEJORADA CON FONDO OSCURO ===== */
.cmr-radio-card {
    background-image: url('<?php echo CMR_URL . 'assets/images/fondoazul.jpg'; ?>');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    backdrop-filter: blur(3px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 12px;
    z-index: 1;
    min-height: auto;
}

/* Overlay oscuro más pronunciado */
.cmr-radio-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 0;
    border-radius: 16px;
    transition: background 0.3s ease;
}

.cmr-radio-card:hover::before {
    background: rgba(0, 0, 0, 0.6);
}

.cmr-radio-card > * {
    position: relative;
    z-index: 1;
}

.cmr-radio-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ENCABEZADO CON LOGO */
.cmr-radio-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    padding: 8px 10px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cmr-radio-logo {
    width: 40px !important;
    height: 40px !important;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.cmr-radio-text {
    flex: 1;
    min-width: 0;
}

.cmr-radio-name {
    font-size: 1.1rem !important;
    margin: 0 0 2px 0;
    color: #ffffff;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    text-align: left;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.cmr-radio-location {
    font-size: 0.85rem !important;
    color: #e2e8f0;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    text-align: left;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    width: 100%;
    display: block;
}

/* IMAGEN COVER AMPLIADA 30% (de 100px a 130px) */
.cmr-now-playing-cover {
    width: 400px !important;
    height: 400px !important;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* BOTONES CENTRADOS */
.cmr-card-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin: 4px 0;
}

.cmr-play-btn, .cmr-website-btn {
    width: 55px !important;
    height: 55px !important;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    outline: none;
    text-decoration: none;
}

.cmr-play-btn {
    background: #c0392b;
    color: #FFDC00;
}

.cmr-play-btn:not(.active):hover {
    background: #e74c3c;
    transform: scale(1.05);
}

.cmr-play-btn.active {
    background: #2ecc40;
    box-shadow: 0 0 12px 4px rgba(46, 204, 64, 0.8);
}

.cmr-website-btn {
    background-color: #FFDC00;
    color: #001F3F;
}

.cmr-website-btn:hover {
    background-color: #2980b9;
    color: white;
    transform: scale(1.05);
}

/* INFORMACIÓN DE CANCIÓN ACTUAL */
.cmr-now-playing-preview {
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    border-radius: 8px;
    font-size: 1.85rem;
    display: flex;
    flex-direction: column;
    width: 100%;
    text-align: left;
    margin-top: auto;
}

.cmr-now-playing-preview .cmr-song-title {
    font-weight: 700;
    font-size: 1.85rem;
    margin-bottom: 3px;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cmr-now-playing-preview .cmr-song-artist {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* RESPONSIVE OPTIMIZADO */
@media (max-width: 768px) {
    .cmr-radio-cards-container {
        padding: 6px;
    }
    
    .cmr-principal-grid,
    .cmr-aliadas-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .cmr-radio-card {
        padding: 10px;
        gap: 8px;
    }
    
    .cmr-radio-header {
        padding: 6px 8px;
        gap: 8px;
    }
    
    .cmr-radio-logo {
        width: 35px !important;
        height: 35px !important;
    }
    
    .cmr-radio-name {
        font-size: 0.95rem !important;
    }
    
    .cmr-radio-location {
        font-size: 0.75rem !important;
    }
    
    /* Cover ampliado también en móvil (70px -> 90px) */
    .cmr-now-playing-cover {
        width: 190px !important;
        height: 190px !important;
    }
    
    .cmr-card-buttons {
        gap: 10px;
    }
    
    .cmr-play-btn, .cmr-website-btn {
        width: 45px !important;
        height: 45px !important;
        font-size: 1rem;
    }
    
    .cmr-section-title {
        font-size: 1.8rem;
        margin: 20px auto;
        padding: 10px;
    }
}

/* Para pantallas medianas (entre 769px y 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .cmr-principal-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    .cmr-aliadas-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* Efecto de brillo al hover (sin interferir con overlay) */
.cmr-radio-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.6s ease;
    z-index: 2;
    pointer-events: none;
}

.cmr-radio-card:hover::after {
    left: 100%;
}

/* Mensaje cuando no hay emisoras */
.cmr-no-radios {
    text-align: center;
    padding: 40px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.8);
    grid-column: 1 / -1;
}

.cmr-no-radios p {
    margin: 0;
}

/* Feedback visual para botones */
.cmr-play-btn.loading {
    position: relative;
    pointer-events: none;
}

.cmr-play-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Transiciones suaves */
.cmr-radio-card,
.cmr-play-btn,
.cmr-now-playing-cover {
    transition: all 0.2s ease;
}

/* Estado de carga para tarjetas */
.cmr-radio-card.loading .cmr-now-playing-cover {
    filter: blur(2px);
    opacity: 0.7;
}