:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --text-color: #333;
    --text-light: #6c757d;
    --bg-light: #ffffff;
    --bg-dark: #f1f3f5;
    --transition: all 0.3s ease;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
    scroll-behavior: smooth;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--primary-color);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.5rem;
    position: relative;
    color: var(--primary-color);
}

.section-title i {
    margin-right: 15px;
    color: var(--secondary-color);
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--secondary-color);
    margin: 15px auto;
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.section-subtitle i {
    margin-right: 10px;
    color: var(--secondary-color);
}

.subsection-title {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 5px;
    display: inline-block;
}

.subsection-title i {
    margin-right: 8px;
    color: var(--secondary-color);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--dark-color) 100%);
    color: white;
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('img/pattern.png') repeat;
    opacity: 0.05;
    pointer-events: none;
}

.profile-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 5px;
    position: relative;
    z-index: 1;
}

.profile-img {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--secondary-color);
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.profile-img:hover {
    transform: scale(1.05);
}

.profile-title {
    flex: 1;
    min-width: 300px;
}

.profile-title h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    color: white;
}

.profile-title h2 {
    font-size: 1.6rem;
    margin-bottom: 5px;
    color: var(--secondary-color);
    font-weight: 400;
}

.profile-title .institution {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

/* Profile Content */
.profile-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin-top: 40px;
}

.profile-bio {
    flex: 2;
    min-width: 300px;
    background: var(--bg-light);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.profile-bio p {
    line-height: 1.8;
    margin-bottom: 20px;
}

.research-list {
    list-style: none;
    margin-left: 20px;
}

.research-list li {
    margin-bottom: 15px;
    position: relative;
    padding-left: 25px;
}

.research-list li::before {
    content: '•';
    color: var(--secondary-color);
    font-size: 1.5rem;
    position: absolute;
    left: 0;
    top: -5px;
}

.research-topic {
    font-weight: 500;
    color: var(--primary-color);
}

.profile-details {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.detail-card {
    background: var(--bg-light);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.timeline {
    list-style: none;
}

.timeline li {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px dashed #eee;
    position: relative;
    padding-left: 30px;
}

.timeline li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.timeline li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--secondary-color);
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--secondary-color);
}

.degree {
    /* display: block; */
    font-weight: 500;
    color: var(--primary-color);
}

.institution {
    display: block;
    font-size: 0.9rem;
    color: var(--text-light);
}

.awards-list {
    list-style: none;
}

.awards-list li {
    margin-bottom: 12px;
    padding-left: 25px;
    position: relative;
}

.awards-list li::before {
    content: '🏆';
    position: absolute;
    left: 0;
}

/* Publications Section */
.publications-section {
    background: var(--bg-dark);
}

.publications-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.publications-list {
    flex: 1;
    min-width: 300px;
    max-height: 900px;
    overflow-y: auto;
    padding-right: 15px;
}

.publication {
    background: var(--bg-light);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.publication:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
    border-left-color: var(--secondary-color);
}

.publication.active {
    border-left-color: var(--secondary-color);
    background: #f0f7fc;
}

.publication h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--primary-color);
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
}

.publication .authors {
    font-style: italic;
    color: var(--text-light);
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.publication .journal {
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.publication .year {
    color: var(--text-light);
    font-size: 0.9rem;
}

.publication-detail {
    flex: 2;
    min-width: 300px;
    background: var(--bg-light);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    position: relative;
    overflow: hidden;
}

.publication-detail.visible {
    opacity: 1;
    transform: translateY(0);
}

.detail-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-light);
    text-align: center;
    padding: 40px;
}

.detail-placeholder i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #ddd;
}

.detail-placeholder h3 {
    color: var(--text-light);
    margin-bottom: 10px;
}

.detail-content h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.detail-content .authors {
    font-style: italic;
    margin-bottom: 15px;
    color: var(--text-light);
}

.detail-content .meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.detail-content .meta span {
    background: #f0f4f7;
    padding: 5px 10px;
    border-radius: 5px;
    color: var(--primary-color);
}

.detail-content .abstract {
    line-height: 1.8;
    margin-bottom: 20px;
}

.detail-content .doi a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.detail-content .doi a:hover {
    text-decoration: underline;
}

/* Projects Section */
.projects-section {
    background: var(--bg-light);
}

.swiper-container {
    width: 100%;
    padding: 30px 0 50px;
    position: relative;
}

.swiper-wrapper {
    padding: 20px 0;
}

.project-card {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    margin: 0 15px;
    border: 1px solid #eee;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.project-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.project-info {
    padding: 20px;
}

.project-info h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--primary-color);
    font-family: 'Roboto', sans-serif;
}

.project-info p {
    color: var(--text-light);
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.project-links {
    display: flex;
    gap: 10px;
}

.project-links a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.project-links .demo-link {
    background: var(--secondary-color);
    color: white;
}

.project-links .code-link {
    background: #f0f4f7;
    color: var(--primary-color);
}

.project-links a:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

.swiper-button-prev,
.swiper-button-next {
    color: var(--secondary-color) !important;
    background: rgba(255, 255, 255, 0.9);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
    background: white;
    transform: scale(1.1);
}

.swiper-button-prev::after,
.swiper-button-next::after {
    font-size: 1.5rem !important;
    font-weight: bold;
}

.swiper-pagination-bullet {
    width: 12px !important;
    height: 12px !important;
    margin: 0 8px !important;
}

.swiper-pagination-bullet-active {
    background: var(--secondary-color) !important;
}

/* Contact Section */
.contact-section {
    background: var(--bg-dark);
}

.contact-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

.contact-info {
    flex: 1;
    min-width: 300px;
    background: var(--bg-light);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.contact-item i {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f4f7;
    border-radius: 50%;
    color: var(--secondary-color);
    font-size: 1.1rem;
}

.contact-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.contact-item a:hover {
    color: var(--secondary-color);
}

.office-hours {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed #eee;
}

.office-hours h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.contact-form {
    flex: 2;
    min-width: 300px;
    background: var(--bg-light);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-family: inherit;
    transition: var(--transition);
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

button[type="submit"] {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

button[type="submit"]:hover {
    background-color: #2980b9;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(41, 128, 185, 0.3);
}

/* Footer */
footer {
    background: var(--primary-color);
    color: white;
    padding: 40px 0 0;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    flex: 1;
    min-width: 250px;
}

.footer-logo h3 {
    color: white;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.footer-logo p {
    color: rgba(255, 255, 255, 0.7);
}

.footer-links {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--secondary-color);
    padding-left: 5px;
}

.footer-social {
    flex: 1;
    min-width: 200px;
    display: flex;
    gap: 15px;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    transition: var(--transition);
}

.footer-social a:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
}

.copyright {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* Loading and Error Messages */
.loading-message, .error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    color: var(--text-light);
    background: var(--bg-light);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.loading-message i {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--secondary-color);
    animation: spin 1s linear infinite;
}

.error-message i {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--accent-color);
}

.error-message p {
    color: var(--accent-color);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Navigation */
.sticky-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(44, 62, 80, 0.98);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
}

.sticky-nav .container {
    display: flex;
    justify-content: center;
}

.sticky-nav ul {
    display: flex;
    list-style: none;
}

.sticky-nav li {
    margin: 0 5px;
}

.sticky-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 15px 20px;
    transition: var(--transition);
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.sticky-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    background: var(--secondary-color);
    bottom: 0;
    left: 0;
    transition: var(--transition);
}

.sticky-nav a:hover::after,
.sticky-nav a.active::after {
    width: 100%;
}

.sticky-nav a i {
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 992px) {
    .section-title {
        font-size: 2.2rem;
    }
    
    .profile-header {
        justify-content: center;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 60px 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .profile-img {
        width: 180px;
        height: 180px;
    }
    
    .profile-title h1 {
        font-size: 2.2rem;
    }
    
    .profile-title h2 {
        font-size: 1.3rem;
    }
    
    .sticky-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .sticky-nav li {
        margin: 5px;
    }
    
    .sticky-nav a {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .publications-list {
        max-height: 400px;
    }
    
    .swiper-button-prev,
    .swiper-button-next {
        display: none;
    }
}

@media (max-width: 576px) {
    .section-title {
        font-size: 1.8rem;
    }
    
    .profile-img {
        width: 150px;
        height: 150px;
    }
    
    .profile-title h1 {
        font-size: 1.8rem;
    }
    
    .profile-title h2 {
        font-size: 1.1rem;
    }
    
    .publications-container {
        flex-direction: column;
    }
    
    .publications-list {
        max-height: 300px;
    }
}

/* Contenedor principal del perfil */
.profile-header {
    position: relative;
    min-height: 300px; /* Altura mínima para el contenedor */
    padding: 40px 0;
    overflow: hidden;
}

/* Contenedor de la animación neuronal */
.neural-network-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* Detrás del contenido */
    pointer-events: none; /* Permite interactuar con elementos encima */
}

/* Canvas de la animación */
.profile-header {
    position: relative;
    min-height: 350px;  /* Altura mínima aumentada */
    display: flex;
    align-items: center;
    padding: 40px 0;
}



#neuralCanvas {
    display: block;
    width: 100%;
    height: 100%;
    opacity: 0.4;
    transition: opacity 0.5s ease;
}

.profile-header:hover #neuralCanvas {
    opacity: 1;
}

/* Asegurar que el contenido esté por encima */
.profile-img, .profile-title {
    position: relative;
    z-index: 2;
}

.neuron {
  transition: all 0.3s ease;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 0.8; }
  50% { opacity: 1; }
  100% { opacity: 0.8; }
}

.collaboration-map {
    margin: 15px 0;
    padding: 20px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.map-legend {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9em;
    color: #666;
}