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

/* --- BASE --- */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background-color: #ffffff;
    color: #333333;
    overflow-x: hidden;
}

/* PDF Download Link */
.pdf-download-link {
    display: inline-block;
    margin-left: 15px;
    vertical-align: middle;
    transition: transform 0.3s ease;
}

.pdf-download-link:hover {
    transform: scale(1.05);
}

.pdf-icon {
    width: 48px !important;
    height: 48px !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
    transition: filter 0.3s ease;
    opacity: 0.8;
}

.pdf-icon:hover {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    opacity: 1;
}

/* Estilos específicos para PDF encima de la navegación */
.pdf-above-nav {
    width: 100%;
    max-width: 1200px;
    margin: 15px auto;
    padding: 0 20px;
    text-align: center;
}

.pdf-above-nav .pdf-download-link {
    display: inline-block;
    margin: 0;
    vertical-align: middle;
    transition: transform 0.3s ease;
}

.pdf-above-nav .pdf-download-link:hover {
    transform: scale(1.05);
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .pdf-download-link {
        margin-left: 10px;
    }

    .pdf-above-nav {
        margin: 10px auto;
        padding: 0 15px;
    }

    .pdf-icon {
        width: 36px !important;
        height: 36px !important;
    }
}

/* --- HERO SECTION --- */
.hero-wrap {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #333;
    overflow-x: hidden;
}

.hero-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    opacity: 0.6;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: white;
    padding: 0 20px;
}

.hero-content h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 900;
    margin: 0;
    line-height: 1;
    text-transform: uppercase;
    text-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.hero-content p {
    font-size: 1.5rem;
    letter-spacing: 2px;
    margin-top: 10px;
    font-weight: 300;
}

.social-icons {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.social-icons img {
    width: 40px;
    margin: 0 15px;
    filter: invert(1);
    transition: transform 0.2s;
}

.social-icons img:hover {
    transform: scale(1.1);
}

/* --- PRESENTACIÓN SECTION --- */
/* Wrapper final con fondo groove.jpg */
.final-section-wrapper {
    position: relative;
    width: 100%;
    background-image: url('imagenes/ososrio.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    padding: 60px 20px;
    min-height: 400px;
}

.final-section-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 0;
}

.final-section-wrapper > * {
    position: relative;
    z-index: 1;
}

.final-section-wrapper .code-toggle-btn h2 {
    color: #ffffff;
    font-size: 2rem;
    font-weight: 900;
    margin: 0;
    transition: color 0.3s ease;
    text-shadow: 0 4px 15px rgba(0,0,0,0.6);
    text-align: center;
}

.final-section-wrapper .code-toggle-icon {
    color: #ffffff;
}

.final-section-wrapper .btn-portfolio {
    color: #ffffff;
    border-color: #ffffff;
}

.final-section-wrapper .btn-portfolio:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Estilos para Vías de Desarrollo e Investigación */
.vias-desarrollo-content {
    width: 95vw;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

.vias-desarrollo-accordion-wrapper {
    width: 100%;
}

.vias-desarrollo-content h2 {
    margin-bottom: 2rem;
}

.vias-desarrollo-content .code-toggle-btn {
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
}

.vias-desarrollo-content .code-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.vias-desarrollo-content .code-toggle-btn.active {
    background-color: rgba(255, 255, 255, 0.15);
}

.vias-desarrollo-content .code-content-container {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .vias-desarrollo-content {
        width: 100%;
        padding: 20px 15px;
    }
    
    .vias-desarrollo-content h2 {
        font-size: 1.8rem;
    }
    
    .vias-desarrollo-content .code-toggle-btn h3 {
        font-size: 1.2rem;
    }
}

.about-wrap {
    width: 100%;
    padding: 60px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}


.about-content {
    position: relative;
    max-width: 1000px;
    width: 100%;
}

.about-text {
    max-width: 800px;
    font-size: 1.2rem;
    line-height: 1.8;
    color: #444;
    text-align: center;
    margin: 0 auto 0 auto;
    padding: 0 20px 50px 20px;
    font-weight: 300;
    position: relative;
    z-index: 2;
}

.about-img {
    position: absolute;
    bottom: -80px;
    left: 55%;
    transform: translateX(-50%);
    width: min(600px, 90vw);
    max-width: 100%;
    height: auto;
    object-fit: cover;
    clip-path: ellipse(50% 40%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

/* --- VIDEO PLACEHOLDER --- */
.video-placeholder {
    position: relative;
    width: 100%;
    max-width: 1000px;
    height: 250px;
    margin: 20px auto 0 auto;
    overflow: hidden;
    z-index: 2;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s;
    background-color: #000;
}

.video-placeholder:hover {
    transform: scale(1.02);
}

.placeholder-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.placeholder-bg iframe,
.placeholder-bg #youtubeVideo,
.placeholder-bg #ososImage {
    width: 100%;
    height: 100%;
    border: none;
    object-fit: cover;
}

.placeholder-bg #ososImage {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    object-fit: cover;
}

.placeholder-bg #ososImage.hidden {
    display: none;
}

.placeholder-bg #youtubeVideo.visible {
    opacity: 1;
    visibility: visible;
}

/* Contenedor inicial con icono, texto y botón */
.video-initial-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.3);
    gap: 20px;
    transition: opacity 0.3s;
}

.video-initial-content.hidden {
    display: none;
}

.collaboration-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
    margin: 0;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Botón de play de YouTube */
.youtube-play-button {
    width: 68px;
    height: 48px;
    min-width: 44px;
    min-height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
    padding: 0;
}

@media (max-width: 768px) {
    .youtube-play-button {
        width: 80px;
        height: 56px;
    }
}

.youtube-play-button:hover {
    transform: scale(1.1);
}

.youtube-play-button.hidden {
    display: none;
}

/* Texto sobrepuesto */
.video-overlay-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 30px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
}

.placeholder-cta-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform 0.2s;
}

.placeholder-cta-link:hover {
    transform: scale(1.05);
}

.videollamada-highlight {
    color: #4A90E2;
    font-weight: 900;
    text-shadow: 0 2px 8px rgba(74, 144, 226, 0.8);
}

.video-overlay-text.hidden {
    display: none;
}

.placeholder-text {
    font-size: 1.1rem;
    font-weight: 300;
    margin: 0 0 10px 0;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.placeholder-cta {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- PROYECTOS SECTION --- */
.projects-wrap {
    position: relative;
    width: 100%;
    padding: 80px 0;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

.projects-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('imagenes/pcbosque.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.35;
    z-index: 0;
    pointer-events: none;
}

.projects-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    padding: 0 20px;
}

.projects-header h2 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900;
    color: #222;
    margin: 0;
}

.projects-divider {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    border: none;
    border-top: 2px solid #ddd;
    margin: 30px 0 60px 0;
}

.projects-grid {
    position: relative;
    z-index: 1;
    display: flex;
    gap: clamp(20px, 5vw, 80px);
    justify-content: center;
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 0 20px;
}

.projects-error {
    color: #555;
    text-align: center;
    padding: 1rem;
}

.projects-error a {
    color: #4A90E2;
}

.project-item {
    text-decoration: none;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s;
}

.project-item:hover {
    transform: translateY(-10px);
}

.project-item img {
    width: min(250px, 80vw);
    height: min(250px, 80vw);
    max-width: 100%;
    max-height: 250px;
    height: auto;
    object-fit: contain;
    margin-bottom: 15px;
    filter: drop-shadow(0 10px 10px rgba(0,0,0,0.1));
}

.project-item span {
    font-weight: 700;
    font-size: 1.2rem;
    text-transform: uppercase;
    text-align: center;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
}

.project-item:hover span {
    opacity: 1;
    transform: translateY(0);
}

/* Imagen RAP (ices.png): 20% más pequeña que el resto de tarjetas */
.project-item img[src*="ices.png"] {
    width: min(200px, 64vw);
    max-width: 200px;
    max-height: 200px;
}

/* --- CONTACTO --- */
.contact-wrap {
    background-color: #111;
    color: white;
    padding: 60px 0;
    text-align: center;
    width: 100%;
}

.contact-wrap h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    margin: 0 0 30px 0;
}

.contact-form {
    display: flex;
    flex-direction: column;
    max-width: 500px;
    margin: 30px auto;
    gap: 15px;
    padding: 0 20px;
}

.contact-form input,
.contact-form textarea {
    padding: 15px;
    border: none;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
}

.contact-form button {
    padding: 15px;
    background: white;
    color: black;
    font-weight: 900;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s;
}

.contact-form button:hover {
    transform: scale(1.05);
}

.contact-form button:focus-visible,
.youtube-play-button:focus-visible,
.project-item:focus-visible {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .hero-content p {
        font-size: clamp(1rem, 4vw, 1.5rem);
    }
    
    .collaboration-text {
        font-size: clamp(1rem, 4vw, 1.3rem);
    }
    
    .placeholder-cta {
        font-size: clamp(1rem, 4vw, 1.3rem);
    }
}

/* --- ESTILOS PARA PÁGINAS DE PROYECTOS --- */
.quarto-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 60px 20px;
    font-family: 'Inter', sans-serif;
    color: #333333;
}

.quarto-content h1,
.quarto-content h2,
.quarto-content h3,
.quarto-content h4 {
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    color: #222;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.quarto-content h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 2.5rem;
}

.quarto-content h4 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 2rem;
}

.quarto-content p {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 1.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.quarto-content ul,
.quarto-content ol {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    font-size: 1.2rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 1.5rem;
}

.quarto-content li {
    margin-bottom: 0.8rem;
}

.quarto-content strong {
    font-weight: 700;
    color: #222;
}

/* Imagen header del proyecto */
#header-image {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto 3rem auto;
    border-radius: 8px;
    overflow: hidden;
}

#header-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Cuando header-image tiene las clases header-full-width y header-image-with-title */
#header-image.header-full-width {
    max-width: none;
    margin: 0;
    border-radius: 0;
    margin-bottom: 3rem;
}

#header-image.header-full-width.header-image-with-title img {
    width: 100vw;
    height: 45vh;
    min-height: 300px;
    object-fit: cover;
    object-position: center;
}

/* Header image con título overlay */
.header-image-with-title {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.header-image-with-title img {
    width: 100vw;
    height: 45vh;
    min-height: 300px;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Header full width - sin espacios laterales ni arriba */
.header-full-width {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border-radius: 0;
    position: relative;
    margin-bottom: 3rem;
    display: block;
    box-sizing: border-box;
    overflow: hidden;
}

/* Asegurar que html y body no tengan padding/margin que interfiera */
html {
    margin: 0;
    padding: 0;
    width: 100%;
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

.header-title-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.3) 100%);
    padding: 40px 30px;
    z-index: 2;
}

.header-title-overlay h1 {
    color: white;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 900;
    text-align: center;
    margin: 0;
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.8);
    line-height: 1.2;
    max-width: 900px;
}

@media (max-width: 768px) {
    .header-image-with-title img {
        height: 40vh;
        min-height: 250px;
    }
    
    .header-title-overlay {
        padding: 20px 15px;
    }
    
    .header-title-overlay h1 {
        font-size: clamp(1.2rem, 5vw, 1.8rem);
    }
}

/* Sección reveal-box */
.reveal-box {
    max-width: 800px;
    margin: 2rem auto;
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e0e0e0;
}

.reveal-box input[type="checkbox"] {
    display: none;
}

.reveal-box label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 700;
    color: #222;
    font-family: 'Inter', sans-serif;
}

.reveal-box label:hover {
    color: #4A90E2;
}

.reveal-box .solution-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    margin-top: 15px;
    padding-top: 0;
}

.reveal-box input[type="checkbox"]:checked ~ label ~ .solution-content,
.reveal-box input[type="checkbox"]:checked + label + .solution-content {
    max-height: 1000px;
    padding-top: 15px;
}

/* Alternativa: usar el selector de hermano general */
.reveal-box input[type="checkbox"]:checked ~ .solution-content {
    max-height: 1000px;
    padding-top: 15px;
}

.reveal-box .solution-content p,
.reveal-box .solution-content ul,
.reveal-box .solution-content ol {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 1rem;
}

/* Botón GitHub */
.btn-portfolio {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background-color: #111;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 700;
    font-size: 1rem;
    transition: transform 0.2s, background-color 0.2s;
    font-family: 'Inter', sans-serif;
}

.btn-portfolio:hover {
    transform: scale(1.05);
    background-color: #333;
}

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

/* HR separadores */
.quarto-content hr {
    max-width: 800px;
    margin: 3rem auto;
    border: none;
    border-top: 2px solid #ddd;
}

@media (max-width: 768px) {
    .quarto-content {
        padding: 40px 15px;
    }
    
    .quarto-content h3 {
        font-size: clamp(1.4rem, 5vw, 1.8rem);
    }
    
    .quarto-content h4 {
        font-size: clamp(1.2rem, 4vw, 1.4rem);
    }
    
    .quarto-content p {
        font-size: clamp(1rem, 4vw, 1.2rem);
    }
    
    .quarto-content ul,
    .quarto-content ol {
        font-size: clamp(1rem, 4vw, 1.2rem);
    }
}

/* --- NAVEGACIÓN HORIZONTAL DEBJO DEL TEIDE --- */
.nav-sections-horizontal {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    background-color: #ffffff;
}

.nav-sections-bottom {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    background-color: #f9f9f9;
}

.nav-section-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    min-width: 120px;
}

.nav-section-btn:hover {
    transform: translateY(-5px);
}

.nav-section-btn:hover img {
    box-shadow: none !important;
}

.nav-section-btn img:not(.nav-icon) {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 0;
    transition: all 0.3s ease;
    box-shadow: none;
}

/* Excepción para el icono de libro - sin marco */
.nav-section-btn .nav-icon {
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.nav-section-btn:hover img:not(.nav-icon) {
    box-shadow: none;
    transform: scale(1.05);
}

/* Excepción para el hover del icono de libro */
.nav-section-btn:hover .nav-icon {
    box-shadow: none !important;
    filter: none !important;
    transform: scale(1.05) !important;
}

/* Botón con imagen que respeta su forma original */
.nav-section-btn-image {
    background: transparent;
    border: none;
    padding: 0;
}

.nav-section-btn-image img {
    width: 64px;
    height: 64px;
    border-radius: 0;
    object-fit: contain;
    box-shadow: none;
    transition: transform 0.3s ease;
}

.nav-section-btn-image:hover img {
    transform: scale(1.1);
    box-shadow: none;
}

.nav-section-btn-image span {
    margin-top: 8px;
}

.nav-section-btn i {
    font-size: 48px;
    color: #4A90E2;
    transition: all 0.3s ease;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1) 0%, rgba(74, 144, 226, 0.05) 100%);
    border-radius: 50%;
}

.nav-section-btn:hover i {
    color: #2a6bb8;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.2) 0%, rgba(74, 144, 226, 0.1) 100%);
    transform: scale(1.05);
}

.nav-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    transition: all 0.3s ease;
}

.nav-section-btn span {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    text-align: center;
    transition: color 0.3s;
    max-width: 120px;
    line-height: 1.3;
}

.nav-section-btn:hover span {
    color: #4A90E2;
}

/* Sección de Conclusiones - solo texto, centrado */
.nav-conclusiones {
    margin-top: 0;
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.nav-section-btn-text-only {
    min-width: auto;
    padding: 0;
    display: flex;
    justify-content: center;
    width: 100%;
}

.nav-section-btn-text-only span {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
    text-align: center;
    transition: color 0.3s;
    max-width: none;
    padding: 10px 20px;
    border-bottom: 2px solid #ddd;
    display: inline-block;
}

.nav-section-btn-text-only:hover span {
    color: #4A90E2;
    border-bottom-color: #4A90E2;
}

/* Lista numerada de conclusiones */
.conclusiones-lista {
    width: 100%;
    max-width: 1000px;
    margin: 30px auto 0;
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s, visibility 0.3s, max-height 0.5s ease-out;
}

.conclusiones-contenido-completo {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.conclusiones-contenido-completo h2 {
    font-size: 2rem;
    font-weight: 900;
    color: #222;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.conclusiones-contenido-completo p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 1.5rem;
    max-width: 100%;
}

.conclusiones-lista.active {
    opacity: 1;
    visibility: visible;
    max-height: 5000px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 20px;
}

.conclusion-lista-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.conclusion-lista-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(5px);
}

.conclusion-numero {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    min-width: 35px;
    background: #90EE90;
    color: #333;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.conclusion-contenido {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.conclusion-texto {
    font-size: 1rem;
    line-height: 1.6;
    color: #444;
    font-weight: 500;
    padding-top: 5px;
}

.conclusion-grafico-container {
    margin-top: 10px;
    width: 100%;
    max-width: 600px;
}

.conclusion-grafico {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.conclusion-grafico:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Contenedor para múltiples gráficos */
.conclusion-graficos-container {
    margin-top: 15px;
    width: 100%;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.conclusion-grafico-wrapper {
    position: relative;
    display: inline-block;
}

.conclusion-grafico-multiple {
    width: 280px;
    height: auto;
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease, z-index 0.3s ease;
    cursor: pointer;
    display: block;
}

.conclusion-grafico-multiple:hover {
    transform: scale(1.15);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 10;
    position: relative;
}

/* Tooltip para gráficos múltiples */
.conclusion-grafico-tooltip {
    position: absolute;
    top: 50%;
    left: calc(100% + 15px);
    transform: translateY(-50%) translateX(-10px);
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    padding: 0;
    min-width: 250px;
    max-width: 350px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

.conclusion-grafico-wrapper:hover .conclusion-grafico-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

.conclusion-grafico-tooltip-titulo {
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1) 0%, rgba(74, 144, 226, 0.05) 100%);
    border-bottom: 2px solid #4A90E2;
    border-radius: 8px 8px 0 0;
    font-weight: 700;
    font-size: 0.95rem;
    color: #222;
    font-family: 'Inter', sans-serif;
}

.conclusion-grafico-tooltip-descripcion {
    padding: 12px 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #444;
    font-family: 'Inter', sans-serif;
}

/* Referencias a figuras en el texto */
.figura-reference {
    color: #4A90E2;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    transition: color 0.2s ease;
    position: relative;
}

.figura-reference:hover {
    color: #2a6bb8;
}

/* Tooltip flotante con imagen para referencias de figuras */
.figura-tooltip {
    position: fixed;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    padding: 0;
    max-width: 500px;
    min-width: 350px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.figura-tooltip.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.figura-tooltip-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1) 0%, rgba(74, 144, 226, 0.05) 100%);
    border-bottom: 2px solid #4A90E2;
    border-radius: 12px 12px 0 0;
}

.figura-tooltip-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 900;
    color: #222;
    font-family: 'Inter', sans-serif;
}

.figura-tooltip-image {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    display: block;
    padding: 15px;
    background: #f9f9f9;
}

.figura-tooltip-description {
    padding: 16px 20px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #444;
    font-family: 'Inter', sans-serif;
}

/* Flecha del tooltip */
.conclusion-grafico-tooltip::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 100%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-right-color: white;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .conclusion-lista-item {
        gap: 15px;
        padding: 12px;
    }
    
    .conclusion-numero {
        width: 30px;
        height: 30px;
        min-width: 30px;
        font-size: 1rem;
    }
    
    .conclusion-texto {
        font-size: 0.9rem;
    }
    
    .conclusion-graficos-container {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .conclusion-grafico-multiple {
        width: 100%;
        max-width: 300px;
    }
    
    .conclusion-grafico-tooltip {
        min-width: 200px;
        max-width: 280px;
        top: 100%;
        left: 50%;
        right: auto;
        transform: translateX(-50%) translateY(10px);
        margin-top: 10px;
    }
    
    .conclusion-grafico-wrapper.tooltip-active .conclusion-grafico-tooltip {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
    
    .conclusion-grafico-tooltip::before {
        top: 0;
        right: auto;
        left: 50%;
        transform: translateX(-50%) translateY(-100%);
        border-right-color: transparent;
        border-bottom-color: white;
        border-top-color: transparent;
    }
    
    .conclusion-grafico-wrapper.tooltip-active .conclusion-grafico-multiple {
        transform: scale(1.1);
    }
    
    .figura-tooltip {
        min-width: calc(100vw - 40px);
        max-width: calc(100vw - 40px);
        left: 20px !important;
        right: 20px !important;
        top: 50% !important;
        transform: translateY(-50%);
    }
    
    .figura-tooltip.active {
        transform: translateY(-50%);
    }
    
    .figura-tooltip-image {
        max-height: 300px;
        padding: 10px;
    }
    
    .figura-tooltip-header h3 {
        font-size: 1rem;
    }
    
    .figura-tooltip-description {
        font-size: 0.9rem;
        padding: 12px 16px;
    }
    
    .code-tabs {
        flex-direction: column;
    }
    
    .code-tab {
        width: 100%;
        text-align: center;
    }
    
    .code-content pre {
        padding: 15px;
        font-size: 0.8rem;
    }
    
    .code-header h3 {
        font-size: 1.2rem;
    }
    
    .code-description {
        font-size: 1rem;
    }
}

/* Tooltip flotante para métodos computacionales */
.metodo-tooltip {
    position: fixed;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    padding: 0;
    max-width: 400px;
    min-width: 300px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    border: 2px solid #2563eb;
}

.metodo-tooltip.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.metodo-tooltip-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(37, 99, 235, 0.05) 100%);
    border-bottom: 2px solid #2563eb;
    border-radius: 10px 10px 0 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.metodo-tooltip-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.metodo-tooltip-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e40af;
    font-family: 'Inter', sans-serif;
}

.metodo-tooltip-description {
    padding: 16px 20px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #374151;
    font-family: 'Inter', sans-serif;
}

.pdf-link-highlight {
    color: #4A90E2;
    font-weight: bold;
    text-decoration: underline;
    cursor: pointer;
    pointer-events: auto;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .metodo-tooltip {
        min-width: calc(100vw - 40px);
        max-width: calc(100vw - 40px);
        left: 20px !important;
        right: 20px !important;
        top: 50% !important;
        transform: translateY(-50%);
    }

    .metodo-tooltip.active {
        transform: translateY(-50%);
    }

    .metodo-tooltip-header h3 {
        font-size: 1rem;
    }

    .metodo-tooltip-description {
        font-size: 0.9rem;
        padding: 12px 16px;
    }
}

/* Sección de Conclusiones */
.conclusiones-section {
    width: 100%;
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.conclusiones-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 20px 0;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.conclusiones-header:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

.conclusiones-header.active {
    background-color: rgba(59, 130, 246, 0.1);
}

.conclusiones-header h2 {
    margin: 0 0 15px 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: #333333;
    text-align: center;
    font-family: 'Inter', sans-serif;
}

.conclusiones-line {
    width: 60%;
    height: 2px;
    background: #6b7280;
    margin-bottom: 10px;
    border-radius: 1px;
}

.conclusiones-icon {
    font-size: 1.2rem;
    color: #6b7280;
    transition: transform 0.3s ease;
    margin-top: 5px;
}

.conclusiones-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.conclusiones-content.active {
    max-height: 2000px;
}

.conclusiones-list {
    list-style: none;
    padding: 20px 0;
    margin: 0;
    counter-reset: conclusion-counter;
}

.conclusiones-list li {
    display: block;
    margin-bottom: 30px;
    padding: 15px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
    counter-increment: conclusion-counter;
}

.conclusiones-list li:hover {
    transform: translateX(5px);
}

.conclusiones-list li {
    position: relative;
    padding-left: 50px;
    padding-top: 0;
    display: flex;
    flex-direction: column;
}

.conclusiones-list li::before {
    content: counter(conclusion-counter);
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
    line-height: 35px;
}

.conclusion-text {
    font-size: 1rem;
    line-height: 35px;
    color: #374151;
    font-family: 'Inter', sans-serif;
    margin-bottom: 15px;
    margin-top: 0;
    padding-top: 0;
    min-height: 35px;
    display: block;
}

.conclusion-images {
    margin-top: 5px;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.conclusion-image {
    width: 280px;
    height: 200px;
    object-fit: contain;
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
    background-color: white;
}

.conclusion-image:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* Sección de Análisis en Proceso */
.analisis-proceso-section {
    width: 100%;
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
}

.analisis-proceso-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 20px 0;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.analisis-proceso-header:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

.analisis-proceso-header.active {
    background-color: rgba(59, 130, 246, 0.1);
}

.analisis-proceso-header h2 {
    margin: 0 0 15px 0;
    font-size: 2rem;
    font-weight: 900;
    color: #333333;
    text-align: center;
    font-family: 'Inter', sans-serif;
}

.analisis-proceso-line {
    width: 60%;
    height: 2px;
    background: #6b7280;
    margin-bottom: 10px;
    border-radius: 1px;
}

.analisis-proceso-icon {
    font-size: 1.2rem;
    color: #6b7280;
    transition: transform 0.3s ease;
    margin-top: 5px;
}

.analisis-proceso-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.analisis-proceso-content.active {
    max-height: 2000px;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .conclusiones-section {
        margin: 30px auto;
        padding: 0 15px;
    }

    .conclusiones-header h2 {
        font-size: 1.5rem;
    }

    .analisis-proceso-section {
        margin: 30px auto;
        padding: 0 15px;
    }

    .analisis-proceso-header h2 {
        font-size: 1.5rem;
    }

    .conclusiones-list li {
        display: block;
        margin-bottom: 25px;
        padding: 12px 0 12px 50px;
    }

    .conclusiones-list li::before {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }

    .conclusion-text {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }

    .conclusion-images {
        gap: 10px;
        margin-top: 6px;
    }

    .conclusion-image {
        width: 180px;
        height: 130px;
        object-fit: contain;
        border-radius: 0;
        background-color: white;
    }
}

/* Modal de contenido */
.content-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    padding: 20px;
}

.content-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.content-modal.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 20px;
    color: #333;
}

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

#modal-body {
    font-family: 'Inter', sans-serif;
}

#modal-body h2 {
    font-size: 2rem;
    font-weight: 900;
    color: #222;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

#modal-body p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 1.2rem;
}

#modal-body ul,
#modal-body ol {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 1.2rem;
    padding-left: 2rem;
}

#modal-body li {
    margin-bottom: 0.8rem;
}

#modal-body strong {
    font-weight: 700;
    color: #222;
}

#modal-body code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* Contenedor de cuadros de síntesis */
.summary-boxes-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 40px 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    overflow-y: auto;
}

.summary-boxes-container.active {
    opacity: 1;
    visibility: visible;
}

.summary-box {
    background: white;
    padding: 25px 35px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    text-align: center;
    max-width: 600px;
    width: 100%;
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    border-left: 4px solid #4A90E2;
}

.summary-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(74, 144, 226, 0.3);
    border-left-width: 6px;
}

/* Tooltip para TD, PD y FD */
.diversity-term {
    cursor: pointer;
}

.diversity-tooltip {
    position: fixed;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    padding: 0;
    max-width: 400px;
    z-index: 2000;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s, transform 0.3s;
    font-family: 'Inter', sans-serif;
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #4A90E2;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1) 0%, rgba(74, 144, 226, 0.05) 100%);
    border-radius: 12px 12px 0 0;
}

.tooltip-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 900;
    color: #222;
    font-family: 'Inter', sans-serif;
}

.tooltip-close {
    background: transparent;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    line-height: 1;
}

.tooltip-close:hover {
    background: #f0f0f0;
    color: #333;
    transform: rotate(90deg);
}

.diversity-tooltip p {
    padding: 20px 25px;
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #444;
    font-family: 'Inter', sans-serif;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .nav-icons-left,
    .nav-icons-right {
        display: none; /* Ocultar en móviles, se puede hacer un menú hamburguesa si quieres */
    }
    
    .modal-content {
        padding: 30px 20px;
        max-height: 90vh;
    }
    
    #modal-body h2 {
        font-size: 1.6rem;
    }
    
    #modal-body p {
        font-size: 1rem;
    }
    
    .summary-box {
        font-size: 1rem;
        padding: 20px 25px;
    }
    
    .diversity-tooltip {
        max-width: calc(100vw - 40px);
        left: 20px !important;
    }
    
    .tooltip-header h3 {
        font-size: 1.1rem;
    }
    
    .diversity-tooltip p {
        font-size: 1rem;
        padding: 15px 20px;
    }
    
    .conclusion-item h3 {
        font-size: 1.2rem;
    }
    
    .conclusion-item p {
        font-size: 1rem;
    }
    
    .code-accordion-header {
        padding: 15px;
    }
    
    .code-accordion-emoji {
        font-size: 2rem;
    }
    
    .code-accordion-title {
        font-size: 0.9rem;
    }
    
    .code-content pre {
        padding: 15px;
        font-size: 0.8rem;
    }
    
    .code-header h3 {
        font-size: 1.2rem;
    }
    
    .code-description {
        font-size: 1rem;
    }
}

/* Estilos para conclusiones */
.conclusion-item {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e0e0e0;
}

.conclusion-item:last-of-type {
    border-bottom: none;
}

.conclusion-item h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #4A90E2;
    margin-bottom: 0.8rem;
    font-family: 'Inter', sans-serif;
}

.conclusion-item p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    margin: 0;
}

/* Estilos para código del análisis */
/* Contenedor Grid para superponer elementos limpiamente */
.code-section-wrapper {
    display: grid;
    grid-template-columns: 1fr; /* Una sola columna */
    place-items: center; /* Centra todo el contenido vertical y horizontalmente */
    width: 90vw;
    max-width: 1400px;
    margin: 4rem auto;
    position: relative;
}

/* Ambos elementos ocupan la misma celda (Fila 1, Columna 1) para superponerse */
.code-computer-bg {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    max-width: 1000px;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    z-index: 1; /* Capa inferior */
}

.code-section-overlay {
    grid-column: 1;
    grid-row: 1;
    z-index: 2; /* Capa superior (Encima de la imagen) */
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative; /* Permite que el acordeón crezca */
    pointer-events: none;
}

.code-section-overlay > * {
    pointer-events: auto;
}

.code-toggle-btn {
    background: transparent;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    transition: all 0.3s ease;
    border-radius: 0;
    width: 100%;
    box-shadow: none;
}

.code-toggle-btn:hover {
    background: transparent;
    border: none;
    box-shadow: none;
}

.code-toggle-btn h2 {
    color: #222;
    transition: color 0.3s ease;
    font-size: clamp(2rem, 5vw, 4.5rem);
}

.code-toggle-btn:hover h2 {
    color: #4A90E2;
}

.code-toggle-icon {
    font-size: 1.5rem;
    color: #4A90E2;
    transition: transform 0.3s ease, color 0.3s ease;
}

.code-toggle-btn:hover .code-toggle-icon {
    color: #2a6bb8;
}

.code-toggle-btn.active .code-toggle-icon {
    transform: rotate(180deg);
}

.code-content-container {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    padding: 0;
    max-width: 1400px;
    width: 90vw;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s ease, opacity 0.5s ease, padding 0.5s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin: 2rem auto 0;
    position: relative;
}

/* Responsive para sección de código */
@media (max-width: 768px) {
    .code-section-wrapper {
        width: 95vw;
        margin: 2rem auto;
    }
    
    .code-computer-bg {
        max-width: 100%;
    }
    
    .code-content-container {
        width: 95vw;
    }
    
    .code-toggle-btn h2 {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }
}

.code-content-container.active {
    max-height: 10000px;
    opacity: 1;
    padding: 2rem;
    margin-top: 2rem;
}

.code-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.code-tab {
    padding: 15px 25px;
    background: #f0f0f0;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    transition: all 0.3s ease;
}

.code-tab:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.code-tab.active {
    background: #4A90E2;
    color: white;
    border-color: #4A90E2;
}

.code-content {
    display: none;
    animation: fadeIn 0.3s ease;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.3s ease;
    width: 100%;
    max-width: 100%;
}

.code-content.active {
    display: block;
    max-height: 10000px;
    padding-top: 20px;
}

/* Estilos para acordeón de código */
.code-accordion {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 20px;
    width: 100%;
    max-width: 1400px;
}

.code-accordion-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 0;
    margin-top: -2px;
    width: 100%;
    max-width: 100%;
}

.code-accordion-item:first-child {
    margin-top: 0;
    border-radius: 8px 8px 0 0;
}

.code-accordion-item:last-child {
    border-radius: 0 0 8px 8px;
}

.code-accordion-item:only-child {
    border-radius: 8px;
}

.code-accordion-item:hover {
    border-color: #4A90E2;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.1);
    z-index: 1;
    position: relative;
}

.code-accordion-item.active {
    border-color: #4A90E2;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.2);
    z-index: 1;
    position: relative;
}

.code-accordion-header {
    width: 100%;
    padding: 15px 20px;
    background: #f9f9f9;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    text-align: center;
}

.code-accordion-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex: 1;
}

.code-accordion-emoji {
    font-size: 2rem;
    line-height: 1;
    display: block;
}

.code-accordion-title {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    display: block;
}

.code-accordion-item:first-child .code-accordion-header {
    border-radius: 8px 8px 0 0;
}

.code-accordion-item:last-child .code-accordion-header {
    border-radius: 0 0 8px 8px;
}

.code-accordion-item:only-child .code-accordion-header {
    border-radius: 8px;
}

.code-accordion-header:hover {
    background: #f0f0f0;
}

.code-accordion-header:hover .code-accordion-title {
    color: #4A90E2;
}

.code-accordion-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    color: #4A90E2;
}

.code-accordion-item.active .code-accordion-header {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1) 0%, rgba(74, 144, 226, 0.05) 100%);
}

.code-accordion-item.active .code-accordion-title {
    color: #4A90E2;
}

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

.code-header {
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1) 0%, rgba(74, 144, 226, 0.05) 100%);
    border-radius: 8px;
    border-left: 4px solid #4A90E2;
}

.code-header h3 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    font-weight: 900;
    color: #222;
    font-family: 'Inter', sans-serif;
}

.code-description {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #555;
    font-family: 'Inter', sans-serif;
}

.code-content pre {
    background: #2d2d2d;
    border-radius: 8px;
    padding: 25px;
    overflow-x: auto;
    margin: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.code-content code {
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #f8f8f2;
}

.code-content pre code {
    display: block;
    white-space: pre;
}

/* Syntax highlighting básico para R */
.code-content code.language-r .token.comment {
    color: #6a9955;
    font-style: italic;
}

.code-content code.language-r .token.string {
    color: #ce9178;
}

.code-content code.language-r .token.keyword {
    color: #c586c0;
    font-weight: bold;
}

.code-content code.language-r .token.function {
    color: #dcdcaa;
}

.code-content code.language-r .token.number {
    color: #b5cea8;
}

.code-content code.language-r .token.operator {
    color: #d4d4d4;
}

.conclusion-graph-container {
    margin: 3rem 0;
    padding: 2rem;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px dashed #4A90E2;
    text-align: center;
}

.conclusion-graph-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.graph-placeholder {
    color: #666;
    font-style: italic;
    margin: 0;
}