/* ===== ESTILOS PERFECCIONADOS PARA TARJETAS ===== */
.cmr-radio-cards-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    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 PERFECCIONADO */
.cmr-radio-grid {
    display: grid;
    gap: 12px;
    margin-top: 15px;
}

.cmr-principal-grid {
    grid-template-columns: repeat(3, 1fr);
}

.cmr-aliadas-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* TARJETA PERFECCIONADA - ESTILO ORIGINAL */
.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(26, 42, 108, 0.85);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px;
    z-index: 1;
    min-height: auto;
}

.cmr-radio-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ENCABEZADO CON LOGO - TAMAÑOS CORREGIDOS */
.cmr-radio-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    padding: 6px 8px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cmr-radio-logo {
    width: 35px !important;
    height: 35px !important;
    border-radius: 6px;
    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: 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.8rem !important;
    color: #ffffff;
    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 PRINCIPAL DE LA EMISORA - TAMAÑO CORREGIDO */
.cmr-now-playing-cover {
    width: 100px !important;
    height: 100px !important;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* BOTONES CENTRADOS - TAMAÑOS CORREGIDOS */
.cmr-card-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin: 2px 0;
}

.cmr-play-btn, .cmr-website-btn {
    width: 50px !important;
    height: 50px !important;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    outline: none;
    text-decoration: none;
}

.cmr-play-btn {
    background: #c0392b;
    color: #FFDC00;
}

.cmr-play-btn:not(.active):hover {
    background: #e74c3c;
}

.cmr-play-btn.active {
    background: #2ecc40;
    box-shadow: 0 0 8px 3px rgba(46, 204, 64, 0.7);
}

.cmr-website-btn {
    background-color: #FFDC00;
    color: #001F3F;
}

.cmr-website-btn:hover {
    background-color: #2980b9;
    color: white;
}

/* INFORMACIÓN DE CANCIÓN ACTUAL */
.cmr-now-playing-preview {
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    border-radius: 6px;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    width: 100%;
    text-align: left;
    margin-top: auto;
}

.cmr-now-playing-preview .cmr-song-title {
    font-weight: 600;
    font-size: 0.75rem;
    margin-bottom: 2px;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cmr-now-playing-preview .cmr-song-artist {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* RESPONSIVE OPTIMIZADO */
@media (max-width: 768px) {
    .cmr-radio-cards-container {
        padding: 6px;
    }
    
    /* Primera sección en móvil: 1 tarjeta por fila */
    .cmr-principal-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    /* Segunda sección en móvil: 2 tarjetas por fila */
    .cmr-aliadas-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .cmr-radio-card {
        padding: 8px;
        gap: 6px;
    }
    
    .cmr-radio-header {
        padding: 5px 6px;
        gap: 6px;
    }
    
    .cmr-radio-logo {
        width: 30px !important;
        height: 30px !important;
    }
    
    .cmr-radio-name {
        font-size: 0.85rem !important;
    }
    
    .cmr-radio-location {
        font-size: 0.7rem !important;
    }
    
    .cmr-now-playing-cover {
        width: 70px !important;
        height: 70px !important;
    }
    
    .cmr-card-buttons {
        margin: 0;
    }
    
    .cmr-play-btn, .cmr-website-btn {
        width: 40px !important;
        height: 40px !important;
        font-size: 1rem;
    }
    
    .cmr-section-title {
        font-size: 1.8rem;
        margin: 20px auto;
        padding: 10px;
    }
}

/* Para pantallas medianas (entre 768px y 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .cmr-principal-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cmr-aliadas-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Efectos de brillo al hover */
.cmr-radio-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.6s ease;
}

.cmr-radio-card:hover::before {
    left: 100%;
}

/* Mensaje cuando no hay emisoras */
.cmr-no-radios {
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    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;
}

/* Animación optimizada */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Transiciones más rápidas */
.cmr-radio-card,
.cmr-play-btn,
.cmr-now-playing-cover {
    transition: all 0.15s ease;
}

/* Estado de carga para tarjetas */
.cmr-radio-card.loading .cmr-now-playing-cover {
    filter: blur(2px);
    opacity: 0.7;
}