/* ==========================================
   GATEWAY IT - BASE CSS
   Estilos base y variables globales
   ========================================== */

/* ==========================================
   VARIABLES CSS
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colores Principales */
    --primary-color: #F58635;
    --primary-hover: #ff6b35;
    
    /* Fondos */
    --light-bg: #ffffff;
    --light-secondary: #f8f9fa;
    --light-card: #ffffff;
    --dark-bg: #1a1a2e;
    --dark-secondary: #16213e;
    
    /* Textos */
    --text-dark: #2d3436;
    --text-gray: #636e72;
    --text-light: #ffffff;
    
    /* Efectos */
    --gradient-primary: linear-gradient(135deg, #F58635 0%, #ff6b35 100%);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.08);
    --transition-base: all 0.3s ease;
    
    /* Espaciados */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;
}

/* ==========================================
   MODO OSCURO - Variables Alternativas
   ========================================== */
body.dark-mode {
    --light-bg: #0f0f1e;
    --light-secondary: #1a1a2e;
    --light-card: #16213e;
    --text-dark: #e0e0e0;
    --text-gray: #b0b0b0;
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
    background-color: #0f0f1e;
    color: #e0e0e0;
}

/* ==========================================
   ESTILOS GENERALES
   ========================================== */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Padding para páginas internas (no home) para compensar navbar fixed */
body:not(.home-page) .main-content {
    padding-top: 90px;
}

/* Fondo animado optimizado */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(135deg, rgba(245, 134, 53, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 20% 50%, rgba(245, 134, 53, 0.05) 0%, transparent 50%);
    z-index: -1;
    will-change: opacity;
}

/* ==========================================
   TIPOGRAFÍA
   ========================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 1.75rem); }

p {
    margin-bottom: var(--spacing-sm);
}

/* ==========================================
   UTILIDADES
   ========================================== */
.container-custom {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.section {
    padding: var(--spacing-xl) var(--spacing-md);
}

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

/* ==========================================
   BOTONES BASE
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) calc(var(--spacing-sm) * 2.5);
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 134, 53, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(245, 134, 53, 0.5);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

/* ==========================================
   CARDS BASE
   ========================================== */
.card {
    background: var(--light-card);
    border-radius: 20px;
    padding: var(--spacing-md);
    border: 1px solid rgba(245, 134, 53, 0.15);
    box-shadow: var(--shadow-card);
    transition: var(--transition-base);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(245, 134, 53, 0.15);
    border-color: var(--primary-color);
}

/* ==========================================
   ANIMACIONES DE SCROLL (Optimizadas)
   ========================================== */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    will-change: opacity, transform;
}

.scroll-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================
   SECCIONES
   ========================================== */
.section-title {
    text-align: center;
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    margin-bottom: var(--spacing-sm);
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-gray);
    margin-bottom: var(--spacing-lg);
}

/* ==========================================
   LAZY LOADING
   ========================================== */
img[loading="lazy"] {
    opacity: 1;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* ==========================================
   RESPONSIVE BASE
   ========================================== */
@media (max-width: 968px) {
    :root {
        --spacing-xl: 4rem;
        --spacing-lg: 2rem;
    }
    
    .section {
        padding: var(--spacing-lg) var(--spacing-sm);
    }
}

@media (max-width: 600px) {
    :root {
        --spacing-xl: 3rem;
        --spacing-lg: 1.5rem;
    }
}

/* ==========================================
   FOOTER
   ========================================== */
footer {
    background: var(--dark-bg);
    color: var(--text-light);
    /* padding: 4rem 0 2rem; */
    /* margin-top: var(--spacing-xl); */
}

body.dark-mode footer {
    background: var(--dark-secondary);
    border-top: 1px solid rgba(245, 134, 53, 0.1);
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 0.8rem;
    color: var(--text-gray);
    transition: var(--transition-base);
}

.footer-section ul li a {
    color: var(--text-gray);
    text-decoration: none;
    transition: var(--transition-base);
    display: inline-flex;
    align-items: center;
}

.footer-section ul li a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.footer-section ul li i {
    margin-right: 0.8rem;
    color: var(--primary-color);
    width: 20px;
}

/* Footer Compacto */
.footer-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    gap: 2rem;
}

.footer-left {
    flex: 1;
}

.footer-tagline {
    color: var(--text-gray);
    font-size: 0.95rem;
    margin: 0 0 0.5rem 0;
    line-height: 1.5;
}

.footer-copyright {
    color: var(--text-gray);
    font-size: 0.85rem;
    margin: 0;
    opacity: 0.8;
}

.footer-right {
    display: flex;
    align-items: center;
}

.footer-logo {
    width: 200px;
    object-fit: contain;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.footer-logo:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .footer-compact {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem 0;
        gap: 1rem;
    }

    .footer-left {
        order: 2;
    }

    .footer-right {
        order: 1;
    }

    .footer-logo {
        width: 60px;
        height: 60px;
    }
}

/* ==========================================
   BOTÓN MODO OSCURO
   ========================================== */
.dark-mode-toggle {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(245, 134, 53, 0.4);
    transition: var(--transition-base);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-mode-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 30px rgba(245, 134, 53, 0.6);
}

.dark-mode-toggle:active {
    transform: scale(0.95);
}

body.dark-mode .dark-mode-toggle {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
}

/* ==========================================
   OPTIMIZACIONES DE RENDIMIENTO
   ========================================== */
/* Reducir repaints durante scroll - aplicado solo a elementos específicos */
.fixed-element,
#navbar,
.hero,
.service-card,
.value-card {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* ==========================================
   RESPONSIVE - FOOTER Y BOTONES
   ========================================== */
@media (max-width: 968px) {
    footer {
        padding: 2rem 0 1rem;
    }

    .footer-logo {
        max-width: 150px;
    }

    .footer-tagline {
        font-size: 0.95rem;
    }

    .dark-mode-toggle {
        bottom: 1.5rem;
        left: 1.5rem;
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
}

@media (max-width: 600px) {
    footer {
        padding: 1.5rem 0 1rem;
    }

    .footer-logo {
        max-width: 130px;
    }

    .footer-tagline {
        font-size: 0.9rem;
        padding: 0 1rem;
    }

    .dark-mode-toggle {
        bottom: 1rem;
        left: 1rem;
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}