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

:root {
    --primary-color: #0A2463;
    --secondary-color: #1E88E5;
    --accent-color: #64B5F6;
    --text-dark: #2C3E50;
    --text-light: #ECF0F1;
    --background: #FFFFFF;
    --background-alt: #F8F9FA;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--background);
}

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

/* Language Selector */
.language-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px;
    background: white;
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.lang-btn {
    border: none;
    background: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.lang-btn:hover,
.lang-btn.active {
    opacity: 1;
    transform: scale(1.1);
}

.lang-btn img {
    width: 30px;
    height: auto;
    display: block;
    border-radius: 3px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--background);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 999;
    padding: 1rem 0;
}

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

.nav-brand h1 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-brand span {
    color: var(--secondary-color);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

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

.nav-menu a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: var(--secondary-color);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    opacity: 0.05;
    z-index: -1;
}

.hero-content {
    max-width: 800px;
    animation: fadeInUp 1s ease;
}

.hero-title {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(30, 136, 229, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

/* Section Styles */
section {
    padding: 5rem 0;
}

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

.section-subtitle {
    text-align: center;
    color: var(--text-dark);
    font-size: 1.1rem;
    margin-bottom: 3rem;
    opacity: 0.8;
}

/* About Section */
.about {
    background: var(--background-alt);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

.about-description {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

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

.stat-item h3 {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.stat-item p {
    color: var(--text-dark);
    font-size: 0.9rem;
}

.about-values h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.about-values p {
    line-height: 1.8;
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.service-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(30, 136, 229, 0.2);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.service-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.service-card p {
    color: var(--text-dark);
    line-height: 1.6;
}

/* Projects Section */
.projects {
    background: var(--background-alt);
}

.projects-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.project-card-compact {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

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

.project-card-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    overflow: hidden;
    border: 4px solid var(--secondary-color);
    position: relative;
}

.project-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-card-badge {
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.project-card-body h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.project-card-excerpt {
    color: var(--text-dark);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.project-card-stats {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.stat-highlight {
    background: var(--accent-color);
    color: white;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.project-card-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.project-card-tech span {
    background: var(--background-alt);
    color: var(--text-dark);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.project-card-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--background-alt);
}

.view-project {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.project-card-compact:hover .view-project {
    color: var(--primary-color);
}

/* Publications Section */
.publications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.publication-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.publication-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(30, 136, 229, 0.2);
}

.publication-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.publication-title {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.15rem;
    line-height: 1.4;
}

.publication-authors {
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.publication-venue {
    color: var(--text-dark);
    font-style: italic;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    opacity: 0.8;
    line-height: 1.6;
}

.publication-metrics {
    padding-top: 1rem;
    border-top: 1px solid var(--background-alt);
}

.publication-metrics span {
    color: var(--secondary-color);
    font-size: 0.85rem;
    font-weight: 600;
}

/* Team Section */
.team {
    background: var(--background-alt);
    padding: 5rem 0;
    overflow: hidden;
}

.team-circle-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: 900px;
    margin: 4rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Logo Central - SIEMPRE ESTÁTICO */
.team-logo-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    overflow: hidden;
    border: 4px solid var(--primary-color);
}

.team-logo-center img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Miembros del equipo en círculo - SOLO LA POSICIÓN ROTA */
.team-member-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140px;
    height: 140px;
    margin: -70px 0 0 -70px;
    /* Cálculo para 7 miembros: 360deg / 7 = 51.43deg */
    /* La animación mueve la POSICIÓN en círculo */
    animation: orbitPosition 30s linear infinite;
    animation-delay: calc(var(--position) * -4.29s); /* 30s / 7 = 4.29s entre cada miembro */
    cursor: pointer;
}

/* Animación que mueve la POSICIÓN (no rota el contenido) */
@keyframes orbitPosition {
    from {
        transform: rotate(0deg) translateX(350px) rotate(0deg);
    }
    to {
        transform: rotate(360deg) translateX(350px) rotate(-360deg);
    }
}

/* Pausa la rotación cuando se hace hover en el contenedor */
.team-circle-container:hover .team-member-circle {
    animation-play-state: paused;
}

.member-photo-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--secondary-color);
    background: white;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    transition: all 0.4s ease;
    position: relative;
    z-index: 5;
}

.member-photo-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.4s ease;
}

/* Overlay con información */
.member-info-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    padding: 2rem;
    width: 320px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    z-index: 100;
    pointer-events: none;
}

.member-info-overlay h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.member-info-overlay .member-role {
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.member-info-overlay .member-bio {
    color: var(--text-dark);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Efectos hover */
.team-member-circle:hover .member-photo-circle {
    transform: scale(1.15);
    border-color: var(--accent-color);
    box-shadow: 0 10px 40px rgba(30, 136, 229, 0.4);
}

.team-member-circle:hover .member-info-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.team-member-circle:hover {
    z-index: 101;
}

/* Responsive Design para Team */
@media (max-width: 1024px) {
    .team-circle-container {
        max-width: 700px;
        height: 700px;
    }
    
    @keyframes orbitPosition {
        from {
            transform: rotate(0deg) translateX(280px) rotate(0deg);
        }
        to {
            transform: rotate(360deg) translateX(280px) rotate(-360deg);
        }
    }
    
    .team-logo-center {
        width: 150px;
        height: 150px;
    }
    
    .member-photo-circle {
        width: 120px;
        height: 120px;
    }
    
    .team-member-circle {
        width: 120px;
        height: 120px;
        margin: -60px 0 0 -60px;
    }
    
    .member-info-overlay {
        width: 280px;
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .team-circle-container {
        max-width: 500px;
        height: 500px;
    }
    
    @keyframes orbitPosition {
        from {
            transform: rotate(0deg) translateX(200px) rotate(0deg);
        }
        to {
            transform: rotate(360deg) translateX(200px) rotate(-360deg);
        }
    }
    
    .team-logo-center {
        width: 120px;
        height: 120px;
    }
    
    .member-photo-circle {
        width: 100px;
        height: 100px;
    }
    
    .team-member-circle {
        width: 100px;
        height: 100px;
        margin: -50px 0 0 -50px;
    }
    
    .member-info-overlay {
        width: 260px;
        padding: 1.2rem;
        font-size: 0.85rem;
    }
    
    .member-info-overlay h3 {
        font-size: 1rem;
    }
    
    .member-info-overlay .member-bio {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .team-circle-container {
        max-width: 400px;
        height: 400px;
        margin: 2rem auto;
    }
    
    @keyframes orbitPosition {
        from {
            transform: rotate(0deg) translateX(150px) rotate(0deg);
        }
        to {
            transform: rotate(360deg) translateX(150px) rotate(-360deg);
        }
    }
    
    .team-logo-center {
        width: 90px;
        height: 90px;
    }
    
    .member-photo-circle {
        width: 80px;
        height: 80px;
    }
    
    .team-member-circle {
        width: 80px;
        height: 80px;
        margin: -40px 0 0 -40px;
    }
    
    .member-info-overlay {
        width: 220px;
        padding: 1rem;
    }
    
    .member-info-overlay h3 {
        font-size: 0.95rem;
    }
}

/* =============================================
   OPCIONES DE VELOCIDAD DE ROTACIÓN
   Cambia el valor 30s por el que prefieras
   ============================================= */

/* VELOCIDAD ACTUAL: 30 segundos (Lenta y elegante) - PREDETERMINADA */
/* .team-member-circle { animation: orbitPosition 30s linear infinite; } */

/* VELOCIDAD MUY LENTA: 45 segundos (Muy sutil) */
/* .team-member-circle { animation: orbitPosition 45s linear infinite; } */
/* Cambia también: animation-delay: calc(var(--position) * -6.43s); */

/* VELOCIDAD MEDIA: 20 segundos */
/* .team-member-circle { animation: orbitPosition 20s linear infinite; } */
/* Cambia también: animation-delay: calc(var(--position) * -2.86s); */

/* VELOCIDAD RÁPIDA: 15 segundos */
/* .team-member-circle { animation: orbitPosition 15s linear infinite; } */
/* Cambia también: animation-delay: calc(var(--position) * -2.14s); */


/* Contact Section */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    margin-top: 2rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.info-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.info-item p {
    color: var(--text-dark);
}

/* Contact Form */
.contact-form {
    background: var(--background-alt);
    padding: 2rem;
    border-radius: 12px;
}

.form-group {
    position: relative;
    margin-bottom: 2rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.form-group label {
    position: absolute;
    left: 1rem;
    top: 1rem;
    color: #999;
    transition: all 0.3s ease;
    pointer-events: none;
}

.form-group input:focus + label,
.form-group input:valid + label,
.form-group textarea:focus + label,
.form-group textarea:valid + label {
    top: -0.75rem;
    left: 0.75rem;
    font-size: 0.85rem;
    background: var(--background-alt);
    padding: 0 0.5rem;
    color: var(--secondary-color);
}

/* Footer */
.footer {
    background: var(--primary-color);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.footer-brand h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.footer-brand p {
    font-size: 0.85rem;
    opacity: 0.8;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-color);
}

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

.footer-bottom p {
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.05);
        padding: 2rem 0;
    }

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

    .mobile-menu-toggle {
        display: flex;
    }

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

    .hero-subtitle {
        font-size: 1rem;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .about-stats {
        grid-template-columns: 1fr;
    }

    .projects-grid-compact {
        grid-template-columns: 1fr;
    }

    .project-card-image {
        width: 120px;
        height: 120px;
    }

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

    .contact-content {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }

    .language-selector {
        top: 80px;
    }
}