/* ==========================================================================
   LOGISTICS CONTROL TOWER - MAIN STYLESHEET
   Author: LCT Team
   Version: 2.0
   ========================================================================== */

/* ==========================================================================
   1. VARIABLES CSS Y CONFIGURACIÓN BASE
   ========================================================================== */
:root {
    /* Colores principales */
    --color-primario: #001f54;
    --color-secundario: #033997;
    --color-tercero: #1c3d77ec;
    --color-gris-oscuro: #333333;
    --color-gris-claro: #f8f9fa;
    
    /* Tipografía - Jerarquía Profesional */
    --font-serif: 'Computer Modern Serif', 'Georgia', 'Times New Roman', serif;
    --font-sans: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Transiciones */
    --transicion-base: all 0.3s ease;
    --transicion-lenta: all 0.4s ease-in-out;
    
    /* Sombras */
    --sombra-suave: 0 2px 4px rgba(0, 0, 0, 0.1);
    --sombra-media: 0 4px 12px rgba(0, 0, 0, 0.1);
    --sombra-elevada: 0 10px 20px rgba(0, 0, 0, 0.15);
    
    /* Espaciado */
    --espaciado-xs: 0.5rem;
    --espaciado-sm: 1rem;
    --espaciado-md: 2rem;
    --espaciado-lg: 3rem;
}

/* ==========================================================================
   2. ESTILOS BASE Y RESET
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    padding-top: 40px;
    color: var(--color-gris-oscuro);
    background-color: #ffffff;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   JERARQUÍA TIPOGRÁFICA PROFESIONAL
   ========================================================================== */

/* Títulos principales - Serif para elegancia y autoridad */
h1, h2, 
.h1, .h2,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-family: var(--font-serif);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--color-primario);
}

/* Subtítulos - Serif más ligero para jerarquía clara */
h3, h4, h5, h6,
.h3, .h4, .h5, .h6 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--color-gris-oscuro);
}

/* Tamaños específicos para mejor control */
h1, .h1 { font-size: 2.5rem; }
h2, .h2 { font-size: 2rem; }
h3, .h3 { font-size: 1.75rem; }
h4, .h4 { font-size: 1.5rem; }
h5, .h5 { font-size: 1.25rem; }
h6, .h6 { font-size: 1rem; }

/* Texto del cuerpo y párrafos - Sans-serif para legibilidad */
p, .lead, .text-muted {
    font-family: var(--font-sans);
}

/* Títulos de cards - Serif para consistencia */
.card-title {
    font-family: var(--font-serif);
    font-weight: 600;
}

/* Brand title mantiene su estilo */
.brand-title {
    font-family: var(--font-sans);
    font-weight: 700;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   3. NAVEGACIÓN (NAVBAR)
   ========================================================================== */
.navbar {
    background-color: transparent;
    border-bottom: none;
    box-shadow: none;
    transition: background-color 0.4s ease, padding 0.4s ease, box-shadow 0.4s ease;
    padding: 0.2rem 0;
}

.navbar .brand-title,
.navbar .nav-link {
    color: #ffffff;  /* ← blanco al inicio */
    transition: color 0.3s ease;
}

/* Navbar con scroll */
.navbar.scrolled {
    background-color: #ffffff;
    border-bottom: 2px solid var(--color-gris-claro);
    box-shadow: var(--sombra-suave);
}

.navbar.scrolled .brand-title {
    color: var(--color-primario);
}

.navbar.scrolled .nav-link {
    color: var(--color-gris-oscuro);
}

.navbar.scrolled .nav-link i {
    color: var(--color-primario);
}

/* Negro suave al hacer scroll en icono menu mobil */
.navbar.scrolled .navbar-toggler-icon {
    filter: invert(0.9); 
    transition: filter 0.3s ease;
}
/* Links del navbar */
.navbar-light .navbar-nav .nav-link {
    color: var(--color-gris-oscuro);
    font-weight: 500;
    transition: var(--transicion-base);
    padding: 0.5rem 1rem;
}

.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .nav-link:focus,
.navbar-brand:hover,
.navbar-brand:focus {
    color: var(--color-secundario);
}

.navbar-light .navbar-nav .nav-link.active {
    color: var(--color-primario);
}

/* Logo */
.brand-title {
    font-size: 1.1rem;
    color: var(--color-primario);
    white-space: nowrap;
    font-weight: 700;
}

.brand-subtitle {
    font-size: 1rem;
    color: #adb9c7;
    font-weight: 400;
}

.logo-img {
    transition: var(--transicion-base);
}

.navbar-brand:hover .logo-img {
    transform: scale(1.05);
}

/* Dropdown menu */
.dropdown-menu {
    border: none;
    box-shadow: var(--sombra-media);
    border-radius: 8px;
    margin-top: 0.5rem;
}

.dropdown-item {
    padding: 0.75rem 1.25rem;
    transition: var(--transicion-base);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: #f8f9fa;
    color: var(--color-secundario);
}

/* ==========================================================================
   4. SECCIÓN HERO (PRINCIPAL) - SIN OVERLAY
   ========================================================================== */
.hero-section {
    min-height: 100vh;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    margin-top: -40px;
    position: relative;
    animation: cambioFondo 39s infinite;
}

/* ELIMINADO: gradient overlay que oscurecía las imágenes */
/* Las imágenes ahora se muestran claramente sin filtro oscuro */
.hero-title {
    color: #ffffff;
    text-shadow: 
        2px 2px 10px rgba(0, 0, 0, 0.9),
        0 0 20px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(0, 0, 0, 0.6);
    font-weight: 800;
    font-family: var(--font-serif);
    letter-spacing: -0.02em;
}

.hero-text {
    color: #ffffff;
    text-shadow: 
        1px 1px 8px rgba(0, 0, 0, 0.9),
        0 0 15px rgba(0, 0, 0, 0.7);
    font-family: var(--font-sans);
}
/* Clase blur en hero */
/* .hero-text-box {
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 2rem 2.5rem;
    display: inline-block;
    width: 100%;
} */
/* Contenedor del efecto typewriter */
.typewriter-container {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#typewriter-text {
    color: #ffffff;
    text-shadow: 
        1px 1px 8px rgba(0, 0, 0, 0.9),
        0 0 15px rgba(0, 0, 0, 0.7);
}

/* También el cursor */
.cursor {
    font-weight: bold;
    color: #ffffff;
    animation: blink 0.7s infinite;
    text-shadow: 
        1px 1px 8px rgba(0, 0, 0, 0.9),
        0 0 15px rgba(0, 0, 0, 0.7);
}

/* ==========================================================================
   5. BOTONES
   ========================================================================== */
.btn {
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: var(--transicion-base);
    border: none;
}

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

.btn-primary-custom:hover,
.btn-primary-custom:focus {
    background-color: var(--color-primario);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    color: var(--color-primario);
    background-color: #ffffff;
    border-color: var(--color-primario);
    box-shadow: 0 0 30px rgba(0, 31, 84, 0.3);
    transform: translateY(-2px);
}

/* Botón volver arriba */
#btn-back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    z-index: 1000;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--color-primario);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: var(--transicion-lenta);
    opacity: 0.8;
    cursor: pointer;
}

#btn-back-to-top:hover,
#btn-back-to-top:focus {
    opacity: 1;
    transform: translateY(-5px);
    box-shadow: 0 0 15px rgba(0, 31, 84, 0.5);
}

#btn-back-to-top.fade-in {
    animation: fadeIn 0.5s;
}

/* ==========================================================================
   6. CARDS Y COMPONENTES
   ========================================================================== */
.card {
    border: none;
    transition: var(--transicion-base);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--sombra-elevada);
}

.text-primary {
    color: var(--color-primario) !important;
}

.shadow-inner {
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   7. FLIP CARDS (¿Por qué elegir LCT?)
   ========================================================================== */
.flip-card {
    background-color: transparent;
    height: 250px;
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* ==========================================================================
   8. SERVICIOS (CARDS CON OVERLAY)
   ========================================================================== */
.service-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--sombra-elevada);
}

.service-card img {
    height: 140px;
    object-fit: cover;
    filter: grayscale(30%);
    transition: transform 0.4s ease, filter 0.3s ease;
}

.service-card:hover img {
    filter: grayscale(0%);
    transform: scale(1.1);
}

.service-image-container {
    overflow: hidden;
    position: relative;
}

.service-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 31, 84, 0.9);
    opacity: 0;
    transition: all 0.4s ease-in-out;
    transform: translateY(10px);
}

.service-card:hover .service-overlay {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   9. PARTNERS Y MARQUEE
   ========================================================================== */
.partner-static img {
    height: 50px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
    display: block;
    margin: 0 auto;  
}

.partner-static:hover img {
    transform: scale(1.1);
}

.marquee-text {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    padding: 20px 0;
    background: rgba(0, 31, 84, 0.03);
    border-radius: 50px;
    display: flex;
}

.marquee-text-content {
    display: inline-block;
    white-space: nowrap;
    animation: scroll-text 60s linear infinite;
}

.marquee-text:hover .marquee-text-content {
    animation-play-state: paused;
}

.client-name {
    font-size: 1rem;
    font-weight: 500;
    color: #495057;
    margin: 0 15px;
    display: inline-block;
}

.client-divider {
    color: var(--color-primario);
    font-weight: bold;
    opacity: 0.3;
}

/* ==========================================================================
   10. FOOTER
   ========================================================================== */
footer {
    background-color: #001233;
    color: #ffffff;
}

footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: var(--transicion-base);
}

footer a:hover,
footer a:focus {
    color: #ffffff;
}

.footer-link-icon {
    transition: var(--transicion-base);
    opacity: 0.7;
}

.footer-link-icon:hover,
.footer-link-icon:focus {
    opacity: 1;
    transform: translateY(-2px);
    color: #ffffff;
}

.footer-nav-link {
    color: rgba(255, 255, 255, 0.897);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transicion-base);
}

.footer-nav-link:hover,
.footer-nav-link:focus {
    color: #ffffff;
    padding-left: 5px;
}

/* ==========================================================================
   11. ANIMACIONES
   ========================================================================== */
@keyframes blink {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 0.8;
    }
}

@keyframes scroll-text {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Cambio de fondos HERO - SIN GRADIENTES OSCUROS */
/* Hero layers para crossfade sin flash */
.hero-section {
    min-height: 100vh;
    margin-top: -40px;
    position: relative;
    /* ELIMINAR: animation: cambioFondo ... */
}

.hero-bg-layer {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;  /* crossfade suave */
    z-index: 0;
}

.hero-bg-layer.active {
    opacity: 1;
}

/* Precargar imágenes (fuera de pantalla) */
body::after {
    content: '';
    position: absolute;
    width: 0; height: 0; overflow: hidden; z-index: -1;
    background-image:
        url('images/hero.png'),
        url('images/hero2.png'),
        url('images/hero3.png'),
        url('images/hero4.png');
}

/* ==========================================================================
   12. RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */

/* Desktop - Línea divisoria */
@media (min-width: 992px) {
    .border-start-lg {
        border-left: 1px solid #dee2e6;
        padding-left: 3rem;
    }
}

/* Tablets y dispositivos medianos */
@media (max-width: 991.98px) {
    :root {
        font-size: 15px;
    }
}

/* Tablets y móviles */
@media (max-width: 768px) {
    .typewriter-container {
        min-height: 120px;
    }

    .partner-logo {
        width: 120px;
    }

    .brand-title {
        font-size: 0.9rem;
    }

    .logo-img {
        height: 35px;
    }

    .flip-card {
        height: 200px;
    }
}

/* Móviles - Hero section */
@media (max-width: 767.98px) {
    .hero-section .container {
        padding-top: 15vh;
    }

    .hero-title {
        font-size: 1.8rem;
        line-height: 1.2;
    }

    .hero-text {
        font-size: 1rem;
        margin-top: 1rem;
        margin-bottom: 1.5rem;
    }

    .hero-section .btn-lg {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* Móviles pequeños */
@media (max-width: 576px) {
    .service-card img {
        height: 100px;
    }

    .service-card h5,
    .service-card h4 {
        font-size: 0.75rem;
    }

    .display-5 {
        font-size: 1.8rem;
    }

    #btn-back-to-top {
        width: 40px;
        height: 40px;
        bottom: 15px;
        right: 15px;
    }
}

/* Pantallas extra pequeñas */
@media (max-width: 480px) {
    .brand-title {
        font-size: 0.6rem;
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .brand-subtitle {
        font-size: 0.75rem;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ==========================================================================
   13. UTILIDADES Y HELPERS
   ========================================================================== */
.transition-navbar {
    transition: all 0.4s ease;
}

/* Accesibilidad */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus visible para accesibilidad */
*:focus-visible {
    outline: 2px solid var(--color-secundario);
    outline-offset: 2px;
}

/* Prevención de text selection en elementos interactivos */
.btn,
.navbar-brand,
.nav-link {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

/* ==========================================================================
   14. OPTIMIZACIONES DE PERFORMANCE
   ========================================================================== */
/* GPU acceleration para animaciones */
.service-card,
.flip-card-inner,
.btn,
#btn-back-to-top {
    will-change: transform;
}

/* Reducción de movimiento para usuarios con preferencias de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms ;
        animation-iteration-count: 1 ;
        transition-duration: 0.01ms ;
    }
}

/* Print styles */
@media print {
    .navbar,
    #btn-back-to-top,
    footer {
        display: none;
    }

    body {
        padding-top: 0;
    }
}
