/* =================== CSS Custom Properties =================== */
:root {
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --font-size-xs: clamp(0.7rem, 1.6vw, 0.8rem);
    --font-size-sm: clamp(0.8rem, 1.8vw, 0.9rem);
    --font-size-md: clamp(0.9rem, 2vw, 1rem);
    --font-size-lg: clamp(1rem, 2.5vw, 1.25rem);
    --color-primary: #2563eb;
    --color-primary-dark: #1e40af;
    --color-success: #10b981;
    --color-success-dark: #059669;
    --color-text: #111827;
    --color-text-light: #374151;
    --color-text-muted: #6b7280;
    --color-bg: #ffffff;
    --color-bg-light: #ffffff;
    --color-border: #e5e7eb;
    --color-shadow: rgba(0, 0, 0, 0.1);
}

/* =================== General Layout =================== */
body {
    min-height: 100vh;
    margin: 0;
    font-family: 'Figtree', sans-serif;
    background-color: var(--color-bg-light);
    padding-top: 60px;
}

/* =================== Layout General =================== */
.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
    width: 100%;
    padding: 0 0rem;
    gap: 1rem;
    margin-top: 2rem;


}

/* =================== Card Principal =================== */
.convocatoria-card {
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 1.5rem 1.5rem 0 1.5rem;
    box-shadow: 0 0.2rem 0.6rem rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #10dbd1;
    min-height: auto;
    display: flex;
    flex-direction: column;
    height: fit-content;
}

.convocatoria-card:hover {
    transform: translateY(-0.2rem);
    box-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.12);
}

/* =================== Título y Estado =================== */
.top-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.875rem;
    gap: 0.5rem;
}

.convocatoria-nombre {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 700;
    color: #0b3d91;
    line-height: 1.3;
    flex: 1;
    text-align: justify;
    text-transform: uppercase;
}



.convocatoria-estado {
    font-size: clamp(0.65rem, 1.5vw, 0.75rem);
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: 1.2rem;
    text-transform: capitalize;
    flex-shrink: 0;
    position: relative;
    overflow: hidden; /* importante para el brillo */
}

/* Estado publicada */
.convocatoria-estado.publicada {
    background: linear-gradient(135deg, #d4f8ee, #c1f1e3);
    color: #04694a;
}


/* BRILLO EN MOVIMIENTO */
.convocatoria-estado::after {
    content: "";
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent 0%,
        rgba(255, 255, 255, 0.45) 50%,
        transparent 100%
    );
    animation: shine 2.2s infinite linear;
}

/* Animación */
@keyframes shine {
    0% {
        left: -150%;
    }
    100% {
        left: 150%;
    }
}


.convocatoria-estado.en_proceso {
    background: #fef3c7;
    color: #b45309;
}

.convocatoria-estado.finalizada {
    background: #fee2e2;
    color: #b91c1c;
}

/* =================== Descripción =================== */
.convocatoria-descripcion {
    font-size: clamp(0.7rem, 1.8vw, 0.8rem);
    color: #374151;
    margin-bottom: 0.875rem;
    line-height: 1.5;
    text-align: justify;
}

/* =================== Tipo =================== */
.convocatoria-tipo {
    display: inline-block;
    background: #eef2ff;
    color: #4338ca;
    font-size: clamp(0.65rem, 1.5vw, 0.75rem);
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: 0.4rem;
    margin-bottom: 0.875rem;
}

/* =================== Sede & Modalidad =================== */
.sede-modalidad {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: clamp(0.65rem, 1.5vw, 0.75rem);
    color: #374151;
}

.sede-modalidad strong {
    color: #111827;
}

/* =================== Cargos =================== */
.cargos-section {
    margin-bottom: 1.25rem;
    flex: 1;
}

.cargos-section h4 {
    font-size: clamp(0.65rem, 1.3vw, 0.75rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1e3a8a;
    margin-bottom: 0.5rem;
    font-family: 'Montserrat', 'Segoe UI', sans-serif;
}





.cargos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
}

.cargo-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.6rem;
    padding: 0.5rem;
    font-size: clamp(0.5rem, 1.5vw, 0.6rem);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    min-height: 90px;
    color: #000000;
}

.cargo-card:hover {
    background: #f3f4f6;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* =================== RESPONSIVE CARGOS - SOLO 2 COLUMNAS =================== */
@media (max-width: 768px) {
    .cargos-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem;
        /* Reducir gap entre cards */
    }

    .cargo-card {
        font-size: 0.7rem;
        padding: 0.4rem 0.3rem;
        /* Reducir padding aún más */
        min-height: auto;
        /* Eliminar altura mínima fija */
        height: auto;
        /* Altura automática según contenido */
    }

    .cargo-card div {
        font-size: 0.7rem;
        line-height: 1.1;
        /* Reducir interlineado */
        margin-bottom: 0.1rem;
        /* Espacio mínimo entre elementos */
    }

    .cargo-card div:last-of-type {
        margin-bottom: 0.05rem;
        /* Mínimo espacio antes del botón */
    }

    .btn-postularme {
        font-size: 0.65rem;
        padding: 0.3rem 0.4rem;
        margin-top: 0.1rem;
        min-height: auto;
    }
}

@media (max-width: 480px) {
    .cargos-grid {
        gap: 0.4rem;
        /* Menor separación entre cards */
    }

    .cargo-card {
        font-size: 0.65rem;
        padding: 0.3rem 0.25rem;
        /* Padding mínimo */
    }

    .cargo-card div {
        font-size: 0.65rem;
        line-height: 1.1;
        margin-bottom: 0.05rem;
        /* Espacio casi nulo */
    }

    .cargo-card div:last-of-type {
        margin-bottom: 0.02rem;
    }

    .btn-postularme {
        font-size: 0.6rem;
        padding: 0.25rem 0.3rem;
        margin-top: 0.08rem;
        /* Espacio mínimo */
    }
}

/* Para pantallas muy pequeñas donde 2 columnas se vean apretadas */
@media (max-width: 360px) {
    .cargos-grid {
        grid-template-columns: 1fr !important;
        /* Una columna en móviles muy pequeños */
        gap: 0.3rem;
    }

    .cargo-card {
        padding: 0.25rem;
    }
}

/* =================== Botón Postularme =================== */
.btn-postularme {
    background-color: #10b981;
    color: #fff;
    font-size: clamp(0.55rem, 1.4vw, 0.65rem);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    margin-top: 0.5rem;
    box-shadow: 0 1px 4px rgba(16, 185, 129, 0.2);
}

.btn-postularme:hover {
    background-color: #0ea76d;
    transform: scale(1.03);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* =================== Documentos =================== */
.documentos-section {
    margin-bottom: 1.25rem;
}

.documentos-section h4 {
    font-size: clamp(0.65rem, 1.3vw, 0.75rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1e3a8a;
    margin-bottom: 0.5rem;
    font-family: 'Montserrat', 'Segoe UI', sans-serif;
}

.documentos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.documento-card {
    display: flex;
}

.documento-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #f9fafb;
    padding: 0rem 0.5rem;
    border-radius: 0.4rem;
    text-decoration: none;
    transition: all 0.25s ease;
    border: 1px solid transparent;
    width: 100%;
    min-height: 30px;
}

.documento-link:hover {
    background-color: #eef2ff;
    border-color: #c7d2fe;
    transform: translateY(-1px);
}

.documento-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.documento-titulo {
    color: #1e40af;
    font-size: clamp(0.45rem, 1.5vw, 0.55rem);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.sin-documentos {
    font-size: clamp(0.65rem, 1.5vw, 0.75rem);
    color: #6b7280;
    font-style: italic;
    text-align: center;
    grid-column: 1 / -1;
    /* Ocupa ambas columnas cuando no hay documentos */
}

/* =================== RESPONSIVE DOCUMENTOS =================== */
@media (max-width: 768px) {
    .documentos-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        /* 2 columnas en tablet */
        gap: 0.5rem;
    }

    .documento-link {
        padding: 0rem 0.2rem;
        min-height: 25px;
    }

    .documento-icon {
        width: 18px;
        height: 18px;
    }

    .documento-titulo {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .documentos-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.4rem;
    }

    .documento-link {
        padding: 0.2rem 0.2rem;
        min-height: 38px;
        gap: 0.4rem;
    }

    .documento-icon {
        width: 18px;
        height: 18px;
    }

    .documento-titulo {
        font-size: 0.65rem;
    }
}

/* Para pantallas muy pequeñas donde 2 columnas se vean apretadas */
@media (max-width: 360px) {
    .documentos-grid {
        grid-template-columns: 1fr !important;
        /* 1 columna en móviles muy pequeños */
        gap: 0.3rem;
    }

    .documento-link {
        padding: 0.3rem 0.4rem;
        min-height: 36px;
    }

    .documento-titulo {
        font-size: 0.6rem;
    }
}

/* =================== CONTENEDOR GRID DE BOTONES =================== */
.botones-convocatoria {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.55rem;
    justify-items: stretch;
    margin-top: 0.5rem;
}

/* ======== Estilos base compartidos ======== */
.btn-base {
    font-weight: 600;
    font-size: clamp(0.7rem, 1.2vw, 0.8rem);
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    min-height: 24px;
}

/* =================== BOTÓN VER HORARIOS =================== */
.btn-ver-horarios {
    background-color: #10b981;
    color: #fff;
    border: none;
}

.btn-ver-horarios:hover {
    background-color: #059669;
    transform: translateY(-1px);
}

/* =================== BOTÓN VER POSTULANTES =================== */
.btn-ver-postulantes {
    background-color: transparent;
    color: #10b981;
    border: 1px solid #10b981;
}

.btn-ver-postulantes:hover {
    background-color: #10b981;
    color: #fff;
    transform: scale(1.03);
}

/* =================== BOTÓN VER CRONOGRAMA =================== */
.btn-cronograma {
    background-color: #2563eb;
    color: #fff;
    border: none;
}

.btn-cronograma:hover {
    background-color: #1e40af;
    transform: translateY(-1px);
}

/* =================== PAGINACIÓN =================== */
.convocatorias-pagination-wrapper {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
    grid-column: 1 / -1;
}

.pagination-minimal {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: clamp(12px, 1vw, 14px);
}

.pagination-minimal a,
.pagination-minimal span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    text-decoration: none;
    background: #ffffff;
    color: #374151;
    border: 1px solid #e5e7eb;
    font-weight: 500;
    transition:
        background 0.25s ease,
        border-color 0.25s ease,
        color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.15s ease;
}

.pagination-minimal a:hover {
    background: #f8fafc;
    border-color: #d1d5db;
    color: #111827;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.pagination-minimal .active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-color: #1d4ed8;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
    transform: none;
    cursor: default;
}

.pagination-minimal .disabled {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none !important;
}

.pagination-minimal .icon {
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
}


/* =================== Responsive Design =================== */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .convocatoria-card {
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (max-width: 1024px) {
    .layout-wrapper {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .container {
        padding: 0 1rem;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
    }

    .filters-bar input,
    .filters-bar select,
    .filters-bar button {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 0.75rem;
    }

    .btn-ver-horarios {
        display: inline-flex;
    }

    .timeline-container {
        display: none;
    }

    .timeline-container.timeline-visible {
        display: block;
    }

    .convocatoria-card {
        padding: 1.25rem;
        min-height: 16rem;
    }

    .cargos-grid {
        grid-template-columns: 1fr;
    }

    .botones-convocatoria {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.4rem;
    }

    .btn-base {
        font-size: 0.7rem !important;
        /* Texto más pequeño para caber */
        padding: 0.5rem 0.4rem !important;
        /* Padding reducido */
        min-height: auto !important;
        /* Eliminar altura mínima fija */
        white-space: nowrap;
        /* Evitar que el texto se divida en varias líneas */
        text-align: center;
    }

    .page-body {
        padding: 0rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }

    .convocatoria-card {
        padding: 1rem;
        min-height: 14rem;
    }

    .top-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .convocatoria-estado {
        align-self: flex-start;
    }

    .convocatoria-nombre {
        font-size: clamp(0.8rem, 1.6vw, 0.9rem);
    }

    .convocatoria-descripcion {
        font-size: clamp(0.65rem, 1.5vw, 0.75rem);
        -webkit-line-clamp: 3;
    }

    .sede-modalidad {
        font-size: clamp(0.6rem, 1.4vw, 0.7rem);
    }

    .filters-bar {
        padding: 0.75rem;
        margin: 1rem 0;
    }

    .botones-convocatoria {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.3rem;
    }

    .btn-base {
        font-size: 0.65rem !important;
        padding: 0.4rem 0.3rem !important;
    }
}

/* 🔹 Móviles muy pequeños */
@media (max-width: 360px) {
    .convocatoria-card {
        padding: 0.875rem;
    }

    .botones-convocatoria {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.2rem;
    }

    .btn-base {
        font-size: 0.6rem !important;
        padding: 0.35rem 0.25rem !important;
    }

    .cargos-grid,
    .documentos-grid {
        grid-template-columns: 1fr;
    }

    .filters-bar {
        padding: 0.875rem;
    }
}

@media (hover: hover) {
    .convocatoria-card:hover {
        transform: translateY(-0.25rem);
        box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.12);
    }

    .btn-base:hover {
        transform: translateY(-1px);
    }
}

/* 🔹 Scroll suave para sidebar */
.sidebar-card {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

/* 🔹 Mejora en estados de carga y empty states */
.container>p {
    grid-column: 1 / -1;
    text-align: center;
    color: #6b7280;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    padding: 3rem 1rem;
    background: #f9fafb;
    border-radius: 0.75rem;
    margin: 1rem 0;
}

/* Mensaje cuando no hay convocatorias */
.container>p {
    grid-column: 1 / -1;
    text-align: center;
    color: #6b7280;
    font-size: clamp(0.8rem, 1.8vw, 0.9rem);
    padding: 2rem;
}


/* ====================== Timeline Futurista Compacto (reducción 20%) ====================== */
.timeline {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 0.8rem;
    align-items: flex-start;
    justify-items: center;
    margin: 1.6rem auto;
    padding: 1.1rem 0;
    max-width: 768px;
    min-height: 7.7rem;
    border-radius: 0.64rem;
    overflow: visible;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 1.28rem;
    left: 0;
    right: 0;
    height: 0.19rem;
    background: linear-gradient(90deg, rgba(0, 242, 254, 0.3), rgba(79, 172, 254, 0.3));
    border-radius: 0.1rem;
    z-index: 1;
    filter: blur(0.05rem);
}

/* Barra de progreso */
.timeline-progress {
    position: absolute;
    top: 1.28rem;
    left: 0;
    height: 0.19rem;
    width: calc(var(--progress, 0) * 100%);
    background: linear-gradient(90deg, #00f2fe, #4facfe);
    border-radius: 0.1rem;
    z-index: 2;
    box-shadow: 0 0 0.56rem rgba(79, 172, 254, 0.6);
    transition: width 0.5s ease-in-out;
}

@keyframes glow-progress {
    0% {
        box-shadow: 0 0 0.56rem rgba(79, 172, 254, 0.6);
    }

    100% {
        box-shadow: 0 0 0.72rem rgba(255, 59, 59, 0.6);
    }
}

/* Indicador HOY */
.timeline-today {
    position: absolute;
    top: 1.12rem;
    left: calc(var(--today-pos, 0) * 100%);
    width: 0.1rem;
    height: 0.77rem;
    background: #ff3b3b;
    box-shadow: 0 0 0.48rem rgba(255, 59, 59, 0.8);
    z-index: 3;
    transform: translateX(-50%);
    animation: laser-pulse 1.2s infinite;
}

@keyframes laser-pulse {
    0% {
        height: 0.77rem;
        opacity: 1;
    }

    50% {
        height: 0.96rem;
        opacity: 0.8;
    }

    100% {
        height: 0.77rem;
        opacity: 1;
    }
}

.timeline-today::after {
    content: "HOY";
    position: absolute;
    top: -1.12rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 59, 59, 0.85);
    color: #fff;
    font-size: clamp(0.35rem, 0.9vw, 0.42rem);
    font-weight: 700;
    padding: 0.16rem 0.4rem;
    border-radius: 0.4rem;
    box-shadow: 0 0 0.4rem rgba(255, 59, 59, 0.7);
    white-space: nowrap;
    text-shadow: 0 0 0.16rem rgba(255, 255, 255, 0.4);
    animation: hoy-blink 1.8s infinite;
}

/* Items */
.timeline-item {
    position: relative;
    text-align: center;
    z-index: 4;
    padding: 0 0.48rem;
    transition: transform 0.2s ease;
}

.timeline-item:hover {
    transform: scale(1.03);
}

/* Puntos */
.timeline-dot {
    width: 1.12rem;
    height: 1.12rem;
    border-radius: 50%;
    background: radial-gradient(circle, #1e1e2f, #0a0a1e);
    border: 0.13rem solid #aaa;
    margin: 0 auto;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: inset 0 0 0.4rem rgba(0, 0, 0, 0.7);
}

/* Estados */
.timeline-item.finished .timeline-dot {
    border-color: #00ff99;
    background: radial-gradient(circle, #00ff99, #00cc88);
    box-shadow: 0 0 0.72rem rgba(0, 255, 153, 0.9), inset 0 0 0.4rem rgba(255, 255, 255, 0.4);
}

.timeline-item.active .timeline-dot {
    border-color: #ff3b3b;
    background: radial-gradient(circle, #ff3b3b, #ff6b6b);
    box-shadow: 0 0 0.72rem rgba(255, 59, 59, 0.9), inset 0 0 0.48rem rgba(255, 255, 255, 0.6);
    transform: scale(1.15);
}

/* Pulso */
.timeline-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 59, 59, 0.4);
    top: 0;
    left: 0;
    animation: holographic-pulse 1.5s infinite;
    filter: blur(0.05rem);
}

/* Contenido */
.timeline-content {
    margin-top: 0.64rem;
    background: rgba(15, 15, 30, 0.9);
    padding: 0.56rem 0.8rem;
    border-radius: 0.48rem;
    font-size: clamp(0.48rem, 1.3vw, 0.38rem);
    color: #f1f1f1;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    backdrop-filter: blur(0.32rem);
    border: 0.64px solid rgba(0, 242, 254, 0.3);
    text-shadow: 0 0 0.1rem rgba(79, 172, 254, 0.4);
    line-height: 1.12;
}

.timeline-content span {
    display: block;
    font-weight: 700;
    font-size: clamp(0.45rem, 1.15vw, 0.51rem);
    color: #00e5ff;
    margin-bottom: 0.24rem;
    text-transform: uppercase;
    letter-spacing: 0.038rem;
    text-shadow: 0 0 0.19rem rgba(0, 242, 254, 0.6);
}

.timeline-item:hover .timeline-content {
    transform: translateY(-0.32rem);
    box-shadow: 0 0.48rem 0.96rem rgba(79, 172, 254, 0.5);
}

/* Mensaje vacío */
.timeline-empty {
    text-align: center;
    width: 100%;
    color: #aaa;
    font-style: italic;
    padding: 0.8rem;
    grid-column: 1 / -1;
    font-size: clamp(0.42rem, 1.15vw, 0.48rem);
}




/* =================== Tarjeta lateral fija =================== */
.sidebar-card {
    position: fixed;
    top: 8rem;
    right: 1rem;
    width: 330px;
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    border: 1px solid rgb(255, 65, 65);
    backdrop-filter: blur(6px);
    overflow-y: auto;
    max-height: calc(100vh - 8rem);
    z-index: 999;
}



/* =================== Títulos =================== */
.sidebar-card h3 {
    font-size: clamp(0.9rem, 2vw, 1rem);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #0f172a;
    border-left: 3px solid #3b82f6;
    padding-left: 0.6rem;
    margin: 1.5rem 0 0.8rem;
}

/* =================== Lista =================== */
.sidebar-card ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.sidebar-card li {
    margin-bottom: 0.9rem;
    font-size: clamp(0.60rem, 1.5vw, 0.68rem);
    color: #334155;
    line-height: 1.45;
    position: relative;
    padding-left: 1.25rem;
}

.sidebar-card li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55rem;
    width: 6px;
    height: 6px;
    background-color: #3b82f6;
    border-radius: 50%;
    opacity: 0.8;
}

/* =================== Enlaces a PDF =================== */
.pdf-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.35rem;
    font-weight: 600;
    font-size: 0.75rem;
    color: #1a1a1a;
    text-decoration: none !important;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.pdf-link:hover {
    color: #b98e16;
    background-color: rgba(185, 142, 22, 0.12);
    text-decoration: none !important; /* evita cualquier subrayado */
}


.pdf-icon {
    width: 17px;
    height: 17px;
    transition: transform 0.2s ease;
}

.pdf-link:hover .pdf-icon {
    transform: translateY(-2px) scale(1.05);
}

/* =================== Mensaje vacío =================== */
.sidebar-card p {
    font-size: 0.85rem;
    color: #64748b;
    text-align: center;
    margin: 1.25rem 0 0;
}




/* =================== Wrapper de dos columnas =================== */
.layout-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    max-width: 1900px;
    margin: 0 auto;
    padding: 0 1rem;
    min-height: 100vh;
    align-items: start;
}

/* =================== Barra de Búsqueda =================== */
.filters-bar {
    display: flex;
    gap: 1.25rem;
    margin: 2rem 0;
    flex-wrap: wrap;
    align-items: center;
    background-color: #f9fafb;
    padding: 1.25rem;
    border-radius: 0.75rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.filters-bar input,
.filters-bar select {
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    background-color: #ffffff;
    color: #111827;
    appearance: none;
}

.filters-bar select {
    background-image: url("data:image/svg+xml,%3Csvg fill='none' stroke='%23111827' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    background-size: 1.125rem 1.125rem;
    padding-right: 2.75rem;
    cursor: pointer;
}

.filters-bar input:focus,
.filters-bar select:focus {
    border-color: #2563eb;
    outline: none;
}

.filters-bar input {
    flex: 1;
    min-width: 250px;
}

.filters-bar button {
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    background-color: #2563eb;
    color: #ffffff;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.filters-bar button:hover {
    background-color: #1e40af;
}

/* =================== Responsive Design =================== */
@media (max-width: 1024px) {
    .layout-wrapper {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .sidebar-card {
        position: static;
        width: 100% !important;
        max-width: 100% !important;
        right: auto;
        top: auto;
        z-index: auto;
        margin: 1rem auto 2rem;
        max-height: none;
        transform: none !important;
        border: 1px solid rgb(255, 65, 65);
        padding: 1rem;
        box-sizing: border-box;
    }

    .container {
        padding: 0 1rem;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .filters-bar input,
    .filters-bar select,
    .filters-bar button {
        width: 100%;
        max-width: none;
    }
}



@media (max-width: 480px) {
    .layout-wrapper {
        padding: 0 0rem;
        gap: 1rem;
    }

    .container {
        padding: 0 0.25rem;
        gap: 1rem;
    }

    .convocatoria-card {
        padding: 1rem;
        border-radius: 0.5rem;
    }

    .convocatoria-nombre {
        font-size: clamp(0.8rem, 4vw, 1rem);
        line-height: 1.3;
    }

    .sede-modalidad {
        flex-direction: column;
        gap: 0.5rem;
        font-size: 0.8rem;
    }

    .btn-base {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }


}

/* Agrega esto en el archivo index.css, preferiblemente cerca de los estilos del timeline existente */

/* =================== Timeline Expandible =================== */
.timeline-toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.5rem 0;
    position: relative;
}

.timeline-toggle-btn {
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
    z-index: 2;
    position: relative;
}

.timeline-toggle-btn:hover {
    background: #1e40af;
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.4);
}

.timeline-toggle-btn i {
    transition: transform 0.3s ease;
}

.timeline-toggle-btn.expanded i {
    transform: rotate(180deg);
}

.timeline-collapsed-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, rgba(0, 242, 254, 0.3), rgba(79, 172, 254, 0.3));
    transform: translateY(-50%);
    z-index: 1;
}

/* Timeline contraído (solo puntos) */
.timeline-container.collapsed .timeline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0;
    padding: 0;
    margin: 0.5rem 0 1rem;
    min-height: auto;
    position: relative;
}

.timeline-container.collapsed .timeline::before {
    top: 50%;
    transform: translateY(-50%);
    height: 2px;
    background: linear-gradient(90deg, rgba(0, 242, 254, 0.2), rgba(79, 172, 254, 0.2));
}

.timeline-container.collapsed .timeline-progress {
    top: 50%;
    transform: translateY(-50%);
    height: 2px;
}

.timeline-container.collapsed .timeline-today {
    top: 50%;
    transform: translateY(-50%);
    height: 10px;
}

.timeline-container.collapsed .timeline-today::after {
    top: -1.5rem;
    font-size: 0.6rem;
    padding: 0.1rem 0.3rem;
}

/* Puntos en modo contraído */
.timeline-container.collapsed .timeline-item {
    position: relative;
    z-index: 3;
    padding: 0;
    margin: 0;
    flex: 1;
    display: flex;
    justify-content: center;
}

.timeline-container.collapsed .timeline-dot {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timeline-container.collapsed .timeline-item:hover .timeline-dot {
    transform: scale(1.3);
}

.timeline-container.collapsed .timeline-content {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0;
    margin-bottom: 0.5rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.6rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 100;
}

.timeline-container.collapsed .timeline-item:hover .timeline-content {
    display: block;
    opacity: 1;
    visibility: visible;
}

/* Timeline expandido (modo normal) */
.timeline-container.expanded .timeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 0.8rem;
    align-items: flex-start;
    justify-items: center;
    margin: 1.6rem auto;
    padding: 1.1rem 0;
    min-height: 6.7rem;
}

.timeline-container.expanded .timeline::before {
    top: 1.28rem;
    transform: none;
    height: 0.19rem;
}

.timeline-container.expanded .timeline-progress {
    top: 1.28rem;
    transform: none;
    height: 0.19rem;
}

.timeline-container.expanded .timeline-today {
    top: 1.12rem;
    transform: translateX(-50%);
    height: 0.77rem;
}

.timeline-container.expanded .timeline-content {
    display: block;
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    margin-top: 0.64rem;
}

/* Responsive para timeline contraído */
@media (max-width: 768px) {
    .timeline-container.collapsed .timeline {
        flex-direction: column;
        height: 200px;
        justify-content: space-between;
    }

    .timeline-container.collapsed .timeline::before {
        left: 50%;
        top: 0;
        bottom: 0;
        width: 2px;
        height: 100%;
        transform: translateX(-50%);
    }

    .timeline-container.collapsed .timeline-progress {
        left: 50%;
        top: 0;
        width: 2px;
        height: var(--progress, 0) * 100%;
        transform: translateX(-50%);
    }

    .timeline-container.collapsed .timeline-today {
        left: 50%;
        top: calc(var(--today-pos, 0) * 100%);
        width: 10px;
        height: 2px;
        transform: translateX(-50%);
    }

    .timeline-container.collapsed .timeline-item {
        margin: 0;
    }

    .timeline-container.collapsed .timeline-content {
        right: 100%;
        left: auto;
        bottom: 50%;
        transform: translateY(50%) translateX(-0.5rem);
        margin-right: 0.5rem;
    }
}

/* Ocultar botón "Ver Horarios" cuando timeline esté expandido */
.timeline-container.expanded~.botones-convocatoria .btn-ver-horarios {
    display: none;
}



/* =================== Timeline Expandible - Correcciones para móvil =================== */

/* Timeline contraído por defecto */
.timeline-container.collapsed {
    display: none;
    /* Oculto por defecto en móvil cuando está contraído */
}

.timeline-container.expanded {
    display: block;
    /* Mostrar cuando está expandido */
}

/* En móvil, mostrar siempre el botón de ver horarios */
@media (max-width: 768px) {
    .btn-ver-horarios {
        display: inline-flex !important;
    }

    /* Ocultar la línea y botón de toggle en móvil cuando está contraído */
    .timeline-container.collapsed .timeline-toggle-wrapper {
        display: none;
    }

    .timeline-container.expanded .timeline-toggle-wrapper {
        display: flex;
    }

    /* Timeline expandido en móvil - usar el estilo vertical */
    .timeline-container.expanded .timeline {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding-left: 2.5rem;
        margin: 2rem 0;
        padding: 0rem 0;
        overflow: visible;
    }

    .timeline-container.expanded .timeline::before {
        top: 0;
        left: 1.25rem;
        width: 0.3rem;
        height: 100%;
        filter: blur(0.075rem);
    }

    .timeline-container.expanded .timeline-progress {
        top: 0;
        left: 1.25rem;
        width: 0.3rem;
        height: calc(var(--progress, 0) * 100%);
    }

    .timeline-container.expanded .timeline-today {
        top: calc(var(--today-pos, 0) * 100%);
        left: 1.25rem;
        width: 1.2rem;
        height: 0.15rem;
        transform: none;
    }

    .timeline-container.expanded .timeline-item {
        text-align: left;
        padding-left: 3.5rem;
    }

    .timeline-container.expanded .timeline-dot {
        position: absolute;
        left: -0.5rem;
        top: 0;
        margin: 0;
        width: 1.5rem;
        height: 1.5rem;
    }

    .timeline-container.expanded .timeline-content {
        margin-top: 0;
        margin-left: 4.5rem;
        padding: 0.75rem 1rem;
    }
}

/* En desktop, mantener el comportamiento normal */
@media (min-width: 769px) {
    .timeline-container.collapsed {
        display: block;
    }

    .timeline-container.collapsed .timeline {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0;
        padding: 0;
        margin: 0.5rem 0 1rem;
        min-height: auto;
        position: relative;
        height: 40px;
    }

    .timeline-container.collapsed .timeline-content {
        display: none !important;
    }

    .timeline-container.expanded .timeline {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
        gap: 0.8rem;
        align-items: flex-start;
        justify-items: center;
        margin: 1.6rem auto;
        padding: 0rem 0;
        min-height: 2.7rem;
    }

    .timeline-container.expanded .timeline-content {
        display: block !important;
    }

    /* Ocultar botón "Ver Horarios" en desktop */
    .btn-ver-horarios {
        display: none !important;
    }
}


























.title_convo {
    text-align: center;
    text-transform: uppercase;
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    font-weight: 900;
    font-size: clamp(1rem, 2.2vw, 1.6rem);
    letter-spacing: 0.12rem;
    background: linear-gradient(90deg, #00f2fe, #4facfe, #0078ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 12px rgba(79, 172, 254, 0.6), 0 0 24px rgba(0, 242, 254, 0.4);
    margin: 0;
    /* sin espacio arriba ni abajo */
    position: relative;
    padding: 0;
    /* asegura cero separación extra */
}

.title_convo::after {
    content: "";
    display: block;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #00f2fe, #4facfe, #0078ff);
    margin: 0.4rem auto 0;
    /* solo un poco debajo del texto, ajustable */
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(79, 172, 254, 0.7);
}

/* SOLO PARA TELÉFONOS */
@media (max-width: 600px) {
    .title_convo {
        padding-top: 0.5rem;
        /* <-- aquí aumentas el padding superior */
    }
}

/* =================== Filtros Minimalistas =================== */
/* =================== Filtros Minimalistas =================== */
.filters-minimal {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 1000;
    /* Aumentar z-index para asegurar que esté por encima */
}

/* Botón trigger */
.filters-trigger {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.filters-trigger:hover {
    color: #374151;
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.filters-trigger.active {
    color: #2563eb;
    border-color: #2563eb;
    background: #f8fafc;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* Indicador de filtros activos */
.filters-trigger.filters-active {
    position: relative;
}

.filters-trigger.filters-active::after {
    content: "";
    position: absolute;
    top: -4px;
    right: -4px;
    width: 8px;
    height: 8px;
    background: #2563eb;
    border-radius: 50%;
    border: 2px solid #fff;
}

/* Panel de filtros */
.filters-panel {
    position: absolute;
    top: 100%;
    right: 0;
    width: 280px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    margin-top: 8px;
    z-index: 1001;
    /* Mayor que el botón */
}

.filters-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.filters-content {
    padding: 1.25rem;
}

/* Campos de filtro */
.filter-field {
    margin-bottom: 1rem;
}

.filter-field:last-of-type {
    margin-bottom: 1.25rem;
}

.filter-field input,
.filter-field select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.875rem;
    background: #ffffff;
    color: #374151;
    transition: all 0.2s ease;
}

.filter-field input:focus,
.filter-field select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-field input::placeholder {
    color: #9ca3af;
}

.filter-field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9L12 15L18 9' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* Acciones */
.filter-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
}

.btn-clear {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-clear:hover {
    color: #374151;
    background: #f9fafb;
}

/* Responsive */
@media (max-width: 768px) {
    .filters-minimal {
        top: auto;
        bottom: 20px;
        right: 20px;
    }

    .filters-panel {
        width: calc(100vw - 40px);
        max-width: 320px;
        right: 0;
        bottom: 100%;
        top: auto;
        margin-top: 0;
        margin-bottom: 8px;
        transform: translateY(10px);
    }

    .filters-panel.active {
        transform: translateY(0);
    }

    .filters-trigger {
        width: 52px;
        height: 52px;
        background: #ffffff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
}

/* Overlay para móviles */
@media (max-width: 768px) {
    .filters-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.2s ease;
    }

    .filters-panel.active~.filters-overlay {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 768px) {
    .sidebar-card {
        width: calc(100% - 1rem) !important;
        /* Restar el padding del contenedor */
        margin: 1rem 0.5rem 1.5rem;
        /* Margen uniforme */
        padding: 0.875rem;
        /* Reducir aún más el padding */
        border-radius: 0.75rem;
        /* Reducir bordes redondeados */
    }

    .sidebar-card h3 {
        font-size: 0.9rem;
        margin: 1rem 0 0.6rem;
        padding-left: 0.5rem;
    }

    .sidebar-card li {
        font-size: 0.75rem;
        padding-left: 1rem;
        margin-bottom: 0.6rem;
        line-height: 1.3;
    }

    .pdf-link {
        font-size: 0.75rem;
    }
}

/* 3. Para móviles muy pequeños */
@media (max-width: 480px) {
    .sidebar-card {
        width: calc(100% - 0.5rem) !important;
        margin: 0.75rem 0.25rem 1rem;
        padding: 0.75rem;
        border-radius: 0.5rem;
    }

    .sidebar-card h3 {
        font-size: 0.85rem;
        margin: 0.75rem 0 0.5rem;
    }

    .sidebar-card li {
        font-size: 0.7rem;
        padding-left: 0.875rem;
        margin-bottom: 0.5rem;
    }

    .sidebar-card li::before {
        width: 5px;
        height: 5px;
        top: 0.4rem;
    }

    .pdf-link {
        font-size: 0.7rem;
        gap: 0.3rem;
    }

    .pdf-icon {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 360px) {
    .sidebar-card {
        width: calc(100% - 0.25rem) !important;
        margin: 0.5rem 0.125rem 0.75rem;
        padding: 0.625rem;
    }

    .sidebar-card h3 {
        font-size: 0.8rem;
        margin: 0.5rem 0 0.4rem;
    }

    .sidebar-card li {
        font-size: 0.65rem;
        padding-left: 0.75rem;
    }

    .pdf-link {
        font-size: 0.65rem;
    }
}