/* =========================================
   BRIGHT ANGEL - STRICT GLOBAL HEADER
   ========================================= */

/* The main wrapper ID prevents ANY styling bleed to other pages */
#ba-global-header {
    font-family: 'Montserrat', 'Raleway', sans-serif;
}

/* Fixed Navbar container */
#ba-global-header .ba-navbar {
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 9999;
    padding: 1.2rem 0;
    transition: padding 0.3s ease, box-shadow 0.3s ease;
}

/* Scrolled state applied via JS */
#ba-global-header .ba-navbar.ba-navbar-scrolled {
    padding: 0.5rem 0;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.1);
}

#ba-global-header .ba-navbar-brand img {
    height: 70px;
    width: auto;
    transition: transform 0.3s ease;
}

#ba-global-header .ba-navbar-brand img:hover {
    transform: scale(1.02);
}

/* Navigation Links */
#ba-global-header .ba-nav-link {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 0.5rem 1rem !important;
    color: #1e293b !important; /* Corporate dark slate */
    position: relative;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

/* Premium Hover Underline Effect */
#ba-global-header .ba-nav-link::after {
    content: '';
    display: block;
    position: absolute;
    left: 50%;
    bottom: 2px;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    border-radius: 2px;
    background: var(--primary-color, #004aad);
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#ba-global-header .ba-nav-link:hover,
#ba-global-header .ba-nav-link:focus,
#ba-global-header .ba-nav-link.active {
    color: var(--primary-color, #004aad) !important;
}

#ba-global-header .ba-nav-link:hover::after,
#ba-global-header .ba-nav-link:focus::after,
#ba-global-header .ba-nav-link.active::after {
    width: 70%;
}

/* =========================================
   DROPDOWN MENU STYLING & MOBILE FIX
   ========================================= */

#ba-global-header .dropdown-menu {
    border-radius: 12px;
    background: #ffffff;
    padding: 0.5rem 0;
}

#ba-global-header .dropdown-item {
    font-weight: 600;
    color: #475569;
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

#ba-global-header .dropdown-item:hover,
#ba-global-header .dropdown-item.active-sub {
    color: var(--primary-color, #004aad);
    background: rgba(0, 74, 173, 0.05);
    padding-left: 1.8rem; /* Slight indent on hover */
}

/* DESKTOP VIEW: Premium Hover Animation */
@media (min-width: 992px) {
    #ba-global-header .dropdown-menu {
        border: 1px solid rgba(0,0,0,0.05);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
        margin-top: 0.5rem;
        min-width: 200px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: all 0.3s ease;
        display: block; 
    }
    
    #ba-global-header .dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

/* =========================================
   MOBILE VIEW FIXES (Screen width 991px & below)
   ========================================= */
@media (max-width: 991px) {
    
    /* 1. Fix the Navigation Container */
    #ba-global-header .navbar-collapse {
        background-color: #ffffff;
        padding: 1rem 0;
        border-top: 1px solid rgba(0,0,0,0.05);
        margin-top: 10px;
    }

    /* 2. Fix the Links and Disable the Huge Underline */
    #ba-global-header .ba-nav-link {
        padding: 10px 20px !important;
        display: block;
        width: 100%;
        text-align: left;
    }

    /* Hide the desktop underline effect on mobile to stop it stretching */
    #ba-global-header .ba-nav-link::after {
        display: none !important; 
    }

    /* Better mobile active/hover state (Left border highlight) */
    #ba-global-header .ba-nav-link:hover,
    #ba-global-header .ba-nav-link.active {
        background-color: rgba(0, 74, 173, 0.05);
        border-left: 4px solid var(--primary-color, #004aad);
        padding-left: 16px !important; /* Adjust padding to fit the border */
    }

    /* 3. Fix the Missing Dropdown Items (The Gap Issue) */
    #ba-global-header .dropdown-menu {
        position: static !important; /* Forces items to push content down normally */
        float: none;
        border: none;
        box-shadow: none;
        padding: 0 0 0 1.5rem; /* Indent the sub-menu */
        margin: 0;
        background: transparent;
        display: none; /* Let Bootstrap handle the toggle */
        opacity: 1;
        visibility: visible;
        transform: none;
    }
    
    /* Ensure Bootstrap's toggle works to show the sub-items */
    #ba-global-header .dropdown-menu.show {
        display: block !important;
    }

    /* Sub-menu item styling */
    #ba-global-header .dropdown-item {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
    
    #ba-global-header .dropdown-item.active-sub {
        background: transparent;
        border-left: 2px solid var(--primary-color, #004aad);
    }
}

/* --- Active Page Little Box (Badge) --- */
#ba-global-header .ba-page-badge {
    background: #ef4444; /* Premium Red */
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 3px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.3);
    display: inline-block;
    transform: translateY(-2px);
}
/* =========================================
   HEADER OVERRIDES (FIX DOT & MOBILE LINE)
   ========================================= */

/* 1. Completely disable the Bootstrap Caret (The Dot) under Services */
#ba-global-header .dropdown-toggle::after,
.navbar-nav .dropdown-toggle::after {
    display: none !important;
    content: none !important;
    border: none !important;
}

/* 2. Remove the underline effect ONLY from the "Services" dropdown text to prevent the dot glitch */
#ba-global-header .nav-item.dropdown .ba-nav-link::before,
#ba-global-header .nav-item.dropdown .ba-nav-link::after {
    display: none !important;
}

/* 3. Force hide the massive stretching blue line on Mobile screens */
@media (max-width: 991px) {
    #ba-global-header .ba-nav-link::before,
    #ba-global-header .ba-nav-link::after {
        display: none !important;
        content: none !important;
    }
    
    /* Ensure the mobile menu uses the clean left-side border instead */
    #ba-global-header .ba-nav-link:hover,
    #ba-global-header .ba-nav-link.active {
        border-bottom: none !important;
        border-left: 4px solid #004aad !important;
    }
}

/* --- FULL SCREEN OVERLAY --- */
.ba-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1e293b; /* Deep slate background */
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.8s ease;
}

.ba-loader-hidden { opacity: 0; visibility: hidden; }

/* --- CENTERING WRAPPER --- */
.ba-loader-inner {
    position: relative; /* Make this the reference for absolute positioning */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%; /* Ensure it takes up full height for centering */
}

/* --- CUBE CONTAINER (Rainbow Hue Rotation) --- */
.cube-container {
    position: relative;
    transform: skewY(-20deg);
    display: flex;
    justify-content: center;
    animation: colorfulRainbow 5s linear infinite; 
}

@keyframes colorfulRainbow {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

.cube { position: relative; }
.cube:nth-child(2) { translate: -60px -60px; }
.cube:nth-child(3) { translate: 60px 60px; }

.cube div {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 30px;
    translate: calc(-70px * var(--x)) calc(-60px * var(--y));
}

/* --- CUBE PIECES (Base State) --- */
.cube div span {
    position: relative;
    display: inline-block; /* CRITICAL: Allows your mouse to touch the cube! */
    width: 40px;
    height: 40px;
    background: #dcdcdc;
    z-index: calc(1 * var(--i));
    transition: 1.5s; 
    /* The old cubePulse animation is strictly removed from here */
}

.cube div span:before {
    content: ""; position: absolute; left: -30px; width: 30px; height: 100%;
    background: #fff; transform-origin: right; transform: skewY(45deg);
    transition: 1.5s;
}

.cube div span:after {
    content: ""; position: absolute; top: -30px; left: 0px; width: 100%; height: 30px;
    background: #f2f2f2; transform-origin: bottom; transform: skewX(45deg);
    transition: 1.5s;
}

/* --- CUBE HOVER EFFECT (Instant Colorful Light-Up) --- */
.cube div span:hover {
    transition: 0s;
    background: #ef4149; 
    filter: drop-shadow(0 0 30px #ef4149);
    cursor: pointer; /* Changes your mouse to a pointing hand on hover */
}

.cube div span:hover:before,
.cube div span:hover:after {
    transition: 0s;
    background: #ef4149;
}

/* --- TEXT STYLING (Floating Glass Card ON TOP of the cube) --- */
.loader-text-wrapper {
    position: absolute;
    top: 30%;
    left: 50%;
    /* -55% shifts it slightly higher to perfectly match the cube's 3D visual center */
    transform: translate(-50%, -55%); 
    text-align: center;
    z-index: 100;
    pointer-events: none;
    
    /* Premium Frosted Glass Effect */
    background: rgba(30, 41, 59, 0.85); /* Dark slate semi-transparent */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 25px 45px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    
    /* Ensure it sizes correctly */
    width: max-content;
    max-width: 90%;
}

.loader-main-text {
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    animation: textGlow 2s infinite;
}

.loader-sub-text {
    color: #cbd5e1; /* Slightly brighter slate for contrast */
    font-size: 0.9rem;
    letter-spacing: 1.5px;
    margin: 0;
}

@keyframes textGlow { 
    0%, 100% { opacity: 0.8; } 
    50% { opacity: 1; text-shadow: 0 0 15px rgba(255,255,255,0.4); } 
}