/* ==========================================================================
   NextGen Automation - Premium Industrial Style Guide & Framework
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
    /* Pure corporate canvas */
    --bg-primary: #ffffff;           /* Clean white background from logo container */
    --bg-secondary: #f0f0f0;         /* Ultra-light slate for alternating page sections */
    --bg-surface: #ffffff;           /* Crisp white for cards and layout blocks */
    
    /* Exact Logo Color Samples */
    --color-accent: #00a8cc;         /* Tech Cyan sampled directly from the logo's outer icon ring */
    --color-accent-rgb: 0, 168, 204;
    --color-electric: #002855;       /* Deep Corporate Navy from the "NextGen" text string */
    
    /* Maximum Readability Typography */
    --text-main: #0a1128;            /* High-contrast Midnight Navy for prominent headings */
    --text-muted: #475569;          /* Readable Slate Gray for continuous body text rows */
    
    /* Structural Elements */
    --border-glass: rgba(0, 40, 85, 0.08); /* Sophisticated, faint navy tint for card borders */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow-x: hidden; /* Strict guard against horizontal layout breaks/overflow-scrolling */
    -webkit-text-size-adjust: 100%; /* Prevents text-size changes after mobile orientation shifts */
}

.navbar-toggler-icon {
    filter: invert(1) brightness(0);
}

/* ==========================================================================
   Typography Rules (Responsive Scale Engine)
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

/* Fluid responsive sizes using CSS clamp properties */
h1, .display-4 { font-size: clamp(2.0rem, 4.5vw, 3.5rem); }
h2, .section-title { font-size: clamp(1.65rem, 3.8vw, 2.5rem); }
h3 { font-size: clamp(1.4rem, 2.8vw, 2.0rem); }
h4 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); }

p, .text-muted {
    color: var(--text-muted) !important;
    font-weight: 400;
    line-height: 1.6;
    font-size: clamp(0.95rem, 1.5vw, 1.05rem);
}

h1, h2, h3, h4, h5, h6, .text-white {
    color: var(--text-main) !important;
}

/* ==========================================================================
   Layout Base Blocks & Container Fixes
   ========================================================================== */
.section-padding {
    padding: clamp(50px, 7vw, 100px) 0; /* Shrinks container gaps cleanly on mobile viewports */
}

.bg-secondary {
    background-color: var(--bg-secondary) !important;
}

.gradient-text {
    background: linear-gradient(135deg, var(--color-electric) 30%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-subtitle {
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: clamp(0.75rem, 1.2vw, 0.85rem);
    font-weight: 700;
    display: block;
    margin-bottom: 10px;
}

/* Fixes card columns layout to enforce equal heights gracefully inside fluid layouts */
.row.g-4 > [class*='col-'] {
    display: flex;
    flex-direction: column;
}

/* Glassmorphism Reusable Component */
.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    width: 100%;
}

/* ==========================================================================
   Navigation Bar (FULLY RESPONSIVE FIXED OVERHAUL)
   ========================================================================== */
.navbar {
    background: rgba(255, 255, 255, 0.92) !important; /* Fixed dark overlay to clean premium white glass */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-glass);
    transition: var(--transition-smooth);
    padding: 16px 0;
    z-index: 1050 !important; /* Forces header to stay cleanly above all bootstrap items */
}

.navbar.scrolled {
    padding: 10px 0;
    background: var(--bg-primary) !important;
    box-shadow: 0 10px 30px rgba(0, 40, 85, 0.05); /* Clean light shadow block */
}

.navbar-brand {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: clamp(1.15rem, 2vw, 1.4rem);
    letter-spacing: -0.5px;
    color: var(--color-electric) !important;
}

.nav-link {
    font-weight: 500;
    color: var(--text-muted) !important; /* Uses secondary text palette for cleaner defaults */
    transition: var(--transition-smooth);
    margin: 0 6px;
    font-size: 0.95rem;
}

.nav-link:hover, .nav-link.active {
    color: var(--color-accent) !important;
}

/* Fixes mobile collapse items overshooting viewport limitations */
@media (max-width: 991.98px) {
    .navbar {
        padding: 12px 0; /* Tightens navbar frame scale on mobile displays */
    }

    .navbar-collapse {
        background: var(--bg-secondary); /* Updated dark block to use your branded light secondary slate background */
        border: 1px solid var(--border-glass);
        border-radius: 10px;
        margin-top: 12px;
        padding: 20px;
        max-height: 75vh; /* Prevents overflow clipping on small landscape devices */
        overflow-y: auto;  /* Allows system list scrolling if items exceed view spaces */
        box-shadow: 0 15px 35px rgba(0, 40, 85, 0.08);
    }
    
    .nav-link {
        padding: 12px 8px !important;
        margin: 0;
        border-bottom: 1px solid rgba(0, 40, 85, 0.04);
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    .navbar .btn-custom {
        width: 100%;
        margin-top: 15px;
        justify-content: center;
    }
}

/* ==========================================================================
   Hero Layout Corrections (Header Safe Offset Space)
   ========================================================================== */
.hero-wrapper {
    position: relative;
    /* Extra padding-top ensures headers never crush page titles on any device size */
    padding: clamp(130px, 18vw, 200px) 0 clamp(60px, 10vw, 120px);
    background: radial-gradient(circle at 80% 20%, rgba(0, 168, 204, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 10% 80%, rgba(0, 40, 85, 0.04) 0%, transparent 50%);
    display: flex;
    align-items: center;
}

@media (max-width: 767.98px) {
    .hero-wrapper {
        text-align: center;
    }
    
    .hero-wrapper .d-flex {
        justify-content: center;
        flex-wrap: wrap; /* Wraps main buttons perfectly on mobile rows */
        gap: 12px !important;
    }
    
    .hero-wrapper .btn-custom {
        width: 100%; /* Makes contact buttons fluid and wide across standard view edges */
        justify-content: center;
    }
}

/* ==========================================================================
   Cards System Component Rules
   ========================================================================== */
.feature-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: clamp(25px, 4vw, 40px) clamp(20px, 3vw, 30px);
    transition: var(--transition-smooth);
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: rgba(var(--color-accent-rgb), 0.4);
    box-shadow: 0 15px 35px rgba(0, 40, 85, 0.06);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: rgba(var(--color-accent-rgb), 0.08);
    border: 1px solid rgba(var(--color-accent-rgb), 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--color-accent);
    margin-bottom: 25px;
}

@media (max-width: 767.98px) {
    .card-icon {
        margin-left: auto;
        margin-right: auto; /* Centers card icons smoothly when grids shift layout balances */
    }
    .feature-card {
        text-align: center;
    }
    .feature-card ul {
        text-align: left; /* Maintains bullet lists readability while cards center */
    }
}

/* ==========================================================================
   Metrics Counter Boxes
   ========================================================================== */
.counter-box h2 {
    font-size: clamp(2.2rem, 6vw, 3rem);
    color: var(--color-accent);
}

/* ==========================================================================
   Buttons Module Layout System
   ========================================================================== */
.btn-custom {
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 6px;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    white-space: nowrap; /* Prevents button text strings from wrapping to secondary rows */
}

.btn-primary-glow {
    background: linear-gradient(135deg, var(--color-electric), var(--color-accent));
    color: #fff !important;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 168, 204, 0.25);
}

.btn-primary-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 26px rgba(0, 168, 204, 0.4);
    color: #fff !important;
}

.btn-secondary-outline {
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--color-electric);
}

.btn-secondary-outline:hover {
    background: rgba(0, 168, 204, 0.04);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* ==========================================================================
   Form Input Elements
   ========================================================================== */
.form-control {
    background: #ffffff !important; /* Turned light */
    border: 1px solid var(--border-glass) !important;
    color: var(--text-main) !important; /* Swapped to dark main readable text color */
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 1rem;
    width: 100%;
}

.form-control:focus {
    border-color: var(--color-accent) !important;
    box-shadow: 0 0 0 3px rgba(0, 168, 204, 0.15) !important;
}

/* ==========================================================================
   Global Footer Component Layout System
   ========================================================================== */
footer {
    background: var(--bg-secondary); /* Swapped deep black `#02050d` to clean corporate light slate */
    border-top: 1px solid var(--border-glass);
    padding: clamp(45px, 6vw, 80px) 0 30px;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-smooth);
    display: block;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.footer-link:hover {
    color: var(--color-accent);
    padding-left: 5px;
}

@media (max-width: 767.98px) {
    footer {
        text-align: center;
    }
    .footer-link {
        margin-bottom: 15px;
    }
}

/* ==========================================================================
   Scroll to Top Component
   ========================================================================== */
#scrollTopBtn {
    position: fixed;
    bottom: clamp(15px, 4vw, 30px);
    right: clamp(15px, 4vw, 30px);
    z-index: 99;
    width: 45px;
    height: 45px;
    background: var(--color-electric);
    color: white;
    border: none;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 40, 85, 0.15);
    transition: var(--transition-smooth);
}

#scrollTopBtn:hover {
    background: var(--color-accent);
    transform: translateY(-3px);
}

/* ==========================================
   FIXED NAVBAR RESPONSIVE VIEWPORTS SPACING FIX
   ========================================== */

/* 1. Prevent Hero content from hiding under the fixed navbar at the top of the page */
.hero-wrapper {
    /* Height of navbar + standard breathing space */
    padding-top: 120px !important; 
}

/* 2. Adjust spacing specifically for Laptop & Desktop screens */
@media (min-width: 992px) {
    .navbar {
        padding-top: 15px;
        padding-bottom: 15px;
        transition: all 0.3s ease;
    }
    .hero-wrapper {
        padding-top: 140px !important;
    }
}

/* 3. Adjust spacing for Tablets and Mobile screens (where the layout usually breaks) */
@media (max-width: 991.98px) {
    .navbar {
        background-color: var(--bg-primary) !important; /* Uses your crisp brand white instead of the old dark #11141a */
        padding-top: 10px;
        padding-bottom: 10px;
    }
    
    /* Ensures the mobile dropdown menu scrolls nicely if it has too many links */
    .navbar-collapse {
        max-height: 380px;
        overflow-y: auto;
        padding-top: 15px;
        padding-bottom: 15px;
    }

    /* Gives extra breathing room for title text on small screens so the navbar never overlaps it */
    .hero-wrapper {
        padding-top: 110px !important;
        min-vh: auto !important; /* Prevents text clipping on small phone screens */
        padding-bottom: 60px;
    }
    
    /* Adds spacing between active buttons when they wrap vertically on mobile devices */
    .btn-row-wrapper .btn-custom {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* 4. Layer Ordering Fix (Z-Index)
    Prevents animated sections (AOS) from overlapping the navigation menu when scrolling down */
.navbar {
    z-index: 1050 !important;
}