/**
 * Estilos Personalizados - ZBrain Oposiciones
 * Color Corporativo: #ff5959
 * Archivo: oposiciones.css
 */

/* ============================================
   ESTILOS PARA GRID DE OPOSICIONES (Familias)
   ============================================ */

.oposiciones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
    margin: 0;
}

.oposicion-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.oposicion-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(255, 89, 89, 0.2);
}

.oposicion-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.oposicion-link {
    text-decoration: none;
    color: inherit;
    display: block;
    flex: 1;
}

/* Imagen de oposición */
.oposicion-imagen {
    position: relative;
    width: 100%;
    padding-top: 66.67%; /* Ratio 3:2 */
    overflow: hidden;
    background: linear-gradient(135deg, #ff5959 0%, #ff3838 100%);
}

.oposicion-imagen img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.oposicion-card:hover .oposicion-imagen img {
    transform: scale(1.05);
}

/* Overlay */
.oposicion-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1rem;
}

.oposicion-card:hover .oposicion-overlay {
    opacity: 1;
}

.ver-mas {
    background: #ffffff;
    color: #333;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Contenido */
.oposicion-content {
    padding: 1.5rem;
}

.oposicion-titulo {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    color: #1a1a1a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Stats */
.oposicion-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
}

.stat-item svg {
    color: #ff5959;
}

/* Lista de Cursos */
.cursos-lista {
    border-top: 1px solid #e5e5e5;
    padding: 1rem 1.5rem;
}

.toggle-cursos {
    width: 100%;
    background: none;
    border: none;
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-weight: 600;
    color: #ff5959;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.toggle-cursos:hover {
    color: #ff3838;
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.toggle-cursos[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

/* Desplegable de cursos */
.cursos-desplegable {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.toggle-cursos[aria-expanded="true"] + .cursos-desplegable {
    max-height: 500px;
    margin-top: 0.75rem;
}

.curso-item {
    margin: 0;
    padding: 0;
}

.curso-item a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0;
    text-decoration: none;
    color: #444;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
    padding-left: 0.75rem;
}

.curso-item a:hover {
    color: #ff5959;
    border-left-color: #ff5959;
    padding-left: 1rem;
}

.curso-item svg {
    flex-shrink: 0;
    color: #00cc66;
}

/* ============================================
   ESTILOS PARA CURSOS DE FAMILIA (Premium)
   ============================================ */

.cursos-familia-container {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}

/* Hero Header Elegante */
.cursos-familia-hero {
    background: linear-gradient(135deg, #ff5959 0%, #ff3838 50%, #e63946 100%);
    border-radius: 20px;
    padding: 3rem 2.5rem;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(255, 89, 89, 0.3);
}

.cursos-familia-hero::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.cursos-familia-hero::after {
    content: "";
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.cursos-hero-content {
    position: relative;
    z-index: 2;
}

.cursos-familia-titulo-principal {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    margin: 0 0 1rem 0;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.cursos-familia-subtitulo {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.95);
    margin: 0 0 1.5rem 0;
    font-weight: 400;
}

.cursos-stats-bar {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.curso-stat {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.3);
}

.curso-stat-icon {
    width: 24px;
    height: 24px;
    color: white;
}

.curso-stat-text {
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Grid de Cursos Premium */
.cursos-grid-premium {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

/* Card Premium del Curso */
.curso-card-premium {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid #f0f0f0;
}

.curso-card-premium:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(255, 89, 89, 0.15);
    border-color: #ff5959;
}

.curso-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Imagen del Curso */
.curso-imagen-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* Ratio 16:9 */
    overflow: hidden;
    background: linear-gradient(135deg, #ff5959 0%, #ff3838 100%);
}

.curso-imagen-premium {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.curso-card-premium:hover .curso-imagen-premium {
    transform: scale(1.08);
}

.curso-placeholder-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.curso-imagen-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.6) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.curso-card-premium:hover .curso-imagen-overlay {
    opacity: 1;
}

.curso-badge-top {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #ff5959;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(255, 89, 89, 0.4);
    z-index: 2;
}

/* Contenido del Card */
.curso-card-body {
    padding: 2rem;
}

.curso-titulo-premium {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 1rem 0;
    line-height: 1.4;
    min-height: 3.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.curso-descripcion {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Metadata del Curso */
.curso-metadata {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f0f0f0;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.curso-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #666;
}

.curso-meta-icon {
    color: #ff5959;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Call to Action */
.curso-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #ff5959 0%, #ff3838 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.curso-cta::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.5s ease;
}

.curso-card-premium:hover .curso-cta::before {
    left: 100%;
}

.curso-cta-text {
    font-size: 1rem;
}

.curso-cta-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.curso-card-premium:hover .curso-cta-arrow {
    transform: translateX(5px);
}

/* Empty State */
.cursos-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    color: #ddd;
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
}

.empty-text {
    font-size: 1rem;
    color: #666;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    .cursos-grid-premium {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    /* Grid de oposiciones */
    .oposiciones-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
        padding: 1rem 0;
    }
    
    .oposicion-content {
        padding: 1.25rem;
    }
    
    .oposicion-titulo {
        font-size: 1.1rem;
    }
    
    /* Cursos familia */
    .cursos-familia-container {
        padding: 0 1rem;
        margin: 2rem auto;
    }
    
    .cursos-familia-hero {
        padding: 2rem 1.5rem;
        margin-bottom: 2rem;
        border-radius: 16px;
    }
    
    .cursos-familia-titulo-principal {
        font-size: 1.75rem;
    }
    
    .cursos-familia-subtitulo {
        font-size: 1rem;
    }
    
    .cursos-stats-bar {
        gap: 1rem;
    }
    
    .curso-stat {
        padding: 0.6rem 1rem;
        font-size: 0.875rem;
    }
    
    .cursos-grid-premium {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .curso-card-body {
        padding: 1.5rem;
    }
    
    .curso-titulo-premium {
        font-size: 1.25rem;
        min-height: auto;
    }
    
    .curso-metadata {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    /* Grid de oposiciones */
    .oposiciones-grid {
        grid-template-columns: 1fr;
    }
    
    /* Cursos familia */
    .cursos-familia-hero {
        padding: 1.5rem 1rem;
    }
    
    .cursos-familia-titulo-principal {
        font-size: 1.5rem;
    }
    
    .curso-badge-top {
        font-size: 0.7rem;
        padding: 0.4rem 0.8rem;
    }
    
    .curso-metadata {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

/* ============================================
   ANIMACIONES Y EFECTOS ADICIONALES
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.oposicion-card,
.curso-card-premium {
    animation: fadeInUp 0.5s ease-out;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Focus visible para accesibilidad */
.oposicion-link:focus-visible,
.curso-card-link:focus-visible,
.toggle-cursos:focus-visible {
    outline: 3px solid #ff5959;
    outline-offset: 2px;
}

