@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700;900&display=swap');

/* --- ESTILOS GENERALES --- */
body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    background-color: #720F36;
}

html {
    scroll-behavior: smooth;
}

.container {
    width: 100%;
}


/* --- CABECERA --- */
header {
    background: #720F36;
    padding: 8px 5%;
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.logo img {
    height: 50px;
    width: auto;
    transition: var(--transition);
}

.header-image-container {
    flex-grow: 1;
    width: auto;
}

.header-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* --- TÍTULO PRINCIPAL --- */
.intro {
    background-color: #720F36;
    color: white;
    text-align: center;
    padding: 30px 5%;
}

.intro h1 {
    font-weight: 900;
    font-size: 2.5rem;
    margin: 0;
    line-height: 1.2;
}


/* --- SECCIONES DE CONTENIDO --- */
.section-container {
    padding: 20px 5%;
    background-color: #f4f4f4;
}

.card {
    display: flex;
    align-items: stretch;
    background-color: #ffffff;
    border-left: 8px solid #720F36;
    margin-bottom: 25px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.icon-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 200px;
    min-width: 200px;
    color: #720F36;
    text-align: center;
    padding-right: 20px;
}

.icon-title i {
    font-size: 3.5rem;
    margin-bottom: 10px;
}

.icon-title h2 {
    font-size: 1.5rem;
    font-weight: 900;
    margin: 0;
}

.description {
    flex: 1;
    padding: 10px 20px;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    display: flex;
    align-items: center;
}

.description p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #333;
    margin: 0;
}

.timeline {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-left: 20px;
    width: 180px;
    min-width: 180px;
}

.year-box {
    background-color: #e0e0e0;
    padding: 8px 30px;
    font-weight: bold;
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 15px;
}

.quarter-checks {
    display: flex;
    flex-direction: column;
}

.quarter-checks span {
    color: #333;
    margin-bottom: 5px;
    font-weight: bold;
}

.quarter-checks i {
    color: #720F36;
    margin-right: 8px;
}


/* --- PIE DE PÁGINA --- */

/* ================================
   NUEVO FOOTER ESTILIZADO
================================= */

footer {
    background: linear-gradient(135deg, #720F36 0%, #8a2a3a 100%);
    color: white;
    padding: 50px 5% 30px;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #BE9461, #ffd166, #BE9461);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    position: relative;
    z-index: 1;
}

.footer-section {
    padding: 20px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.footer-section:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.footer-section h3 {
    color: #ffd166;
    font-size: 1.4rem;
    margin-bottom: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-section h3::before {
    content: '';
    width: 30px;
    height: 3px;
    background: #BE9461;
    border-radius: 2px;
}

.footer-section p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 15px;
    opacity: 0.9;
}

#contador-visitas {
    display: inline-block;
    padding: 5px 15px;
    background: rgba(190, 148, 97, 0.2);
    border-radius: 20px;
    font-weight: 700;
    color: #ffd166;
    font-size: 1.2rem;
    margin-left: 5px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(190, 148, 97, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(190, 148, 97, 0);
    }
}

/* Redes Sociales */
.social-links {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.social-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #BE9461, #ffd166);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.social-links a i {
    position: relative;
    z-index: 1;
}

.social-links a:hover::before {
    opacity: 1;
}

.social-links a:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 5px 15px rgba(190, 148, 97, 0.3);
}



/* Línea decorativa inferior */
footer::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 5%;
    right: 5%;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
}

/* Responsive */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .footer-section {
        padding: 15px;
    }
    
    .footer-section h3 {
        font-size: 1.2rem;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .social-links a {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    footer {
        padding: 40px 20px 20px;
    }
    
    .footer-section h3 {
        font-size: 1.1rem;
    }
    
    .footer-section p {
        font-size: 0.95rem;
    }
    
    #contador-visitas {
        font-size: 1.1rem;
        padding: 4px 12px;
    }
}

/* --- ESTILOS PARA BOTONES DE TRIMESTRE --- */
.quarter-checks {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quarter-btn {
    display: flex;
    align-items: center;
    color: #333;
    text-decoration: none;
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
}

.quarter-btn:hover {
    text-decoration: underline;
    background-color: #6f1d2b;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.quarter-btn i {
    color: #6f1d2b;
    margin-right: 8px;
    transition: color 0.3s ease;
}

.quarter-btn:hover i {
    color: white;
}

/* Ajustes para pantallas pequeñas */
@media (max-width: 768px) {
    .quarter-checks {
        flex-direction: row;
        justify-content: center;
        gap: 15px;
    }

    .quarter-btn {
        padding: 10px 15px;
    }
}

/* --- ESTILOS PARA MODALES --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #6f1d2b;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #8a2a3a;
}

.modal-content h3 {
    color: #6f1d2b;
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 700;
    font-size: 1.5rem;
}

.button-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.grid-btn {
    display: block;
    padding: 15px;
    background-color: #6f1d2b;
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.grid-btn:hover {
    background-color: #8a2a3a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Ajustes para pantallas pequeñas */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 20px;
    }

    .modal-content h3 {
        font-size: 1.3rem;
    }
}

.data-section {
    padding: 15px;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    overflow-y: auto;

}

.card-grid {
    display: flex;
    align-items: stretch;
    background-color: #ffffff;
    border-left: 8px solid #be9461;
    margin-bottom: 25px;
    padding: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.icon-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 200px;
    min-width: 200px;
    color: #720F36;
    text-align: center;
    padding: 20px;
    border-right: 1px solid #ddd;
}

.icon-title i {
    font-size: 3.5rem;
    margin-bottom: 10px;
}

.icon-title h2 {
    font-size: 1.5rem;
    font-weight: 900;
    margin: 0;
}

/* Estructura para las secciones con encabezado */
.apoyos-section,
.importe-section,
.timeline-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.section-header {
    background-color: #e0e0e0;
    padding: 12px 20px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

.section-header .year-box {
    background-color: transparent;
    padding: 0;
    font-weight: bold;
    font-size: 1.2rem;
    color: #555;
    margin: 0;
}

/* Contenido de cada sección */
.apoyos-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;

    border-right: 1px solid #ddd;
}

.apoyos-content p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #333;
    margin: 0;
}

.importe-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    border-right: 1px solid #ddd;
}

.importe-content p {
    font-size: 0.9rem;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.timeline-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.apoyos-content {
    flex: 1;
    padding: 10px 20px;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    display: flex;
    align-items: center;
}

.apoyos-content p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #333;
    margin: 0;
}

/* --- ESTILOS PARA EL BOTÓN PDF GRANDE --- */

.pdf-button-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 10px;
}

.pdf-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: linear-gradient(145deg, #6f1d2b, #8a2a3a);
    color: white;
    padding: 30px 25px;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 15px rgba(111, 29, 43, 0.3);
    border: 3px solid transparent;
    text-align: center;
    min-width: 180px;
    max-width: 0px;
    position: relative;
    overflow: hidden;
}

.pdf-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 25px rgba(111, 29, 43, 0.4);
    background: linear-gradient(145deg, #8a2a3a, #9d3b4a);
    border-color: #BE9461;
}

.pdf-btn:active {
    transform: translateY(-2px) scale(1.02);
}

.pdf-btn i {
    font-size: 4rem;
    margin-bottom: 15px;
    color: #BE9461;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: all 0.3s ease;
}

.pdf-btn:hover i {
    color: white;
    transform: scale(1.1);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.pdf-text {
    font-size: 1.1rem;
    font-weight: 900;
    margin-bottom: 8px;
    line-height: 1.2;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.pdf-subtext {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 400;
}

/* Efecto de brillo al pasar el mouse */
.pdf-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: rotate(30deg);
    transition: all 0.6s ease;
}

.pdf-btn:hover::after {
    left: 100%;
}

/* Ajustes para pantallas pequeñas */
@media (max-width: 1024px) {
    .pdf-btn {
        padding: 25px 20px;
        min-width: 160px;
        max-width: 200px;
        min-height: 160px;
    }

    .pdf-btn i {
        font-size: 3.5rem;
    }

    .pdf-text {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .pdf-button-container {
        padding: 20px 0;
    }

    .pdf-btn {
        padding: 30px 25px;
        max-width: 250px;
        min-height: 170px;
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
        gap: 20px;
    }

    .pdf-btn i {
        margin-bottom: 0;
        font-size: 3.2rem;
        flex-shrink: 0;
    }

    .pdf-text-content {
        display: flex;
        flex-direction: column;
    }

    .pdf-text {
        font-size: 1.1rem;
        text-align: left;
    }

    .pdf-subtext {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .pdf-btn {
        padding: 25px 20px;
        max-width: 100%;
        min-height: 140px;
    }

    .pdf-btn i {
        font-size: 2.8rem;
    }

    .pdf-text {
        font-size: 1rem;
    }

    .pdf-subtext {
        font-size: 0.8rem;
    }
}

.timeline {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-left: 20px;
    width: 180px;
    min-width: 180px;
}

.year-box {
    background-color: #e0e0e0;
    padding: 8px 30px;
    font-weight: bold;
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 15px;
}

.quarter-checks {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quarter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    text-decoration: none;
    font-weight: bold;
    padding: 12px 20px;
    border-radius: 4px;
    transition: all 0.3s ease;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    min-width: 150px;
}

.quarter-btn:hover {
    text-decoration: none;
    background-color: #6f1d2b;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.quarter-btn i {
    color: #6f1d2b;
    margin-right: 8px;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.quarter-btn:hover i {
    color: white;
}

/* Estilos para pantallas pequeñas */
@media (max-width: 1024px) {
    .card-grid {
        flex-wrap: wrap;
    }

    .icon-title,
    .apoyos-content,
    .importe-content,
    .timeline {
        width: 100%;
        min-width: 100%;
        padding: 15px 10px;
        border: none;
        border-bottom: 1px solid #ddd;
    }

    .timeline {
        border-bottom: none;
        flex-direction: row;
        justify-content: space-between;
        padding-top: 20px;
    }

    .quarter-checks {
        flex-direction: row;
    }
}

/* --- ESTILOS PARA TOGGLE DE TARJETAS --- */

.section-header-toggle {
    display: flex;
    align-items: center;
    background: linear-gradient(145deg, #720F36, #8a2a3a);
    color: white;
    padding: 15px 20px;
    cursor: pointer;
    border-left: 8px solid #BE9461;
    transition: all 0.3s ease;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.section-header-toggle:hover {
    background: linear-gradient(145deg, #8a2a3a, #9d3b4a);
}

.toggle-icon {
    margin-right: 15px;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    min-width: 24px;
    text-align: center;
}

.section-header-toggle .icon-title {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    width: auto;
    min-width: auto;
    color: white;
    text-align: left;
    padding: 0;
    border-right: none;
}

.section-header-toggle .icon-title i {
    font-size: 2rem;
    margin-bottom: 0;
    margin-right: 15px;
    color: #BE9461;
}

.section-header-toggle .icon-title h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Estado colapsado por defecto */
.section-container.collapsed .card-grid {
    display: none;
}

.section-container.collapsed .section-header-toggle {
    margin-bottom: 25px;
    border-radius: 4px 4px 0 0;
}

/* Estado expandido */
.section-container:not(.collapsed) .card-grid {
    display: flex;
}

.section-container:not(.collapsed) .section-header-toggle {
    border-radius: 4px 4px 0 0;
    margin-bottom: 0;
}

.section-container:not(.collapsed) .toggle-icon {
    transform: rotate(180deg);
}

/* Animación suave para mostrar/ocultar */
.card-grid {
    transition: all 0.3s ease;
    overflow: hidden;
}

/* Ajustes para pantallas pequeñas */
@media (max-width: 768px) {
    .section-header-toggle {
        padding: 12px 15px;
    }

    .section-header-toggle .icon-title h2 {
        font-size: 1.2rem;
    }

    .section-header-toggle .icon-title i {
        font-size: 1.8rem;
        margin-right: 12px;
    }

    .toggle-icon {
        margin-right: 12px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .section-header-toggle {
        flex-direction: column;
        align-items: flex-start;
    }

    .toggle-icon {
        align-self: flex-end;
        margin-right: 0;
        margin-bottom: 10px;
    }

    .section-header-toggle .icon-title {
        width: 100%;
    }
}

/* --- ESTILOS PARA AUTO-FOCUS AL DESPLEGAR --- */

/* Efecto de foco visual */
.section-container.focused {
    position: relative;
    z-index: 10;
}

.section-container.focused .section-header-toggle {
    background: linear-gradient(145deg, #8a2a3a, #BE9461);
    box-shadow: 0 4px 20px rgba(138, 42, 58, 0.4);
}

.section-container.focused .section-header-toggle .icon-title h2 {
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.section-container.focused .section-header-toggle .icon-title i {
    color: white;
    animation: iconPulse 2s infinite;
}

.section-container.focused .card-grid {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-left: 8px solid #BE9461;
    border-top: 2px solid #BE9461;
    border-right: 2px solid #BE9461;
    border-bottom: 2px solid #BE9461;
}

/* Animación de pulso para el foco */
@keyframes pulseFocus {
    0% {
        box-shadow: 0 0 0 0 rgba(138, 42, 58, 0.3);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(138, 42, 58, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(138, 42, 58, 0);
    }
}

.section-container {
    animation: none;
    transition: all 0.4s ease;
}

/* Animación para los íconos */
@keyframes iconPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Borde animado para el encabezado en foco */
.section-container.focused .section-header-toggle {
    position: relative;
    overflow: hidden;
}

.section-container.focused .section-header-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Estilo para indicador visual de que se puede hacer clic */
.section-header-toggle {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.section-header-toggle::after {
    content: 'Click para expandir/contraer';
    position: absolute;
    right: 20px;
    font-size: 0.75rem;
    opacity: 0.8;
    font-weight: 400;
    transition: all 0.3s ease;
}

.section-container:not(.collapsed) .section-header-toggle::after {
    content: 'Click para contraer';
    opacity: 0.9;
}

/* Ajustes responsive para el indicador */
@media (max-width: 768px) {
    .section-header-toggle::after {
        content: '↕';
        font-size: 1rem;
        right: 15px;
        opacity: 0.7;
        background: rgba(0, 0, 0, 0.2);
        padding: 4px 8px;
        border-radius: 4px;
    }

    .section-container:not(.collapsed) .section-header-toggle::after {
        content: '↕';
    }
}

@media (max-width: 480px) {
    .section-header-toggle::after {
        display: none;
    }
}

/* Mejorar la visibilidad del toggle icon */
.toggle-icon i {
    transition: all 0.3s ease;
    transform-origin: center;
}

.section-container:not(.collapsed) .toggle-icon i {
    transform: rotate(180deg) scale(1.1);
    color: #ffffff;
}

/* Añadir separación visual entre tarjetas cuando están expandidas */
.section-container:not(.collapsed) {
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
}

/* Estilos específicos para el login */
.login-body {
    background: linear-gradient(135deg, #720F36 0%, #8a2a3a 50%, #9d3b4a 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-container {
    max-width: 1200px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    min-height: 600px;
}

.login-left {
    flex: 1;
    background: linear-gradient(135deg, #720F36 0%, #8a2a3a 100%);
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none" opacity="0.1"><path d="M0,0 L100,0 L100,100 Z" fill="white"/></svg>');
    background-size: cover;
}

.login-logo {
    width: 200px;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.login-left h1 {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.login-left p {
    font-size: 1.1rem;
    line-height: 1.6;
    text-align: center;
    max-width: 400px;
    position: relative;
    z-index: 1;
    opacity: 0.9;
}

.features-list {
    margin-top: 40px;
    position: relative;
    z-index: 1;
}

.feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    font-size: 1rem;
}

.feature-item i {
    color: #BE9461;
    margin-right: 15px;
    font-size: 1.2rem;
}

.login-right {
    flex: 1;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h2 {
    color: #720F36;
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
    font-size: 1rem;
}

.login-form {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #720F36;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #720F36;
    font-size: 1.2rem;
}

.form-control {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-control:focus {
    border-color: #720F36;
    background: white;
    outline: none;
    box-shadow: 0 0 0 3px rgba(114, 15, 54, 0.1);
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
}

.password-toggle:hover {
    color: #720F36;
}

.login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #720F36 0%, #8a2a3a 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
}

.login-btn:hover {
    background: linear-gradient(135deg, #8a2a3a 0%, #9d3b4a 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(114, 15, 54, 0.2);
}

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

.login-footer {
    margin-top: 30px;
    text-align: center;
}

.login-footer a {
    color: #720F36;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.login-footer a:hover {
    color: #8a2a3a;
    text-decoration: underline;
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
    font-weight: 600;
    position: relative;
    padding-left: 50px;
}

.alert i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .login-container {
        flex-direction: column;
        max-width: 600px;
    }

    .login-left {
        padding: 40px 20px;
    }

    .login-right {
        padding: 40px 20px;
    }
}

@media (max-width: 480px) {
    .login-left h1 {
        font-size: 2rem;
    }

    .login-header h2 {
        font-size: 1.8rem;
    }

    .form-control {
        padding: 12px 12px 12px 40px;
    }

    .login-btn {
        padding: 14px;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-container {
    animation: fadeIn 0.6s ease-out;
}

.login-left {
    animation: fadeIn 0.8s ease-out;
}

.login-right {
    animation: fadeIn 1s ease-out;
}

/* ====================== */
/* ESTILOS DE LOGIN */
/* ====================== */

.login-back-button {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    z-index: 100;
}

.login-back-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-5px);
}

/* Modal de sesión expirada */
.session-expired-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.session-expired-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: modalFadeIn 0.3s;
}

.session-expired-content h3 {
    color: #720F36;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.session-expired-content p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

.session-expired-btn {
    padding: 12px 30px;
    background: linear-gradient(145deg, #720F36, #8a2a3a);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.session-expired-btn:hover {
    background: linear-gradient(145deg, #8a2a3a, #9d3b4a);
    transform: translateY(-2px);
}

/* Indicador de usuario en admin */
.user-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-indicator i {
    color: #BE9461;
}

/* Estilos para login responsivo */
@media (max-width: 768px) {
    .login-back-button {
        top: 10px;
        left: 10px;
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .session-expired-content {
        padding: 30px 20px;
    }
    
    .user-indicator {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}

/* ========================================= */
/* ESTILOS DEL PANEL DE ADMINISTRACIÓN */
/* ========================================= */

/* --- CABECERA DEL ADMIN --- */
.admin-header {
    background: linear-gradient(135deg, #720F36 0%, #8a2a3a 100%);
    color: white;
    text-align: center;
    padding: 40px 5%;
    border-bottom: 5px solid #BE9461;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.admin-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none" opacity="0.05"><path d="M0,0 L100,0 L100,100 Z" fill="white"/></svg>');
    background-size: cover;
}

.admin-header h1 {
    font-weight: 900;
    font-size: 2.5rem;
    margin: 0 0 10px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
}

.admin-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
    font-weight: 400;
    position: relative;
}

/* --- LOGOS Y CABECERA --- */
.logos {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 80%;
    padding: 15px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
}

.logo-container a {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.logo-container a:hover {
    transform: scale(1.05);
}

.responsive-logo {
    height: 60px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* --- INDICADOR DE USUARIO --- */
.user-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    background: rgba(255, 255, 255, 0.15);
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.95rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.user-indicator:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.user-indicator i {
    color: #BE9461;
    font-size: 1.2rem;
}

/* --- BOTONES DE ACCIÓN DEL ADMIN --- */
.admin-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    position: relative;
}

.logout-btn, .view-site-btn {
    padding: 12px 25px;
    border-radius: 30px;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.logout-btn {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logout-btn:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.3);
}

.view-site-btn {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.view-site-btn:hover {
    background: linear-gradient(135deg, #138496, #117a8b);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(23, 162, 184, 0.3);
}

/* --- PANEL PRINCIPAL DEL ADMIN --- */
.admin-main {
    padding: 0 5% 50px;
    background-color: #f8f9fa;
    min-height: calc(100vh - 250px);
}

.admin-actions-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 25px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    border-left: 5px solid #720F36;
    transition: all 0.3s ease;
}

.admin-actions-panel:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.add-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #720F36, #8a2a3a);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(114, 15, 54, 0.2);
    font-size: 1rem;
}

.add-btn:hover {
    background: linear-gradient(135deg, #8a2a3a, #9d3b4a);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(114, 15, 54, 0.3);
}

.add-btn:active {
    transform: translateY(-1px);
}

.admin-stats {
    font-weight: 700;
    color: #720F36;
    font-size: 1.1rem;
    background: rgba(114, 15, 54, 0.1);
    padding: 12px 20px;
    border-radius: 8px;
    border: 2px solid rgba(114, 15, 54, 0.2);
}

/* --- CONTROLES DEL ADMIN --- */
.admin-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.05);
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: #555;
    font-size: 0.95rem;
}

.entries-select {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    color: #720F36;
    min-width: 80px;
}

.entries-select:focus {
    border-color: #720F36;
    outline: none;
    box-shadow: 0 0 0 3px rgba(114, 15, 54, 0.1);
}

.entries-select:hover {
    border-color: #8a2a3a;
}

.search-container {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box {
    padding: 12px 20px 12px 50px;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    width: 100%;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s;
    background: #f8f9fa url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23720F36" width="20px" height="20px"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>') no-repeat 20px center;
    background-size: 20px;
    font-weight: 500;
    color: #333;
}

.search-box:focus {
    border-color: #720F36;
    outline: none;
    box-shadow: 0 0 0 3px rgba(114, 15, 54, 0.1);
    background-color: white;
}

.search-box::placeholder {
    color: #999;
}

/* --- TABLA DE ADMINISTRACIÓN --- */
.table-container {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    overflow-x: auto;
    border: 1px solid #eee;
}

#adminTable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1000px;
}

#adminTable thead {
    background: linear-gradient(135deg, #720F36 0%, #8a2a3a 100%);
    color: white;
}

#adminTable th {
    padding: 20px 15px;
    text-align: left;
    font-weight: 700;
    font-size: 0.95rem;
    border-bottom: 3px solid #BE9461;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#adminTable th:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: rgba(255, 255, 255, 0.2);
}

#adminTable tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

#adminTable tbody tr:hover {
    background-color: rgba(114, 15, 54, 0.03);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

#adminTable tbody tr:nth-child(even) {
    background-color: #fafafa;
}

#adminTable tbody tr:nth-child(even):hover {
    background-color: rgba(114, 15, 54, 0.05);
}

#adminTable td {
    padding: 18px 15px;
    color: #444;
    font-size: 0.9rem;
    vertical-align: middle;
    line-height: 1.5;
}

#adminTable td:first-child {
    font-weight: 700;
    color: #720F36;
    font-size: 1.1rem;
}

#adminTable td:nth-child(3) {
    font-weight: 700;
    color: #720F36;
    text-align: center;
}

/* --- CELDA DE ACCIONES --- */
#adminTable td:last-child {
    width: 200px;
    min-width: 200px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    min-width: 90px;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.edit-btn {
    background: linear-gradient(135deg, #f0ad4e, #ec971f);
    color: white;
    border: 1px solid #ec971f;
}

.edit-btn:hover {
    background: linear-gradient(135deg, #ec971f, #d58512);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(240, 173, 78, 0.3);
}

.delete-btn {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: 1px solid #c82333;
}

.delete-btn:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.3);
}

/* --- PAGINACIÓN --- */
.pagination-buttons-container {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.pagination-controls-bottom {
    display: flex;
    align-items: center;
    gap: 25px;
    background: white;
    padding: 20px 40px;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #eee;
}

.pagination-btn {
    padding: 12px 25px;
    background: linear-gradient(135deg, #720F36, #8a2a3a);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(114, 15, 54, 0.2);
}

.pagination-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #8a2a3a, #9d3b4a);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(114, 15, 54, 0.3);
}

.pagination-btn:disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
}

.pagination-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.pagination-info-bottom {
    font-weight: 600;
    color: #555;
    min-width: 150px;
    text-align: center;
    font-size: 0.95rem;
}

/* --- MODALES --- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
    border: 1px solid rgba(114, 15, 54, 0.1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #720F36;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(114, 15, 54, 0.1);
}

.close-modal:hover {
    color: white;
    background: #720F36;
    transform: rotate(90deg);
}

#modalTitle {
    color: #720F36;
    margin-top: 0;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 700;
    font-size: 1.8rem;
    border-bottom: 3px solid #BE9461;
    padding-bottom: 15px;
}

/* --- FORMULARIO --- */
#programForm {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

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

.form-group label {
    font-weight: 700;
    color: #720F36;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label::before {
    content: '•';
    color: #BE9461;
    font-size: 1.5rem;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea {
    padding: 15px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    transition: all 0.3s;
    background: #f8f9fa;
    color: #333;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group textarea:focus {
    border-color: #720F36;
    outline: none;
    box-shadow: 0 0 0 3px rgba(114, 15, 54, 0.1);
    background: white;
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
    line-height: 1.6;
}

.form-group small {
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

/* --- SECCIÓN DE AYUDA DE SINTAXIS --- */
.syntax-help {
    background: linear-gradient(135deg, rgba(114, 15, 54, 0.05), rgba(190, 148, 97, 0.05));
    border-left: 4px solid #BE9461;
    padding: 20px;
    border-radius: 0 8px 8px 0;
    margin-top: 15px;
    border: 1px solid rgba(114, 15, 54, 0.1);
}

.syntax-help h4 {
    margin: 0 0 15px 0;
    color: #720F36;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.syntax-help h4::before {
    content: '💡';
    font-size: 1.2rem;
}

.syntax-help ul {
    margin: 0 0 20px 20px;
    padding: 0;
}

.syntax-help li {
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
}

.syntax-example {
    background: white;
    border: 1px dashed #BE9461;
    padding: 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
}

/* --- SECCIÓN DE SUBIDA DE PDF --- */
.pdf-upload-section {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.05), rgba(13, 110, 253, 0.05));
    border: 2px dashed #17a2b8;
    border-radius: 10px;
    padding: 25px;
    margin-top: 15px;
}

.pdf-upload-section h4 {
    margin: 0 0 20px 0;
    color: #138496;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pdf-upload-section h4::before {
    content: '📄';
    font-size: 1.3rem;
}

.pdf-upload-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.pdf-file-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    font-family: 'Montserrat', sans-serif;
    color: #333;
    transition: all 0.3s;
}

.pdf-file-input:focus {
    border-color: #17a2b8;
    outline: none;
    box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.1);
}

.upload-pdf-btn {
    padding: 12px 25px;
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.2);
}

.upload-pdf-btn:hover {
    background: linear-gradient(135deg, #138496, #117a8b);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.upload-message {
    margin-top: 15px;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    display: none;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.upload-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.upload-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* --- BOTONES DEL FORMULARIO --- */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 20px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

.cancel-btn, .save-btn {
    padding: 15px 35px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 150px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.cancel-btn {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
    border: 2px solid #5a6268;
}

.cancel-btn:hover {
    background: linear-gradient(135deg, #5a6268, #545b62);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

.save-btn {
    background: linear-gradient(135deg, #28a745, #218838);
    color: white;
    border: 2px solid #218838;
}

.save-btn:hover {
    background: linear-gradient(135deg, #218838, #1e7e34);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

/* --- MODAL DE CONFIRMACIÓN --- */
.confirmation-modal {
    max-width: 500px;
    text-align: center;
    padding: 50px 40px;
}

.confirmation-modal h3 {
    color: #720F36;
    margin-bottom: 20px;
    font-size: 1.8rem;
    border-bottom: none;
    padding-bottom: 0;
}

.confirmation-modal p {
    margin: 20px 0 30px;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #555;
}

.confirmation-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

/* --- SPINNER DE CARGA --- */
.loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.save-btn .loading-spinner {
    margin-right: 10px;
}

/* --- NOTIFICACIONES --- */
.notification {
    position: fixed;
    top: 30px;
    right: 30px;
    padding: 20px 25px;
    border-radius: 10px;
    font-weight: 600;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.notification.success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.notification.error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.notification i {
    font-size: 1.5rem;
}

/* --- ESTADOS DE CARGA --- */
.loading-state {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.loading-state::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================= */
/* RESPONSIVE - ADMIN */
/* ========================================= */

@media (max-width: 1200px) {
    .admin-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .search-container {
        max-width: 100%;
    }
    
    .pagination-controls-bottom {
        flex-wrap: wrap;
        justify-content: center;
        padding: 15px 25px;
    }
}

@media (max-width: 992px) {
    .logos {
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
        padding: 20px;
    }
    
    .admin-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .admin-header h1 {
        font-size: 2.2rem;
    }
    
    .admin-header p {
        font-size: 1rem;
    }
    
    .admin-actions-panel {
        flex-direction: column;
        gap: 20px;
        align-items: stretch;
        text-align: center;
    }
    
    .add-btn {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .admin-header {
        padding: 30px 5%;
    }
    
    .admin-header h1 {
        font-size: 1.8rem;
    }
    
    .logo-container {
        padding: 0 10px;
    }
    
    .responsive-logo {
        height: 50px;
        max-width: 150px;
    }
    
    .logout-btn, .view-site-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .user-indicator {
        padding: 8px 15px;
        font-size: 0.85rem;
    }
    
    .table-container {
        border-radius: 10px;
    }
    
    #adminTable th,
    #adminTable td {
        padding: 12px 10px;
        font-size: 0.85rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal-content {
        padding: 30px 20px;
        width: 95%;
        max-height: 95vh;
    }
    
    #modalTitle {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .pdf-upload-controls {
        flex-direction: column;
    }
    
    .pdf-file-input {
        min-width: 100%;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .cancel-btn, .save-btn {
        width: 100%;
        min-width: auto;
    }
    
    .confirmation-modal {
        padding: 30px 20px;
    }
    
    .confirmation-buttons {
        flex-direction: column;
    }
    
    .notification {
        top: 20px;
        right: 20px;
        left: 20px;
        max-width: calc(100% - 40px);
    }
}

@media (max-width: 576px) {
    .admin-main {
        padding: 0 3% 30px;
    }
    
    .admin-controls {
        padding: 15px;
    }
    
    .pagination-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .entries-select {
        width: 100%;
    }
    
    .pagination-controls-bottom {
        padding: 15px;
        gap: 15px;
    }
    
    .pagination-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .pagination-info-bottom {
        min-width: 120px;
        font-size: 0.9rem;
    }
    
    .form-group input[type="text"],
    .form-group input[type="number"],
    .form-group textarea {
        padding: 12px 15px;
    }
    
    .syntax-help {
        padding: 15px;
    }
    
    .pdf-upload-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .admin-header {
        padding: 25px 3%;
    }
    
    .admin-header h1 {
        font-size: 1.6rem;
    }
    
    .admin-stats {
        font-size: 1rem;
        padding: 10px 15px;
    }
    
    .add-btn {
        padding: 12px 25px;
        font-size: 0.95rem;
    }
    
    .search-box {
        padding: 10px 15px 10px 45px;
        background-position: 15px center;
    }
    
    .modal-content {
        padding: 25px 15px;
    }
    
    .close-modal {
        top: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 24px;
    }
}

/* --- EFECTOS ESPECIALES --- */
.highlight-new {
    animation: highlightPulse 0.8s ease-in-out 3;
}

@keyframes highlightPulse {
    0% { background-color: transparent; }
    50% { background-color: rgba(40, 167, 69, 0.1); }
    100% { background-color: transparent; }
}

/* --- ESTILOS PARA SCROLLBAR --- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #720F36, #8a2a3a);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #8a2a3a, #9d3b4a);
}

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #BE9461;
    border-radius: 4px;
}

/* --- EFECTO DE GRADIENTE ANIMADO EN TABLA --- */
#adminTable tbody tr:hover td {
    position: relative;
}

#adminTable tbody tr:hover td::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(114, 15, 54, 0.03), 
        transparent);
    z-index: -1;
    animation: rowGlow 2s ease-in-out infinite;
}

@keyframes rowGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* --- BADGE PARA ESTADO --- */
.pdf-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pdf-badge.has-pdf {
    background: rgba(40, 167, 69, 0.1);
    color: #218838;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.pdf-badge.no-pdf {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.3);
}

/* --- TOOLTIPS --- */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 10px);
}

/* ========================================= */
/* ESTILOS PARA AGRUPACIÓN DE PROGRAMAS */
/* ========================================= */

.category-section {
    margin-bottom: 40px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #eee;
}

.category-header {
    background: linear-gradient(135deg, #720F36 0%, #8a2a3a 100%);
    color: white;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #BE9461;
    position: relative;
    overflow: hidden;
}

.category-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none" opacity="0.05"><path d="M0,0 L100,0 L100,100 Z" fill="white"/></svg>');
    background-size: cover;
}

.category-icon-title {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
}

.category-icon-title i {
    font-size: 2.5rem;
    color: #ffd166;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.category-title {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 900;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.program-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-left: 15px;
}

/* Grid de programas */
.programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    padding: 30px;
    background: #f8f9fa;
}

/* Tarjetas de programa individuales */
.program-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.program-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: rgba(114, 15, 54, 0.1);
}

.program-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #eee;
    transition: all 0.3s ease;
}

.program-card-header:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.program-card-title {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.program-icons {
    display: flex;
    gap: 10px;
    color: #720F36;
    font-size: 1.5rem;
}

.program-card-title h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    flex: 1;
}

.program-year {
    background: #720F36;
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 700;
    min-width: 60px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(114, 15, 54, 0.2);
}

.program-card-toggle {
    color: #720F36;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    margin-left: 15px;
}

.program-card.collapsed .program-card-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 20px;
}

.program-card:not(.collapsed) .program-card-content {
    max-height: 1000px;
    opacity: 1;
    padding: 20px;
}

.program-card-content {
    transition: all 0.5s ease;
    background: white;
}

.program-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.program-detail-section {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.detail-header {
    background: #e9ecef;
    padding: 12px 20px;
    border-bottom: 1px solid #dee2e6;
}

.detail-header h4 {
    margin: 0;
    color: #720F36;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-content {
    padding: 20px;
}

.detail-content ul {
    margin: 10px 0 10px 20px;
    padding: 0;
}

.detail-content li {
    margin-bottom: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #555;
}

.importe-text {
    font-weight: 700;
    color: #720F36;
    font-size: 1rem;
    margin: 0;
    text-align: center;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 2px dashed #BE9461;
}

.pdf-btn-small {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #720F36, #8a2a3a);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 3px 10px rgba(114, 15, 54, 0.2);
}

.pdf-btn-small:hover {
    background: linear-gradient(135deg, #8a2a3a, #9d3b4a);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(114, 15, 54, 0.3);
    border-color: #BE9461;
}

.pdf-btn-small i {
    font-size: 1.2rem;
}

.no-pdf {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    margin: 0;
    padding: 10px;
    font-size: 0.9rem;
}

/* ========================================= */
/* RESPONSIVE PARA LA AGRUPACIÓN */
/* ========================================= */

@media (max-width: 1200px) {
    .programs-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .category-header {
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .category-icon-title {
        width: 100%;
        justify-content: space-between;
    }
    
    .category-title {
        font-size: 1.5rem;
    }
    
    .programs-grid {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 20px;
    }
    
    .program-card-header {
        padding: 15px;
    }
    
    .program-card-title {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .program-card-title h3 {
        font-size: 1rem;
        order: 3;
        width: 100%;
        margin-top: 5px;
    }
    
    .program-year {
        order: 2;
    }
}

@media (max-width: 480px) {
    .category-title {
        font-size: 1.3rem;
    }
    
    .category-icon-title i {
        font-size: 2rem;
    }
    
    .program-count {
        padding: 4px 10px;
        font-size: 0.85rem;
    }
    
    .program-detail-section {
        margin-bottom: 15px;
    }
    
    .detail-content {
        padding: 15px;
    }
    
    .detail-content ul {
        margin-left: 15px;
    }
    
    .detail-content li {
        font-size: 0.85rem;
    }
}

/* Animaciones para las tarjetas */
@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.program-card {
    animation: cardFadeIn 0.5s ease-out;
}

/* Efecto de brillo en hover para categorías */
.category-section:hover .category-header {
    position: relative;
    overflow: hidden;
}

.category-section:hover .category-header::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) rotate(30deg); }
    100% { transform: translateX(100%) rotate(30deg); }
}

/* ========================================= */
/* ESTILOS PARA AGRUPACIÓN DE PROGRAMAS */
/* ========================================= */

.category-section {
    margin-bottom: 25px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.category-header-toggle {
    background: linear-gradient(135deg, #720F36 0%, #8a2a3a 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    border-bottom: 3px solid #BE9461;
    transition: all 0.3s ease;
    position: relative;
}

.category-header-toggle:hover {
    background: linear-gradient(135deg, #8a2a3a 0%, #9d3b4a 100%);
}

.category-icon-title {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.category-icon-title i {
    font-size: 2.2rem;
    color: #ffd166;
    min-width: 40px;
    text-align: center;
}

.category-title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 900;
    flex: 1;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.program-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-left: 10px;
}

.category-toggle-icon {
    font-size: 1.3rem;
    color: #BE9461;
    transition: transform 0.3s ease;
    margin-left: 15px;
}

.category-section:not(.collapsed) .category-toggle-icon i {
    transform: rotate(180deg);
}

/* Grid de programas */
.programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    padding: 25px;
    background: #f8f9fa;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tarjetas de programa individuales */
.program-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.program-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border-color: rgba(114, 15, 54, 0.1);
}

.program-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.program-card-header:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.program-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    flex-wrap: wrap;
}

.program-icons {
    display: flex;
    gap: 8px;
    color: #720F36;
    font-size: 1.4rem;
}

.program-card-title h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    flex: 1;
    min-width: 200px;
}

.program-year {
    background: #720F36;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    min-width: 55px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(114, 15, 54, 0.2);
}

.program-card-toggle {
    color: #720F36;
    font-size: 1.1rem;
    transition: transform 0.3s ease;
    margin-left: 10px;
}

.program-card.collapsed .program-card-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0;
}

.program-card:not(.collapsed) .program-card-content {
    max-height: 1000px;
    opacity: 1;
    padding: 20px;
    animation: contentSlideDown 0.5s ease;
}

@keyframes contentSlideDown {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 1000px;
        opacity: 1;
    }
}

.program-card-content {
    transition: all 0.5s ease;
    background: white;
}

.program-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.program-detail-section {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.detail-header {
    background: #e0e0e0;
    padding: 10px 15px;
    border-bottom: 1px solid #d0d0d0;
}

.detail-header h4 {
    margin: 0;
    color: #720F36;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-content {
    padding: 15px;
}

.detail-content ul {
    margin: 10px 0 10px 20px;
    padding: 0;
    max-height: 200px;
    overflow-y: auto;
}

.detail-content li {
    margin-bottom: 6px;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #555;
    padding-left: 5px;
}

.importe-text {
    font-weight: 700;
    color: #720F36;
    font-size: 0.95rem;
    margin: 0;
    text-align: center;
    padding: 8px;
    background: white;
    border-radius: 6px;
    border: 2px dashed #BE9461;
}

.pdf-btn-small {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #720F36, #8a2a3a);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(114, 15, 54, 0.2);
}

.pdf-btn-small:hover {
    background: linear-gradient(135deg, #8a2a3a, #9d3b4a);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(114, 15, 54, 0.3);
    border-color: #BE9461;
}

.pdf-btn-small i {
    font-size: 1.1rem;
}

.no-pdf {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    margin: 0;
    padding: 8px;
    font-size: 0.85rem;
}

/* ========================================= */
/* RESPONSIVE PARA LA AGRUPACIÓN */
/* ========================================= */

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

@media (max-width: 768px) {
    .category-header-toggle {
        padding: 15px 20px;
    }
    
    .category-title {
        font-size: 1.4rem;
    }
    
    .category-icon-title i {
        font-size: 1.8rem;
    }
    
    .programs-grid {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 15px;
    }
    
    .program-card-header {
        padding: 15px;
    }
    
    .program-card-title h3 {
        min-width: auto;
        font-size: 1rem;
    }
    
    .detail-content ul {
        max-height: 150px;
    }
}

@media (max-width: 480px) {
    .category-header-toggle {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .category-icon-title {
        width: 100%;
    }
    
    .category-toggle-icon {
        position: absolute;
        right: 20px;
        top: 20px;
    }
    
    .program-card-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .program-icons {
        width: 100%;
        justify-content: flex-start;
    }
    
    .program-card-title h3 {
        width: 100%;
        order: 3;
    }
    
    .program-year {
        order: 2;
    }
    
    .detail-content {
        padding: 12px;
    }
}

/* Efecto visual para categorías */
.category-section:not(.collapsed) {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
    border-color: #BE9461;
}

/* Efectos específicos para categorías */
.category-section:nth-child(odd) .category-header-toggle {
    background: linear-gradient(135deg, #720F36 0%, #8a2a3a 100%);
}

.category-section:nth-child(even) .category-header-toggle {
    background: linear-gradient(135deg, #8a2a3a 0%, #9d3b4a 100%);
}

/* Animación para las tarjetas */
@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.program-card {
    animation: cardAppear 0.4s ease-out;
}

/* Scrollbar personalizado para listas */
.detail-content ul::-webkit-scrollbar {
    width: 6px;
}

.detail-content ul::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.detail-content ul::-webkit-scrollbar-thumb {
    background: #720F36;
    border-radius: 3px;
}

.detail-content ul::-webkit-scrollbar-thumb:hover {
    background: #8a2a3a;
}

/* ===============================
   MODAL GENERAL
=================================*/
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(74, 0, 27, 0.75); /* guinda oscuro */
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-container {
    background: #ffffff;
    width: 100%;
    max-width: 90%;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease;
    overflow: hidden;
}

/* Animación */
@keyframes modalFadeIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===============================
   HEADER DEL MODAL
=================================*/
.modal-header {
    background: linear-gradient(135deg, #6a0f2e, #8b1c3d);
    color: #ffffff;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.program-year-badge {
    background: #d4af37; /* dorado */
    color: #4a001b;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

/* Botón cerrar */
.modal-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.3rem;
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease;
}

.modal-close:hover {
    transform: scale(1.15);
    color: #ffdede;
}

/* ===============================
   CUERPO DEL MODAL
=================================*/
.modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

/* ===============================
   TABLA DE PROGRAMAS
=================================*/
.program-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.program-table thead {
    background: #f4f4f4;
}

.program-table th {
    text-align: left;
    padding: 12px;
    color: #6a0f2e;
    font-weight: 700;
    border-bottom: 2px solid #d4af37;
}

.program-table td {
    padding: 12px;
    vertical-align: top;
    border-bottom: 1px solid #e0e0e0;
}

/* Lista de apoyos */
.program-table ul {
    padding-left: 18px;
    margin: 0;
}

.program-table li {
    margin-bottom: 6px;
}

/* ===============================
   PDF LINK
=================================*/
.pdf-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: linear-gradient(145deg, #6f1d2b, #8a2a3a);
    color: white;
    padding: 30px 25px;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 15px rgba(111, 29, 43, 0.3);
    border: 3px solid transparent;
    text-align: center;
    min-width: 180px;
    position: relative;
    overflow: hidden;
    gap: 15px;
}

.pdf-link:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 25px rgba(111, 29, 43, 0.4);
    background: linear-gradient(145deg, #8a2a3a, #9d3b4a);
    border-color: #BE9461;
}

.pdf-link:active {
    transform: translateY(-2px) scale(1.02);
}

.pdf-link i {
    font-size: 4rem;
    color: #BE9461;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: all 0.3s ease;
}

.pdf-link:hover i {
    color: white;
    transform: scale(1.1);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.pdf-link-text {
    font-size: 1.1rem;
    font-weight: 900;
    line-height: 1.2;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.pdf-link::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: rotate(30deg);
    transition: all 0.6s ease;
}


.pdf-link:hover::after {
    left: 100%;
}

.no-pdf {
    color: #888;
    font-style: italic;
}

/* ===============================
   RESPONSIVE
=================================*/
@media (max-width: 768px) {
    .modal-container {
        max-width: 100%;
    }

    .program-table thead {
        display: none;
    }

    .program-table tr {
        display: block;
        margin-bottom: 15px;
    }

    .program-table td {
        display: block;
        padding: 10px;
        border-bottom: none;
    }

    .program-table td::before {
        content: attr(data-label);
        display: block;
        font-weight: 700;
        color: #6a0f2e;
        margin-bottom: 5px;
    }
}
