/* Custom CSS for Nebula Systems Website */

/* Space Theme & Modern Gen Z Vibe Styling */
:root {
    /* Space Theme Colors */
    --bs-primary: #8A2BE2; /* Blue-Violet - A vibrant space accent */
    --bs-dark: #0F0F1A;     /* Deep Space Black/Blue - Primary background */
    --bs-light: #1A1A2A;    /* Darker Asteroid Grey - For alternating sections and body */
    --bs-dark-alt: #2A1A3A;/* Nebula Purple-Blue - For contact section contrast */
    --bs-gray-900: #E0E0E0;/* Stardust White - For general text */

    /* Glow Colors (non-rainbow) - Used in JavaScript */
    --glow-cloud: rgba(138, 43, 226, 0.7); /* Blue-Violet for Cloud */
    --glow-dr: rgba(0, 204, 204, 0.7);     /* Cyan for Disaster Recovery */
    --glow-network: rgba(255, 120, 0, 0.7); /* Deep Orange for Network */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bs-dark); /* Changed to Black */
    color: var(--bs-gray-900); /* Lighter text for readability on dark */
    /* Removed overflow-x: hidden from body, will apply to carousel wrapper */
}

html {
    scroll-behavior: smooth;
}

/* Offset for sticky header when linking to sections */
section[id] { /* Targets any section with an ID */
    scroll-margin-top: 100px; /* Adjust this value based on actual navbar height + desired clearance */
}

/* Styles for sections that will have the background image blend */
.hero-section,
#why-choose-us,
.contact-section {
    position: relative; /* Crucial for absolute positioning of section-bg-blend */
    overflow: hidden; /* Ensures background doesn't overflow if it's larger */
}

/* New class for the background image and blend */
.section-bg-blend {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover; /* Keeps the image covering the area */
    z-index: -1; /* Puts it behind the content of the section */
    background-repeat: no-repeat;
    /* Default position for larger sections, or if not overridden */
    background-position: center center;
}

/* --- Specific Background Images and Positions for Each Section --- */

/* Home Section Background */
.hero-section .section-bg-blend {
    background-image: linear-gradient(rgba(15, 15, 26, 0.85), rgba(15, 15, 26, 0.70)), url('/assets/img/backgrounds/space-bg1.jpg');
    background-position: center center; /* Explicitly keep home section centered */
}

/* Why Choose Us Section Background */
#why-choose-us .section-bg-blend {
    background-image: linear-gradient(rgba(15, 15, 26, 1), rgba(15, 15, 26, 0.85)), url('/assets/img/backgrounds/space-bg2.jpg'); /* Updated opacity */
    background-position: center center; /* Adjusted for smaller sections */
}

/* Contact Section Background (Ready to Transform) */
.contact-section .section-bg-blend {
    background-image: linear-gradient(rgba(15, 15, 26, 1), rgba(15, 15, 26, 0.85)), url('/assets/img/backgrounds/space-bg3.jpg'); /* Updated opacity */
    background-position: center center; /* Adjusted for smaller sections */
}


.hero-section {
    color: white; /* Keep text white for strong contrast */
    padding: 120px 0;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.9);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 700;
}

.hero-section .lead {
    font-size: 1.25rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.section-padding {
    padding: 80px 0;
}

h2 {
    font-weight: 700;
    margin-bottom: 2.5rem;
    /* Default h2 color for sections with dark backgrounds */
    color: var(--bs-gray-900);
}

/* Explicitly set background and text colors for these sections */
#services {
    background-color: var(--bs-dark-alt); /* Purple */
    color: var(--bs-gray-900); /* Ensure text is light */
}
#why-choose-us {
    color: var(--bs-gray-900); /* Ensure text is light */
    /* Background now handled by .section-bg-blend */
}
/* Updated #our-partners to #brands */
#brands { /* New section */
    background-color: var(--bs-dark-alt); /* Changed to Purple */
    color: var(--bs-gray-900); /* Ensure text is light */
}


/* Make sure h2 within these sections is light */
#services h2,
#why-choose-us h2,
#brands h2, /* Updated #our-partners to #brands */
#brands h3 { /* Added h3 for sub-headings in Brands section */
    color: var(--bs-gray-900); /* Which is #E0E0E0 */
}

.card {
    border: none;
    border-radius: 1rem;
    overflow: hidden;
    background-color: var(--bs-dark); /* Cards also dark for space theme */
    color: var(--bs-gray-900); /* Card text light */
    /* Subtle default white shadow */
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1); /* Subtle initial white glow */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card .card-title, .card .card-text {
    color: var(--bs-gray-900); /* Ensure text is light */
}
.card .list-group-item {
    background-color: var(--bs-dark); /* List items in cards also dark */
    color: var(--bs-gray-900);
}


/* Specific Glow Effects for each card are now handled by JavaScript */

.icon-large {
    font-size: 3.5rem;
    color: var(--bs-primary); /* Use primary color for icons */
}

.list-group-item {
    border: none;
    padding-left: 0;
    background-color: transparent;
}

.list-group-item i {
    color: var(--bs-primary);
}

.navbar {
    padding: 1.25rem 0;
    background-color: var(--bs-dark) !important; /* Reverted to solid dark background */
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Separator border */
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75) !important;
    transition: color 0.3s ease;
    padding: 0.75rem 1.25rem !important; /* Increased padding */
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: white !important;
}

.btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    font-weight: 600;
    padding: 12px 30px;
    border-radius: 0.5rem;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.btn-primary:hover {
    background-color: #6a0dad; /* Slightly darker primary on hover */
    border-color: #6a0dad;
}

/* Contact Section (separated visually from footer) */
.contact-section {
    color: white;
    /* Background now handled by .section-bg-blend */
}

/* Hip Footer Styling */
.footer-section {
    background-color: var(--bs-dark); /* Deep space black */
    color: white;
    padding: 80px 0; /* Default desktop padding */
    border-top: 1px solid rgba(255, 255, 255, 0.1); /* Separator border */
}

.footer-section h5 {
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: white;
}

.footer-section p, .footer-section a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

.footer-section a:hover {
    color: var(--bs-primary);
    text-decoration: none;
}

.social-icons a {
    color: white;
    font-size: 1.5rem;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.social-icons a:hover {
    color: var(--bs-primary);
}

/* Adjustments for why choose us items */
.why-choose-us-item {
    background-color: var(--bs-dark); /* Dark background for these boxes too */
    color: var(--bs-gray-900); /* Light text for these boxes */
    border-radius: 1rem;
    /* Subtle default white shadow */
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1); /* Subtle initial white glow */
    padding: 1.5rem; /* Ensure sufficient padding/thickness */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Maintain transform and box-shadow transitions */
}

/* No specific .hvr-grow:hover for box-shadow here, handled by JS */
.why-choose-us-item.hvr-grow:hover {
    transform: scale(1.03); /* Maintain the grow effect */
    /* box-shadow will be dynamically set by JavaScript */
}

/* Infinite Carousel Styling for Brands Section */
.brands-carousel-wrapper {
    overflow: hidden; /* Hides content outside the wrapper */
    width: 100%;
    padding: 1.5rem 0; /* Vertical padding to give space above/below logos */
}

.brands-carousel-track {
    display: flex; /* Arranges logo lists in a row */
    width: max-content; /* Allows track to be as wide as its content */
    animation: scroll-left 40s linear infinite; /* Adjust time for speed */
}

.brands-carousel-track:hover {
    animation-play-state: paused; /* Pause animation on hover */
}

/* Class to disable carousel animation and adjust layout for static display */
.brands-carousel-track.no-animation {
    animation: none; /* Disable animation */
    width: 100%; /* Take full width if no animation */
    flex-wrap: wrap; /* Allow wrapping if items don't fit on one line */
    justify-content: center; /* Center items for static display */
}

.brands-logo-list {
    display: flex; /* Makes each list a flex container for its logos */
    flex-shrink: 0; /* Prevents logo lists from shrinking */
    align-items: center; /* Vertically centers logos within the list */
    justify-content: center; /* Horizontally centers content within the list */
    gap: 40px; /* Spacing between logos within each list */
    /* Removed margin-right: 40px; to let gap handle spacing */
}

.brands-carousel-item {
    flex-shrink: 0; /* Prevents individual logo items from shrinking */
    text-align: center; /* Ensures the image inside is centered */
}

/* Styling for Brands Logos */
.brands-logo {
    height: 80px; /* Fixed height for all logos */
    width: auto; /* Maintain aspect ratio */
    max-width: 150px; /* Ensure images don't get too wide */
    object-fit: contain; /* Ensures the entire image is visible within the bounds */
    filter: grayscale(100%); /* Grayscale by default */
    transition: filter 0.3s ease, transform 0.3s ease; /* Added filter to transition */
    cursor: pointer;
    display: block; /* Ensures margin auto works horizontally if needed within a flex item */
}

.brands-logo:hover {
    filter: grayscale(0%); /* Color on hover */
    transform: scale(1.05); /* Slight grow effect on hover */
}

/* Keyframes for horizontal scrolling */
@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }
    100% {
        /* Translates the track by exactly half its width, which is the width of one duplicated set of logos, creating a seamless loop */
        transform: translateX(-50%);
    }
}

/* Certification Logos Section (When uncommented in HTML) */
#certifications-footer-display {
    width: 100%;
    padding-top: 2rem; /* Spacing from other footer content */
    border-top: 1px solid rgba(255, 255, 255, 0.1); /* Subtle separator */
    margin-top: 2rem; /* Spacing from other footer content */
}

#certifications-footer-display h6 {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6); /* Lighter text for the heading */
}

.cert-logo {
    max-width: 100px; /* Max width for desktop logos */
    height: auto; /* Maintain aspect ratio */
    object-fit: contain; /* Ensure the entire image is visible within its bounds */
    flex-shrink: 0; /* Prevent shrinking if space is tight */
    flex-grow: 1; /* Allow growing to fill space if available */
}


/* Responsive adjustments */
@media (max-width: 991.98px) { /* Applies to screens smaller than large (lg) for navbar-collapse and footer */
    .hero-section h1 {
        font-size: 2.5rem;
    }
    .hero-section {
        padding: 80px 0;
    }
    .section-padding {
        padding: 60px 0;
    }

    /* Footer mobile padding */
    .footer-section {
        padding: 50px 2.5rem !important; /* Increased horizontal padding for mobile */
    }

    /* Full-page Mobile Navigation */
    #navbarNav {
        /* Initial state (hidden and off-screen) */
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: var(--bs-dark); /* Use your dark theme color */
        display: flex !important; /* Override Bootstrap's default display: none on .collapse */
        align-items: center;
        justify-content: center;
        flex-direction: column; /* Stack nav items vertically */
        z-index: 1040; /* Above regular content */
        overflow-y: auto; /* Allow scrolling if content is too tall */

        transform: translateY(100vh); /* Start off-screen at the bottom */
        opacity: 0;
        visibility: hidden;
        pointer-events: none; /* Disable interaction when hidden */

        /* Animation properties: ease-out for launch feel */
        transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                     opacity 0.6s ease-in-out,
                     visibility 0.6s;
    }

    /* When navigation is fully open */
    #navbarNav.show {
        transform: translateY(0); /* Move to on-screen position */
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* Important: Override Bootstrap's .collapsing class which often has a height transition */
    #navbarNav.collapsing {
        /* During Bootstrap's transition, prevent its default height animation */
        height: 100vh !important; /* Ensure height is fixed during custom transition */
        transform: translateY(100vh); /* Maintain starting position */
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: none !important; /* Disable Bootstrap's own transition */
    }

    /* Navbar links within the full-page menu */
    #navbarNav.show .nav-link {
        font-size: 2.0rem !important; /* Adjusted to medium size */
        font-weight: 600; /* Slightly less bold than 700, but still strong */
        padding: 1rem 0 !important;
        /* Icon size will scale with font-size due to Bootstrap Icons design */
    }

    /* Ensure navbar-nav is centered within the full-page overlay */
    #navbarNav.show .navbar-nav {
        margin: 0 auto !important; /* Override ms-auto and center */
        width: 100% !important; /* Ensure it takes full width to center its content */
        text-align: center; /* Center the text within each nav-item if they become display:block/inline-block */
    }

    /* Ensure individual nav items are also centered if they become flex children of navbar-nav */
    #navbarNav.show .navbar-nav .nav-item {
        margin: 0 !important; /* Remove any default margins on nav-items */
    }

    /* Ensure toggler is above the overlay when menu is open */
    .navbar-toggler {
        position: relative; /* To allow z-index to work */
        z-index: 1050; /* Higher than the full-page overlay */
    }

    /* Certification Logos Section (When uncommented in HTML) */
    #certifications-footer-display {
        padding-top: 1.5rem;
        margin-top: 1.5rem;
    }

    .cert-logo {
        max-width: 80px; /* Adjust max width for mobile logos */
    }
}

@media (max-width: 767.98px) { /* Applies to screens smaller than medium (md) */
    .hero-section h1 {
        font-size: 2rem;
    }
    .hero-section .lead {
        font-size: 1rem;
    }
    /* Logo size for mobile was handled by inline style in HTML, now updated to 35px */
    .navbar-brand img { /* Target img directly */
        height: 35px !important; /* Smaller logo for mobile nav */
    }
    .navbar-brand {
        font-size: 1.2rem;
    }

    /* Force carousel to scroll on mobile regardless of logo count */
    .brands-carousel-track {
        animation-play-state: running !important; /* Ensure it runs */
        animation: scroll-left 40s linear infinite !important; /* Re-apply animation */
        flex-wrap: nowrap !important; /* Prevent wrapping on mobile for scroll */
        justify-content: flex-start !important; /* Ensure content starts at the beginning for scrolling */
        width: max-content !important; /* Crucial for scrolling */
    }
    .brands-carousel-track.no-animation {
        /* On mobile, this override takes precedence, so no-animation is effectively ignored */
        animation: scroll-left 40s linear infinite !important; /* Ensure it scrolls */
    }
}
