@charset "utf-8";

:root {
    --primary-color: #8C1C13;
    --secondary-color: #BF4342;
    --tertiary-color: #E7D7C1;
    --quaternary-color: #A78A7F;
    --quinary-color: #735751;
    --footer-bg-color: #4A3531;

    /* Tamaños de fuente */
    --font-size-h1: 2rem;
    --font-size-h2: 1.5rem;
    --font-size-h3: 1.25rem;
    --font-size-h4: 1.125rem;
    --font-size-h5: 1rem;
    --font-size-h6: 0.875rem;
    --font-size-p: 0.875rem;
    --font-size-small: 0.75rem;

    /* Colores de texto */
    --text-color-primary: var(--tertiary-color);
    --text-color-secondary: var(--quinary-color);

    /* Ancho del contenido */
    --contenedor-ancho: 1200px;

    /* Familia de fuentes */
    --font-family: "Open Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

/* ============================================================================================
   Flexbox: Aplicado en .curso-info, .skill-card, .logo-item, .barrapie y .social-compact, 
   manejando la distribución del eje vertical/horizontal (flex-direction: column, align-items: 
   center, margin-top: auto), asegurando la nivelación de botones "Ver más" sin importar 
   el largo de texto.
   ============================================================================================ */

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

body {
    background: var(--tertiary-color) url('../img/fondo/fondo1.jpg') no-repeat center center fixed;
    background-size: cover;
    font-family: var(--font-family);
    margin: 0 auto;
    width: 100%;
    padding-top: 70px;
}

/* Barra de navegación */
.navbar-custom {
    background: var(--primary-color);
    padding: 12px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-logo {
    width: 40px;
    height: 40px;
    transition: transform 0.5s ease;
}

.navbar-logo:hover {
    transform: scale(1.1);
}

.nav-link {
    font-size: var(--font-size-p);
    color: var(--tertiary-color) !important;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--secondary-color) !important;
}

/* Botón Ingresar */
.btn-ingresar {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: var(--tertiary-color);
    border: none;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: var(--font-size-p);
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(255, 255, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    outline: none;
}

.btn-ingresar:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 255, 255, 0.2), 0 2px 6px rgba(0, 0, 0, 0.12);
}

.btn-ingresar:active {
    transform: translateY(0);
    box-shadow: 0 3px 6px rgba(255, 255, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
}

@media (max-width: 991.98px) {
    .navbar-nav { margin-top: 10px; }
    .nav-item { margin: 5px 0; }
    .btn-ingresar { margin-top: 10px; }
}

/* Habilita el scroll suave en toda la página con margen para la barra fija */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

/* Contenedor principal */
.contenedor-principal {
    width: 100%;
    max-width: var(--contenedor-ancho);
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Carrusel */
#carouselExampleIndicators .carousel-item img {
    height: 50vh;
    width: 100%;
    object-fit: cover;
}

.carousel-item {
    position: relative;
}

.carousel-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

#tituloprincipal {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-color-primary);
    font-size: var(--font-size-h1);
    text-align: center;
    z-index: 2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    width: 100%;
    padding: 0 20px;
}

/* Perfil */
.profile-container {
    position: absolute;
    bottom: -75px;
    left: 20px;
    z-index: 10;
}

.profile-img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border: 4px solid var(--tertiary-color);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Secciones Generales */
.seccion-contenedor {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.seccion-contenedor.visible {
    opacity: 1;
    transform: translateY(0);
}

.informacion-personal {
    margin-top: 100px;
}

.presentacion-personal {
    color: var(--quinary-color);
}

.presentacion-personal .subtitle {
    font-size: var(--font-size-h3);
    margin-bottom: 15px;
}

.presentacion-personal p {
    font-size: var(--font-size-p);
    margin-bottom: 10px;
}

.presentacion-personal i {
    margin-right: 10px;
    color: var(--secondary-color);
}

/* Logos institucionales */
.logos-institucionales {
    color: var(--quinary-color);
}

.logo-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.logo-item img {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.logo-item img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.logo-item p {
    font-size: var(--font-size-p);
    color: var(--quinary-color);
    margin-bottom: 0;
}

/* Tipografía dinámica basada en variables nativas */
h1 { font-size: var(--font-size-h1); color: var(--text-color-primary); }
h2 { font-size: var(--font-size-h2); color: var(--text-color-primary); }
h3 { font-size: var(--font-size-h3); color: var(--text-color-primary); }
h4 { font-size: var(--font-size-h4); color: var(--text-color-primary); }
h5 { font-size: var(--font-size-h5); color: var(--text-color-primary); }
h6 { font-size: var(--font-size-h6); color: var(--text-color-primary); }
p { font-size: var(--font-size-p); color: var(--text-color-secondary); line-height: 1.6; margin-bottom: 1rem; }
small { font-size: var(--font-size-small); color: var(--text-color-secondary); }

/* Sección Acerca de */
.seccion-contenedor .row {
    align-items: stretch;
}

.seccion-contenedor .col-md-4 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 15px;
}

.seccion-contenedor .col-md-4.text-left {
    text-align: left;
}

.seccion-contenedor .col-md-4 img {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

/* Tarjetas Generales (Experiencia y Educación) */
.card {
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.card-img-top {
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    height: 180px;
    object-fit: cover;
}

.card-body {
    padding: 20px;
}

.card-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

/* =======================================================================================
   Grid Layout: Aplicado en .skills-grid y #cursos .cursos-grid con grid-template-columns: 
   repeat(auto-fit, minmax(250px, 1fr)) y gap: 20px, 
   garantizando reordenamiento multitamaño y alineación fluida.
   ======================================================================================= */

/* Grillas Habilidades */
.skills-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 576px) { .skills-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 577px) and (max-width: 992px) { .skills-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 993px) { .skills-grid { grid-template-columns: repeat(4, 1fr); } }

.skill-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.skill-card img {
    width: 60px;
    height: 60px;
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.skill-card img:hover {
    transform: scale(1.1);
}

.skill-card span {
    font-size: 0.9rem;
    color: var(--quinary-color);
    text-align: center;
}

/* Cursos */
#cursos .cursos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

#cursos .curso-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    padding: 20px 15px; /* Más balance interno */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%; /* Forzamos a que todas las tarjetas de la fila midan lo mismo */
}

#cursos .curso-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

#cursos .curso-logo {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
    flex-shrink: 0; /* Evita que el logo se deforme */
}

#cursos .curso-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

/* Flexbox vertical para balancear la info */
#cursos .curso-info {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1; /* Permite que este bloque ocupe todo el espacio disponible */
}

#cursos .curso-info h5 {
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: var(--primary-color);
    min-height: 2.8rem; /* Reserva espacio para 2 líneas, así los títulos no desalinean */
    display: flex;
    align-items: center;
    justify-content: center;
}

#cursos .curso-info p {
    font-size: 0.8rem;
    margin-bottom: 15px;
    color: var(--quinary-color);
}

#cursos .btn-ver-mas {
    margin-top: auto; 
}

/* Pestañas generales */
.nav-tabs::-webkit-scrollbar {
    display: none;
}

.nav-tabs {
    margin-bottom: 20px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.nav-tabs .nav-link {
    font-size: 0.9rem;
    color: var(--quinary-color);
    border: 1px solid transparent;
    border-radius: 5px 5px 0 0;
    padding: 10px 15px;
    white-space: nowrap;
}

.nav-tabs .nav-link.active, .nav-tabs .nav-link:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Botón Ver Más */
.btn-ver-mas {
    background-color: var(--primary-color);
    color: var(--tertiary-color);
    border: none;
    border-radius: 5px;
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    transition: all 0.3s ease;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

@media (max-width: 768px) {
    #cursos .cursos-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
    .nav-tabs .nav-link { font-size: 0.8rem; padding: 8px 12px; }
}

/* Footer */
#fondopie {
    background: var(--footer-bg-color);
    width: 100%;
    padding: 30px 0 20px 0;
    color: var(--tertiary-color);
    margin-top: 60px;
}

.barrapie {
    width: 100%;
    max-width: var(--contenedor-ancho);
    margin: 0 auto;
    padding: 0 20px;
}

.footer-brand {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--tertiary-color);
    letter-spacing: 0.5px;
}

.footer-tagline {
    font-size: 0.85rem;
    color: var(--quaternary-color);
}

.social-compact {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
}

@media (min-width: 768px) {
    .social-compact {
        justify-content: flex-end;
    }
}

.social-compact li {
    margin: 0 12px;
}

.social-compact i {
    font-size: 24px;
    color: var(--tertiary-color);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.3s ease;
}

.social-compact i:hover {
    color: var(--secondary-color);
    transform: translateY(-4px) scale(1.15);
}

.footer-divider {
    border-top: 1px solid rgba(231, 215, 193, 0.15);
    margin: 15px 0;
    opacity: 1;
}

.copyright {
    color: var(--quaternary-color) !important;
    font-size: var(--font-size-small);
    letter-spacing: 0.3px;
}

.bg-primary-custom {
    background-color: var(--primary-color);
    color: var(--tertiary-color);
    border-radius: 5px;
    padding-left: 1rem !important;
}

/* Logo profesional */
.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.navbar-logo-icon {
    font-size: 1.35rem;
    color: var(--tertiary-color);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.3s ease;
}

.navbar-brand:hover .navbar-logo-icon {
    transform: rotate(15deg) scale(1.1);
    color: var(--secondary-color);
}

.logo-texto {
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.5px;
    color: var(--tertiary-color);
}

.punto-tech {
    color: var(--secondary-color);
}

.cursor-terminal {
    color: var(--secondary-color);
    font-weight: 400;
    animation: parpadeoCursor 1s infinite;
}

@keyframes parpadeoCursor {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}