/* ========================================
   IMPORTS - GOOGLE FONTS
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ========================================
   RESET Y VARIABLES CSS
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colores Principales - UJED */
    --primary-color: #8a1526;
    --primary-dark: #5b0a16;
    --accent-color: #d11b0a;
    --gold: #ebb400;
    
    /* Colores de Texto */
    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    
    /* Backgrounds */
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-lighter: #f1f5f9;
    
    /* Borders */
    --border-color: #e5e7eb;
    
    /* Sombras - minimalistas */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
    
    /* Transiciones */
    --transition: all 0.3s ease;
}

/* ========================================
   TIPOGRAFÍA BASE
   ======================================== */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-white);
    font-size: 16px;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5em;
}

p {
    margin-bottom: 1em;
}

/* ========================================
   HEADER - NAVEGACIÓN
   ======================================== */
.header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.logo:hover {
    opacity: 0.8;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.4rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    position: relative;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    gap: 5px;
}

.menu-toggle span {
    width: 25px;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

/* ========================================
   LAYOUT PRINCIPAL
   ======================================== */
main {
    margin-top: 72px;
}

.section {
    padding: 5rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.text-center {
    text-align: center;
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    text-align: center;
    padding: 7rem 2rem;
    position: relative;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.95;
    margin-bottom: 2.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   PAGE HEADER
   ======================================== */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    text-align: center;
    padding: 5rem 2rem;
}

.page-header h1 {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.page-header p {
    font-size: 1.15rem;
    opacity: 0.95;
}

/* ========================================
   SECTION HEADERS
   ======================================== */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto;
}

/* ========================================
   BOTONES
   ======================================== */
.cta-button,
.btn-primary {
    display: inline-block;
    background: var(--bg-white);
    color: var(--primary-color);
    padding: 1rem 2.5rem;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.cta-button:hover,
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    display: inline-block;
    background: transparent;
    color: white;
    padding: 1rem 2.5rem;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    border: 2px solid white;
    cursor: pointer;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ========================================
   CARDS - DISEÑO LIMPIO
   ======================================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--gold);
}

.card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.card p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.card-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.card-link:hover {
    color: var(--accent-color);
    gap: 0.75rem;
}

/* ========================================
   CTA SECTION
   ======================================== */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
}

/* ========================================
   IMAGEN FACHADA
   ======================================== */
.fachada-container {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.fachada-container:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.fachada-image {
    width: 100%;
    height: 450px;
    object-fit: cover;
    display: block;
}

.image-caption {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ========================================
   PROGRAMAS
   ======================================== */
.programs {
    padding: 4rem 0;
}

.program-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    gap: 3rem;
}

.program-card {
    background: var(--bg-white);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.program-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.program-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    padding: 2.5rem;
}

.program-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.3;
}

.program-content {
    padding: 2.5rem;
}

.program_content_requisitos h3,
.program_content_row h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.program_content_requisitos ul,
.timeline ul {
    list-style: none;
    padding: 0;
}

.program_content_requisitos li,
.timeline li {
    padding: 0.75rem 0;
    padding-left: 2rem;
    position: relative;
    color: var(--text-secondary);
    line-height: 1.6;
    border-bottom: 1px solid var(--bg-lighter);
}

.program_content_requisitos li:last-child,
.timeline li:last-child {
    border-bottom: none;
}

.program_content_requisitos li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--gold);
    font-weight: bold;
    font-size: 1.1rem;
}

.timeline {
    margin-top: 2.5rem;
}

.timeline li::before {
    content: '📅';
    position: absolute;
    left: 0;
    font-size: 1.1rem;
}

.info-bar {
    background: var(--bg-lighter);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    border-left: 4px solid var(--gold);
    margin-top: 2rem;
}

.info-bar h4 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.info-bar p {
    color: var(--text-secondary);
    margin: 0;
}

/* ========================================
   INVESTIGADORES
   ======================================== */
.researchers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

.researcher-card {
    background: var(--bg-white);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.researcher-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--gold);
}

.researcher-photo {
    width: 100%;
    height: 280px;
    object-fit: cover;
}

.researcher-info {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.researcher-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.researcher-title {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.research-preview {
    margin-bottom: 1.5rem;
}

.research-list {
    list-style: none;
    padding: 0;
}

.research-list li {
    padding: 0.5rem 0 0.5rem 1.5rem;
    position: relative;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
}

.research-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.btn-more {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.75rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: auto;
    font-size: 0.95rem;
}

.btn-more:hover {
    background: var(--accent-color);
    transform: scale(1.02);
}

/* ========================================
   MODAL - MINIMALISTA
   ======================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 2000;
    overflow-y: auto;
    padding: 2rem 1rem;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

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

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    padding: 2.5rem;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.75rem;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1.5rem;
    display: block;
    border: 4px solid white;
    box-shadow: var(--shadow-md);
}

.modal-body {
    padding: 2.5rem;
}

.detail-section {
    margin-bottom: 2rem;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h3 {
    color: var(--primary-color);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-section p {
    color: var(--text-secondary);
    line-height: 1.8;
}

.detail-section ul {
    list-style: none;
    padding: 0;
}

.detail-section li {
    padding: 0.4rem 0 0.4rem 1.5rem;
    position: relative;
    color: var(--text-secondary);
    line-height: 1.6;
}

.detail-section li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* ========================================
   CONTACTO
   ======================================== */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 3rem;
    margin-top: 2rem;
}

.contact-info {
    background: var(--bg-lighter);
    padding: 2.5rem;
    border-radius: 12px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.contact-item:last-child {
    margin-bottom: 0;
}

.contact-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    font-size: 1.3rem;
}

.contact-item h4 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.05rem;
}

.contact-form {
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 1.75rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
    background: var(--bg-white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(138, 21, 38, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    background: var(--primary-color);
    color: white;
    padding: 0.9rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.submit-btn:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.map-section {
    margin-top: 4rem;
}

.map-placeholder {
    margin-top: 2rem;
}

/* ========================================
   FOOTER - MEJORADO
   ======================================== */
.footer {
    background: var(--primary-color);
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2.5rem;
    margin-bottom: 2rem;
}

.footer-column h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
}

.footer-column p {
    line-height: 1.8;
    opacity: 0.95;
    font-size: 0.95rem;
    margin: 0;
}

.footer-social {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.footer-social a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: var(--transition);
}

.footer-social a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.footer-social svg {
    width: 20px;
    height: 20px;
}

.footer-logo-column {
    text-align: center;
}

.footer-logo {
    max-width: 150px;
    height: auto;
    margin-top: 0.5rem;
    transition: var(--transition);
}

.footer-logo:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.footer-copyright {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-copyright p {
    opacity: 0.9;
    font-size: 0.9rem;
    margin: 0;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (min-width: 900px) {
    .program-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 72px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 72px);
        background: var(--bg-white);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 3rem;
        transition: var(--transition);
        box-shadow: var(--shadow-md);
        gap: 1rem;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin: 0.5rem 0;
    }

    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .hero h1,
    .page-header h1 {
        font-size: 2.25rem;
    }

    .hero p,
    .page-header p {
        font-size: 1.05rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .section {
        padding: 4rem 0;
    }

    .researchers-grid {
        grid-template-columns: 1fr;
    }

    .program-grid {
        grid-template-columns: 1fr;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .fachada-image {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1.25rem;
    }

    .hero,
    .page-header {
        padding: 5rem 1.5rem;
    }

    .hero h1,
    .page-header h1 {
        font-size: 1.95rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .card,
    .program-content,
    .contact-form,
    .contact-info {
        padding: 1.75rem;
    }

    .researcher-info {
        padding: 1.5rem;
    }

    .fachada-image {
        height: 250px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-logo-column {
        order: -1;
    }
}