/* ======================================
   GENERAL & RESET
   ====================================== */
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100vh;
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #ffffff; /* Fondo de la página blanco fuera de las secciones */
    color: #1a1a1a;
    display: flex;
    flex-direction: column;
}

/* ======================================
   HEADER
   ====================================== */
header {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1px 10px;
    flex: 0 0 auto;
    width: 100%;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px 10px;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 6px;
}

.logo-deco {
    color: #ff6000;
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.8rem;
}

.logo-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.8rem;
    font-weight: 700;
}

.header-left { flex: 1; }
.header-left h1 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.3rem;
    font-weight: 500;
    letter-spacing: -0.5px;
    margin: 0;
}

.header-right {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

header p {
    max-width: 700px;
    line-height: 1.4;
    margin-bottom: 10px;
    color: #333;
    font-size: 0.95rem;
    text-align: justify;
}

header blockquote {
    font-style: italic;
    color: #666;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

/* Seleccionamos el enlace que envuelve al logo */
a:has(.logo), 
.logo-link { 
    text-decoration: none; 
    color: inherit; 
    display: inline-block; /* mantener formato */
}

/* Evita cambio de color */
a:has(.logo):visited,
.logo-link:visited {
    color: inherit;
}



/* ====================================== 
   BARRA DE NAVEGACIÓN
   ====================================== */
#main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 15px;
    margin-top: 2px; 
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

#main-nav ul {
    display: flex;
    gap: 40px;
    list-style: none;
}

#main-nav a {
    text-decoration: none;
    color: #1a1a1a;
    font-weight: bold;
    transition: all 0.3s ease;
    padding: 4px 8px; /* Añadimos espacio interno para el efecto de fondo */
    
}

#main-nav a:hover { color: #ff6000; }

#main-nav a.active-link {
    color: #ff6000;
    border-bottom: 1px solid #ff6000;
    border-radius: 0 !important;
    transition: none !important;
}

#lang-btn {
    padding: 5px 10px;
    cursor: pointer;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    background-color: #ddd;
    transition: background-color 0.3s ease;
}

/* =======================================
   MAIN & SECCIONES (Fondo crema centrado)
   ======================================= */
main {
    flex: 1 1 auto;
    overflow-y: auto;
    background-color: #ffffff; 
}

.section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 5px 20px 40px 20px; 
    display: none; 
    flex-direction: column;
    background-color: #fff8f0; /* Fondo crema solo dentro de la caja */
    font-family: 'JetBrains Mono', monospace;
    min-height: 99.6%;
}

.section h2 {
    margin-top: 2px; 
    margin-bottom: 15px;
    font-size: 1.8rem;
    border-bottom: 2px solid #ff6000;
    width: fit-content;
    padding-bottom: 5px;
}

.section p {
    line-height: 1.6;
    font-size: 0.9rem;
    color: #1a1a1a;
    margin-bottom: 20px;
}

/* ================================
   UFCD - DISEÑO MINIMALISTA
   ================================ */
.materias-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin: 1px 0 1px 0;
}

.materia-col h4 {
    font-size: 0.75rem;
    color: #ff6000;
    text-transform: uppercase;
    margin-bottom: 2px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 2px;
}

.materia-tags {
    display: flex;
    flex-wrap: wrap;
    column-gap: 18px; 
    row-gap: 2px; 
    margin-top: 1px;
}

.materia-tags span {
    position: relative;
    cursor: pointer;
    background-color: transparent; /* Sin fondo negro */
    color: #1a1a1a; /* Color de texto normal */
    padding: 2px 0;
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.3s ease;
    display: inline-block;
}

/* La línea naranja que aparece al pasar el ratón */
.materia-tags span::before {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #ff6000;
    transition: width 0.3s ease;
}

.materia-tags span:hover {
    color: #ff6000;
}

.materia-tags span:hover::before {
    width: 100%;
}

/* Globo de información (Tooltip) */
.materia-tags span::after {
    content: attr(data-info);
    position: absolute;
    bottom: 160%; 
    left: 50%;
    transform: translateX(-50%);
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.materia-tags span:hover::after {
    opacity: 1;
    visibility: visible;
}
/* =======================
UFCDs
========================== */
#ufcd-detalle-container {
    margin-top: 5px;
    padding: 15px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-left: 5px solid #ff6000; /* Línea naranja de acento */
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    font-family: 'JetBrains Mono', monospace; /* Manteniendo tu estilo técnico */
    
}

#ufcd-detalle-container.hidden { 
    
    display: none; }

.detalle-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

#det-titulo { color: #ff6000; font-size: 1.2rem; margin: 0; }
#det-stats { color: #888; font-size: 0.85rem; }

.det-seccion h4 {
    color: #333;
    font-size: 0.8rem;
    text-transform: uppercase;
    margin: 20px 0 8px 0;
    letter-spacing: 1px;
}

.det-seccion p {
    color: #555;
    line-height: 1.6;
    font-size: 0.85rem;
    text-align: justify;
    margin: 0;
}

#det-links { margin-top: 10px; display: flex; gap: 10px; flex-wrap: wrap; }

#det-links a {
    text-decoration: none;
    color: #ff6000;
    border: 1px solid #ff6000;
    padding: 5px 12px;
    font-size: 0.8rem;
    border-radius: 3px;
    transition: 0.3s;
}

#det-links a:hover {
    background-color: #ff6000;
    color: white;
}


/* =================
   FOOTER
   ================= */
footer {
    flex: 0 0 auto;
    /* Limitamos el ancho para que coincida con las secciones */
    max-width: 1100px;
    width: 100%;
    /* Lo centramos horizontalmente */
    margin: 0 auto; 
    
    padding: 10px 20px;
    background-color: #f9f9f9;
    text-align: center;
    
}

#footer-p {
    font-size: 0.95rem;
    color: #333;
}

.footer-deco { color: #ff6000; font-family: 'JetBrains Mono', monospace; }
.footer-text { color: #333; font-family: 'JetBrains Mono', monospace; }

/* =======================================
   UTILIDADES & ESTADOS
   ======================================= */
.activa { display: flex !important; }
.hidden { display: none !important; }

#quote-text { font-style: italic; }
#quote-author {
    font-weight: 600;
    color: #555;
    margin-left: 8px;
    font-size: 0.9em;
}

/* ======================================
   VISOR OVERLAY - ESTILO MINIMALISTA
   ====================================== */
.viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.viewer-overlay.activa-visor {
    display: flex;
}

.viewer-box {
    width: 85%;
    height: 80vh;
    max-width: 1200px;
    background: #fff8f0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border-radius: 0px;
    overflow: hidden;
}

/* BARRA DE TÍTULO - ULTRADELGADA Y MINIMALISTA */
.viewer-header {
    padding: 6px 12px;
    background: #fff8f0;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 32px;
}

/* Nombre del archivo a la izquierda - pequeño y discreto */
#viewer-filename {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #888;
    letter-spacing: 0.3px;
}

/* Botón cerrar estilo línea de código */
.btn-cerrar-visor {
    background: none;
    border: none;
    color: #ff6000;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.7rem;
    padding: 2px 8px;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-cerrar-visor:hover {
    background-color: #ff600010;
}

/* Quitar el logo-deco dentro del botón si existe */
.btn-cerrar-visor .logo-deco {
    font-size: 0.7rem;
    color: #ff6000;
}

/* IFRAME - sin bordes */
#viewer-iframe {
    flex: 1;
    border: none;
    width: 100%;
    background: #f5f5f0;
}

/* Scroll bloqueado cuando el visor está abierto */
body.no-scroll {
    overflow: hidden;
}

/* ======================================
   VERSIÓN MÓVIL
   ====================================== */
@media (max-width: 768px) {
    .viewer-box {
        width: 95%;
        height: 85vh;
    }
    
    .viewer-header {
        padding: 4px 10px;
        min-height: 28px;
    }
    
    #viewer-filename {
        font-size: 0.6rem;
    }
    
    .btn-cerrar-visor {
        font-size: 0.6rem;
        padding: 2px 6px;
    }
}

/* ======================================
   ESPECÍFICOS: SECCIÓN CONTACTO (V8 CORREGIDO)
   ====================================== */
#contact-section.section {
    
    justify-content: flex-start;
}


.v8-grid {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr; /* Damos más peso a la izquierda (la frase) */
    gap: 80px;
    align-items: start;
    margin-top: 40px;
    width: 100%;
}

.v8-quote {
    
    font-size: 1.8rem !important; /* Aumentado para recuperar el impacto */
    font-weight: 200 ;
    line-height: 1.1;
    color: #1a1a1a;
    margin: 0 !important;
    max-width: 600px;
}

.v8-highlight {
    color: #ff6000;
    font-style: italic;
    font-weight: 500;
}

.v8-divider {
    height: 1px;
    width: 80px;
    background-color: #ff6000; /* Naranja para que combine con tu marca */
    margin-top: 35px;
}

.v8-contact-list {
    display: flex;
    flex-direction: column;
    gap: 45px;
    padding-top: 10px;
}

.v8-item-label {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: #999;
    letter-spacing: 2px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.v8-item-value {
    font-size: 1.4rem;
    font-weight: 700;
    text-decoration: none;
    color: #1a1a1a;
    transition: all 0.3s ease;
}

.v8-item-value:hover {
    color: #ff6000;
    padding-left: 5px;
}

.v8-social-links {
    display: flex;
    gap: 25px;
}

.v8-social-link {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    text-decoration: none;
    color: #1a1a1a;
    border-bottom: 1px solid #ddd;
    padding-bottom: 4px;
    transition: all 0.3s ease;
}

.v8-social-link:hover {
    color: #ff6000;
    border-color: #ff6000;
}

.mono-text-detail {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
}

/* ======================================
   HOME - IMAGEM E SKILLS
   ====================================== */

.home-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 40px;
    align-items: start;
    margin-top: 15px;
}

/* Coluna da imagem */
.home-image-col {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.profile-image-container {
    width: 240px;
    height: 240px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #ff6000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
    background-color: #f0ede8;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Caso não tenha imagem ainda, um placeholder */
.profile-image-container:has(img[src=""])::after {
    content: "📸";
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    width: 100%;
    height: 100%;
    background: #f0ede8;
    color: #ccc;
}

/* Coluna do conteúdo */
.home-content-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.home-content-col #home-description {
    margin-bottom: 0;
    font-size: 0.95rem;
    line-height: 1.7;
    text-align: justify;
}

/* Seção de Skills */
.skills-section {
    margin-top: 5px;
}

.skills-title {
    font-size: 0.85rem;
    color: #ff6000;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    border-bottom: 1px solid #e8e4df;
    padding-bottom: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}

.skills-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skill-category {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.skill-label {
    font-size: 0.65rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.skill-tag {
    background-color: #f5f2ed;
    color: #444;
    padding: 3px 14px;
    border-radius: 2px;
    font-size: 0.72rem;
    font-family: 'JetBrains Mono', monospace;
    border: 1px solid #e8e4df;
    transition: all 0.25s ease;
    letter-spacing: 0.3px;
}

.skill-tag:hover {
    background-color: #ff6000;
    color: #fff;
    border-color: #ff6000;
    transform: translateY(-1px);
}

/* ======================================
   RESPONSIVIDADE
   ====================================== */

@media (max-width: 820px) {
    .home-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .profile-image-container {
        width: 180px;
        height: 180px;
    }
    
    .home-image-col {
        justify-content: center;
    }
    
    .skill-tags {
        gap: 4px;
    }
    
    .skill-tag {
        font-size: 0.68rem;
        padding: 2px 10px;
    }
    
    .skills-grid {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .profile-image-container {
        width: 150px;
        height: 150px;
    }
    
    .skill-tag {
        font-size: 0.6rem;
        padding: 2px 8px;
    }
}

/* Ajuste para tablets y móviles */
@media (max-width: 900px) {
    .v8-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }
    .v8-quote {
        font-size: 2rem !important;
    }
}

/* ====================================================
   AJUSTES PARA DISPOSITIVOS MÓVILES (PANTALLAS PEQUEÑAS)
   ==================================================== */
@media (max-width: 768px) {
    /* 1. Cambia el menú de las UFCD y detalles a formato vertical */
    .tech-container {
        flex-direction: column;
        gap: 25px;
    }

    /* 2. Hace que tanto la lista como el detalle ocupen todo el ancho disponible */
    .materia-sidebar, .ufcd-detalle {
        flex: none;
        width: 100%;
    }

    /* 3. Ajusta el encabezado (logo y descripción) para que no se amontone */
    .header-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }

    /* 4. Centra los enlaces del menú de navegación */
    #main-nav ul {
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
    }
}
/* ======================================
   SECCIÓN PROYECTOS (ESTILO MINIMALISTA)
   ====================================== */
.projects-grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 15px;
    width: 100%;
}

.custom-project-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-left: 5px solid #ff6000; /* Línea de acento naranja idéntica a tus UFCD */
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.custom-project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.05);
}

.project-card-header h3 {
    color: #ff6000;
    font-size: 1.15rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.project-card-header p {
    color: #555;
    font-size: 0.85rem;
    line-height: 1.5;
    text-align: justify;
    margin-top: 10px;
    margin-bottom: 15px;
}

.project-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
}

.project-card-tag {
    background-color: #f5f2ed;
    color: #444;
    padding: 2px 10px;
    border-radius: 2px;
    font-size: 0.7rem;
    border: 1px solid #e8e4df;
}

.project-card-actions {
    display: flex;
    gap: 12px;
}

/* Reutilizando tu estilo existente de botones de evidencia */
.project-card-actions a {
    text-decoration: none;
    color: #ff6000;
    border: 1px solid #ff6000;
    padding: 5px 14px;
    font-size: 0.8rem;
    border-radius: 3px;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.project-card-actions a:hover {
    background-color: #ff6000;
    color: white;
}