/*
 * REFLEXIVITY CSS - MODULAR ARCHITECTURE
 * =====================================
 * 
 * This is the main CSS file that imports all modular components.
 * 
 * ARCHITECTURE:
 * - Base: Foundation styles (variables, reset, typography)
 * - Components: Reusable UI components (buttons, grids, navigation)
 * - Sections: Page-specific sections (hero, capabilities, footer)
 * - Utilities: Helper classes (responsive, animations)
 */

/* ========================================
   BASE STYLES
   ======================================== */
@import url("base/variables.css");
@import url("base/reset.css");
@import url("base/typography.css");

/* ========================================
   COMPONENTS
   ======================================== */
@import url("components/buttons.css");
@import url("components/grids.css");
@import url("components/navigation.css");

/* ========================================
   SECTIONS
   ======================================== */
@import url("sections/hero.css");
@import url("sections/capabilities.css");
@import url("sections/page-sections.css");
@import url("sections/modal-content.css");
@import url("sections/footer.css");

/* ========================================
   UTILITIES
   ======================================== */
@import url("utilities/animations.css");
@import url("utilities/responsive.css");

/* ========================================
   TEMPLATE LOADING OPTIMIZATION
   ======================================== */

/* Global page transition to reduce flickering */
body {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

body.templates-loaded {
    opacity: 1;
}

/* Skeleton structure for navigation - only when empty */
#nav-placeholder:empty {
    position: fixed;
    top: 0;
    width: 100%;
    height: 76px;
    background: var(--background-default);
    border-bottom: 1px solid var(--border-soft);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 24px;
    justify-content: space-between;
}

/* Navigation skeleton elements - only when empty */
#nav-placeholder:empty::before {
    content: '';
    width: 140px;
    height: 32px;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0.08) 25%, 
        rgba(255,255,255,0.15) 50%, 
        rgba(255,255,255,0.08) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.8s infinite ease-in-out;
    border-radius: 6px;
}

#nav-placeholder:empty::after {
    content: '';
    width: 200px;
    height: 40px;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0.08) 25%, 
        rgba(255,255,255,0.15) 50%, 
        rgba(255,255,255,0.08) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.8s infinite ease-in-out;
    animation-delay: 0.2s;
    border-radius: 8px;
}

/* Smooth content transition when loaded - only when not empty */
#nav-placeholder:not(:empty) .navbar {
    opacity: 0;
    transform: translateY(-5px);
    animation: slideInFade 0.4s ease-out forwards;
}

/* Reset nav-placeholder styles when it has content */
#nav-placeholder:not(:empty) {
    position: static;
    width: auto;
    height: auto;
    background: none;
    border-bottom: none;
    z-index: auto;
    display: block;
    padding: 0;
    justify-content: initial;
}

/* Other placeholders with staggered loading */
#footer-placeholder,
#banner-placeholder,
#data-section {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease-out;
}

#footer-placeholder.loaded,
#banner-placeholder.loaded,
#data-section.loaded,
#hubspot-modal-placeholder.loaded {
    opacity: 1;
    transform: translateY(0);
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes slideInFade {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ensure body has proper spacing for fixed header */
body {
    padding-top: 76px;
}

/* ========================================
   SMOOTH NAVIGATION ENHANCEMENTS
   ======================================== */

/* Enhanced smooth scrolling */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px; /* Account for fixed header + extra space */
}

/* Section entrance animations */
section {
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

section.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Progressive reveal for section content */
section .container > * {
    transform: translateY(15px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

section.in-view .container > * {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation delays for child elements */
section.in-view .container > *:nth-child(1) { transition-delay: 0.1s; }
section.in-view .container > *:nth-child(2) { transition-delay: 0.2s; }
section.in-view .container > *:nth-child(3) { transition-delay: 0.3s; }
section.in-view .container > *:nth-child(4) { transition-delay: 0.4s; }
section.in-view .container > *:nth-child(5) { transition-delay: 0.5s; }

/* Navigation link active state enhancement */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link.active {
    color: var(--brand-primary) !important;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--brand-primary);
    transform: scaleX(1);
    transition: transform 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--brand-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

/* Scroll progress indicator */
.scroll-progress {
    position: fixed;
    top: 76px;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
    z-index: 1001;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

/* Special animation for scroll target */
.scroll-target {
    position: relative;
}

.scroll-target::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px solid var(--brand-primary);
    border-radius: 12px;
    opacity: 0;
    animation: highlightPulse 1s ease-out;
    pointer-events: none;
    z-index: -1;
}

@keyframes highlightPulse {
    0% {
        opacity: 0;
        transform: scale(0.95);
        border-color: var(--brand-primary);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.02);
        border-color: var(--brand-secondary);
    }
    100% {
        opacity: 0;
        transform: scale(1.05);
        border-color: var(--brand-primary);
    }
}

/* Enhanced section transitions */
section.in-view {
    animation: sectionSlideIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* Smooth transitions for all interactive elements */
a, button, .nav-link {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced hover states for navigation */
.nav-link:hover::after {
    transform: scaleX(0.7);
}

.nav-link:hover {
    color: var(--brand-primary);
}

/* HubSpot Form Modal */
.hubspot-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.hubspot-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.hubspot-modal-content {
    position: relative;
    background: var(--background-default);
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.3);
}

.hubspot-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid var(--border-soft);
}

.hubspot-modal-header h2 {
    margin: 0;
    color: var(--text-default);
    font-size: 24px;
    font-weight: 600;
}

.hubspot-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-soft);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hubspot-modal-close:hover {
    color: var(--text-default);
}

.hubspot-modal-body {
    padding: 24px;
}




