/* ===== VARIABLES Y ESTILOS BASE ===== */
:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --accent: #e74c3c;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --gray: #7f8c8d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: 
        linear-gradient(
            rgba(15, 32, 39, 0.4), 
            rgba(32, 58, 67, 0.5)
        ),
        url('../Images/JWT_PN_image.png') center/cover fixed;
    min-height: 100vh;
}

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

/* ===== HEADER ===== */
header {
    background: 
        linear-gradient(
            rgba(44, 62, 80, 0.6), 
            rgba(44, 62, 80, 0.5)
        ),
        url('../Images/mariposas.jpg') center/cover;
    color: white;
    padding: 3rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 400px;
    display: flex;
    align-items: center;
}

.header-content {
    position: relative;
    z-index: 2;
    width: 100%;
}

h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.8);
}

.subtitle {
    font-size: 1.5rem;
    color: var(--light);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
}

.cultural-note {
    font-style: italic;
    color: #f1c40f;
    margin-top: 1.5rem;
    font-size: 1.1rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    background: rgba(0,0,0,0.3);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    display: inline-block;
}

/* ===== NAVEGACIÓN ===== */
.nav {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.2);
    border-bottom: 3px solid var(--secondary);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.nav-list {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.nav-list a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 600;
    padding: 0.7rem 1.2rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-list a:hover {
    background: var(--secondary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

/* ===== LANGUAGE SWITCHER MEJORADO ===== */
.language-switcher {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
}

.lang-btn {
    background: transparent;
    border: 2px solid var(--secondary);
    color: var(--dark);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.lang-btn:hover {
    background: var(--secondary);
    color: white;
    transform: translateY(-2px);
}

.lang-btn.active {
    background: var(--secondary);
    color: white;
}

.flag-emoji {
    font-size: 1.2rem;
}

/* ===== SECCIONES ===== */
section {
    padding: 4rem 0;
    background: rgba(255, 255, 255, 0.88);
    margin: 2rem 0;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.3);
}

.section-dark {
    background: rgba(44, 62, 80, 0.88);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
}

h2 {
    font-size: 2.2rem;
    margin-bottom: 2rem;
    color: var(--primary);
    text-align: center;
    position: relative;
}

.section-dark h2 {
    color: white;
}

h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary), var(--accent));
    margin: 0.8rem auto;
    border-radius: 2px;
}

/* ===== HOME SECTION ===== */
.profile-container {
    display: flex;
    align-items: center;
    gap: 3rem;
    margin-bottom: 2rem;
}

.profile-picture {
    flex: 0 0 280px;
    position: relative;
}

.profile-picture img {
    width: 100%;
    border-radius: 50%;
    border: 6px solid var(--secondary);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
}

.profile-picture img:hover {
    transform: scale(1.05);
}

.profile-text {
    flex: 1;
    text-align: justify;
    font-size: 1.1rem;
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--light), #ffffff);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    border-left: 5px solid var(--secondary);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--gray);
    font-weight: 500;
}

/* ===== RESEARCH SECTION ===== */
.research-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

.research-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.1);
}

.research-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.research-image {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* ===== PUBLICATIONS ===== */
.publication-item {
    background: white;
    margin-bottom: 2rem;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-left: 5px solid var(--secondary);
    transition: transform 0.3s ease;
}

.publication-item:hover {
    transform: translateX(5px);
}

.publication-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.publication-year {
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 25px;
    font-weight: bold;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.publication-title {
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
    font-size: 1.1rem;
    line-height: 1.4;
}

.publication-title:hover {
    color: var(--secondary);
}

.publication-authors {
    color: var(--gray);
    font-style: italic;
    margin-bottom: 0.5rem;
}

/* ===== ACADEMIC LINKS ===== */
.academic-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.academic-link-card {
    background: linear-gradient(135deg, var(--light), #ffffff);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    text-decoration: none;
    color: var(--dark);
    transition: all 0.4s ease;
    border: 2px solid transparent;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.academic-link-card:hover {
    background: linear-gradient(135deg, var(--secondary), #2980b9);
    color: white;
    transform: translateY(-8px) scale(1.02);
    border-color: var(--secondary);
    box-shadow: 0 15px 35px rgba(52, 152, 219, 0.4);
}

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

.contact-card {
    background: linear-gradient(135deg, var(--light), #ffffff);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-5px);
}

.contact-icon {
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 1.5rem;
}

/* ===== FOOTER ===== */
footer {
    background: linear-gradient(135deg, var(--dark), #1a252f);
    color: white;
    text-align: center;
    padding: 3rem 0;
    margin-top: 4rem;
    border-top: 3px solid var(--secondary);
}

.footer-quote {
    font-style: italic;
    color: #f1c40f;
    margin-top: 1rem;
    font-size: 1rem;
}

/* ===== JAMES WEBB SECTION - OPTIMIZED GRID LAYOUT ===== */
.jwst-section {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2.5rem;
    border-radius: 15px;
    margin: 2rem 0;
}

.jwst-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr; /* Texto ocupa más espacio que la imagen */
    gap: 3rem;
    align-items: start; /* Alinea al inicio para mejor distribución */
    max-width: 1200px;
    margin: 0 auto;
}

.jwst-text h2 {
    text-align: left;
    margin-bottom: 1.5rem;
    color: white;
}

.jwst-text h2::after {
    margin: 0.8rem 0;
}

.jwst-content {
    text-align: justify;
    line-height: 1.7;
}

.jwst-content p {
    margin-bottom: 1.2rem;
    font-size: 1.05rem;
}

.jwst-visual {
    text-align: center;
    position: relative;
}

.jwst-image {
    max-width: 100%;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 12px 35px rgba(0,0,0,0.6);
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.jwst-image:hover {
    transform: scale(1.02);
}

.jwst-caption {
    font-style: italic;
    color: #f1c40f;
    font-size: 0.95rem;
    line-height: 1.4;
    padding: 0 1rem;
}

/* Responsive para JWST */
@media (max-width: 968px) {
    .jwst-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .jwst-text h2 {
        text-align: center;
    }
    
    .jwst-text h2::after {
        margin: 0.8rem auto;
    }
    
    .jwst-content {
        text-align: left;
    }
}

@media (max-width: 768px) {
    .jwst-section {
        padding: 1.5rem;
    }
    
    .jwst-grid {
        gap: 1.5rem;
    }
    
    .jwst-content p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .jwst-section {
        padding: 1rem;
    }
    
    .jwst-caption {
        font-size: 0.9rem;
        padding: 0 0.5rem;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .nav-list {
        gap: 1rem;
    }
    
    .nav-list a {
        padding: 0.6rem 1rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 768px) {
    .profile-container {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-picture {
        flex: 0 0 200px;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
        width: 100%;
    }
    
    .nav-list a {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .language-switcher {
        margin: 0;
        justify-content: center;
        width: 100%;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    .research-highlights,
    .academic-links,
    .contact-methods {
        grid-template-columns: 1fr;
    }

    header {
        min-height: 300px;
        padding: 2rem 0;
    }
}

@media (max-width: 480px) {
    .nav-list {
        gap: 0.3rem;
    }
    
    .nav-list a {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }
    
    .lang-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}
