/* =========================================
   1. DESIGN TOKENS (VARIABLES)
   The single source of truth for the site.
   ========================================= */
:root {
    /* Brand Colors */
    --color-brand-dark: #103c84;
    --color-brand-primary: #0d6efd;
    --color-brand-light: #f8f9fa;
    --color-brand-white: #ffffff;
    --color-brand-text: #333333;
    --color-text-muted: #666666;

    /* Semantic Backgrounds */
    --bg-soft-blue: #f0f7ff;
    --bg-warm-paper: #faf9f6;
    --bg-grey-light: #eceef3;
    --bg-brand-tint: #EEF3FA;
    --bg-glass: rgba(231, 230, 230, 0.95);
    
    /* Typography */
    --font-main: 'Plus Jakarta Sans', sans-serif;
    
    /* Effects */
    --blur-amount: 8px;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 10px 20px rgba(0,0,0,0.3);
    --transition-fast: all 0.2s ease;
    --transition-medium: all 0.3s ease;
}

/* =========================================
   2. GLOBAL RESETS & BASE
   ========================================= */
html, body {
    max-width: 100%;
    overflow-x: hidden;
    font-family: var(--font-main);
    color: var(--color-brand-text);
    -webkit-font-smoothing: antialiased; 
    -moz-osx-font-smoothing: grayscale;
    scroll-padding-top: 120px; 
    scroll-behavior: smooth;
}

body { padding-top: 0; }
a { text-decoration: none; }

/* =========================================
   3. ATOMIC UTILITIES
   Single-purpose classes for reuse.
   ========================================= */

/* --- Color Utilities --- */
.bg-brand-dark   { background-color: var(--color-brand-dark) !important; color: white; }
.bg-brand-light  { background-color: var(--color-brand-light) !important; color: var(--color-brand-text); }
.bg-brand-tint   { background-color: var(--bg-brand-tint) !important; }
.bg-soft-blue    { background-color: var(--bg-soft-blue) !important; }
.bg-grey-light   { background-color: var(--bg-grey-light) !important; }
.bg-white-clean  { background-color: var(--color-brand-white) !important; }
.bg-dark-light   { background-color: #1a1a1a !important; }

.text-brand-dark    { color: var(--color-brand-dark) !important; }
.text-brand-primary { color: var(--color-brand-primary) !important; }
.text-body-clean    { color: var(--color-text-muted); line-height: 1.6; font-weight: 400; }

/* --- Typography Utilities --- */
.text-overline {
    font-size: 0.85rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 1.5px; color: var(--color-brand-primary);
}

.text-heading-lg {
    font-weight: 700; letter-spacing: -1px; color: var(--color-brand-dark);
}

/* --- Layout Utilities --- */
.object-cover { object-fit: cover; }
.object-contain { object-fit: contain; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.z-0 { z-index: 0; }
.z-1 { z-index: 1; }
.z-10 { z-index: 10; }
.relative { position: relative; }
.absolute { position: absolute; }

/* --- Effect Utilities --- */
.glass-effect {
    background: var(--bg-glass) !important;
    border: 1px solid rgba(231, 230, 230, 1); 
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
}

.hover-lift { transition: var(--transition-medium); }
.hover-lift:hover {
    transform: translateY(-3px);             
    box-shadow: var(--shadow-hover); 
}

.hover-slide-right {
    display: inline-block; 
    transition: transform 0.3s ease;
}
.hover-slide-right:hover {
    transform: translateX(5px);
}

/* =========================================
   4. COMPONENT CLASSES
   Complex logic that combines atoms.
   ========================================= */

/* --- Navigation --- */
.glass-nav {
    margin-top: 20px;
    width: 90%; max-width: 1200px;
    margin-left: auto; margin-right: auto;
    border-radius: 40px;
    padding-left: 2rem !important; padding-right: 2rem !important;
    z-index: 1050;
    background: var(--bg-glass) !important;
    border: 1px solid rgba(231, 230, 230, 1); 
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
}

.navbar-nav .nav-link {
    color: var(--color-brand-text);
    font-size: large; font-weight: 700;
    padding: 8px 20px !important; margin: 0 5px;
    border-radius: 50px; transition: var(--transition-medium);
}

.navbar-nav .nav-link:hover {
    background-color: rgba(13, 110, 253, 0.1); 
    color: var(--color-brand-dark); 
    transform: translateY(-3px); 
    text-shadow: 0 4px 8px rgba(13, 110, 253, 0.2);
}

.navbar-nav .nav-link.active {
    background-color: var(--color-brand-dark); color: white !important;
}

/* Desktop Dropdown Logic */
@media (min-width: 992px) {
    .service-dropdown { position: relative; }
    
    .service-dropdown::after {
        content: ''; position: absolute; top: 0; left: 0; 
        width: 100%; height: 200%; background: transparent; z-index: 10;
    }

    .service-dropdown:hover .glass-dropdown {
        opacity: 1; visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
    
    .glass-dropdown {
        display: block; position: absolute; 
        top: 100%; left: 50%;
        margin-top: 35px; min-width: 600px;
        border-radius: 25px; padding: 25px;
        opacity: 0; visibility: hidden;
        transform: translateX(-50%) translateY(10px);
        transition: var(--transition-fast) ease-out;
        z-index: 1000;
        background: #ffffff !important;
        border: 1px solid rgba(0, 0, 0, 0.05);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    }

    .glass-dropdown.dropdown-sm { min-width: 260px !important; width: auto !important; }
    
    .glass-dropdown.dropdown-sm .dropdown-grid-wrapper {
        grid-template-columns: 1fr !important; gap: 5px;
    }

    .dropdown-grid-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
    .dropdown-column { display: flex; flex-direction: column; gap: 2px; }
    
    .dropdown-header {
        color: var(--color-brand-dark);
        font-size: 0.85rem; text-transform: uppercase; font-weight: 800;
        margin-bottom: 15px; padding-left: 15px; opacity: 0.7; display: block;
    }

    .glass-dropdown .dropdown-item {
        color: var(--color-brand-text); font-weight: 600; padding: 8px 15px;
        border-radius: 10px; transition: var(--transition-fast); white-space: nowrap;
    }

    .glass-dropdown .dropdown-item:hover {
        background-color: rgba(236, 233, 233, 0.95);
        color: var(--color-brand-dark); transform: translateX(5px);
    }
    
    .dropdown-item.active, .dropdown-item:active {
        background-color: transparent !important;
        color: var(--color-brand-primary) !important;
        font-weight: 700;
    }
    
    .service-dropdown .nav-link { position: relative; z-index: 50; }
}

/* --- Hero Section --- */
.hero-header { position: relative; height: 100vh; overflow: hidden; }

.hero-header.hero-small {
    height: auto !important; min-height: 400px;
    padding-top: 120px; padding-bottom: 80px;
    background-color: var(--color-brand-light);
    background-image: none;
}

.hero-header.hero-small h1,
.hero-header.hero-small p {
    color: var(--color-brand-text) !important; text-shadow: none !important;
}

.hero-bg-img {
    position: fixed; top: 0; left: 0; width: 100%; object-fit: cover; z-index: -1;
}

.hero-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6));
    z-index: -1; 
}

/* --- Buttons --- */
.btn { flex: 0 0 auto; font-size: 1rem; padding: 10px 20px; border-radius: 50px; }

@media (min-width: 768px) {
    .btn { font-size: 1.1rem; padding: 12px 30px; }
}

.btn-glow {
    background: rgba(255, 255, 255, 0.2); 
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5); 
    color: white; font-weight: 600; transition: var(--transition-medium);
}

.btn-glow:hover {
    background: rgb(187, 181, 181); color: var(--color-brand-dark); border-color: white;
}

.btn-glow-dark {
    color: var(--color-brand-dark) !important;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-color: var(--color-brand-dark) !important;
    background: transparent !important;
}

.btn-glow-dark:hover {
    background: var(--color-brand-dark) !important;
    color: white !important;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(16, 60, 132, 0.3);
}

/* Floating Back to Top Button */
.back-to-top {
    position: fixed; bottom: 30px; right: 30px;
    width: 50px; height: 50px; z-index: 1000;
    opacity: 0; visibility: hidden;
    transform: translateY(20px); transition: all 0.4s ease;
    background-color: var(--color-brand-primary); 
    color: white;
}

.back-to-top.active { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover {
    background-color: var(--color-brand-dark); transform: translateY(-5px); color: white;
}

/* Filter Button (Gallery) */
.filter-btn.active {
    background-color: var(--color-brand-dark) !important;
    color: white !important;
    border-color: var(--color-brand-dark) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* --- Service Cards --- */
.service-card {
    position: relative; height: 400px; border-radius: 20px; overflow: hidden;        
    cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.card-img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; z-index: 0; transition: transform 0.5s ease;
}

.card-overlay {
    position: relative; z-index: 1;
    background: rgba(0, 0, 0, 0.4); 
    height: 100%; width: 100%;
    display: flex; flex-direction: column; justify-content: flex-end; 
    padding: 30px; color: white; transition: var(--transition-medium);
}

/* --- Gallery / Case Cards --- */
.case-card { transition: transform 0.3s ease; }
.case-card:hover { transform: translateY(-5px); }

.gallery-item { transition: all 0.4s ease-in-out; }

/* Before/After Badges */
.ba-badge {
    position: absolute; top: 15px; left: 15px;
    background: rgba(0,0,0,0.7); color: white;
    padding: 5px 12px; border-radius: 20px;
    font-size: 0.8rem; font-weight: bold; z-index: 2;
}
.ba-badge.after { left: auto; right: 15px; background: #28a745; }

/* Nav Pills (Gallery Filters) */
.nav-pills .nav-link {
    color: #555; background-color: #f8f9fa; border: 1px solid #dee2e6;
    margin: 0 5px; border-radius: 50px; padding: 10px 25px; font-weight: 600;
}
.nav-pills .nav-link.active {
    background-color: var(--color-brand-dark); color: white;
    border-color: var(--color-brand-dark);
}

/* --- Reviews / Carousel --- */
.profile-pic {
    width: 45px; height: 45px; border-radius: 50%; object-fit: cover; display: inline-block; 
}

.scrolling-wrapper {
    display: flex; flex-wrap: nowrap; gap: 24px; overflow-x: auto;  
    padding: 10px 5px; scroll-snap-type: x mandatory; scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; 
}
.scrolling-wrapper::-webkit-scrollbar { display: none; }

.scrolling-card {
    flex: 0 0 auto; width: 85%; max-width: 350px; scroll-snap-align: center; 
}

.scrolling-card .card { height: 100%; border-radius: 25px; overflow: hidden; }
.carousel-wrapper-relative { position: relative; overflow: hidden; }

/* --- Footer --- */
.footer-section {
    background-color: var(--color-brand-dark); 
    color: #fff; padding: 80px 0 30px 0; font-size: 0.95rem;
}

.footer-links li { margin-bottom: 12px; }
.footer-links a {
    color: rgba(255, 255, 255, 0.6); text-decoration: none; transition: var(--transition-medium);
}
.footer-links a:hover { color: var(--color-brand-primary); padding-left: 5px; }

/* --- Insurance Specific --- */
.insurance-item .p-4 {
    height: 180px; width: 100%; overflow: hidden; position: relative;
}
.insurance-item img {
    max-height: 100%; max-width: 100%; object-fit: contain;
}

/* =========================================
   5. ANIMATIONS & INTERACTIVE ELEMENTS
   ========================================= */
.scroll-prompt {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 15vh;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    color: white; z-index: 10;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    animation: flashZone 2s infinite ease-in-out alternate;
}

.arrow-bounce { font-size: 3rem; margin-top: 10px; font-weight: bold; animation: bounce 2s infinite; }
.arrow-bounce-horizontal { font-size: 2rem; animation: bounceRight 2s infinite; }

.scroll-prompt-right {
    position: absolute; top: 0; right: 0; height: 100%; width: 150px; 
    display: flex; align-items: center; justify-content: flex-end; padding-right: 20px;
    color: white; z-index: 10; pointer-events: none;
    background: linear-gradient(to left, rgba(0,0,0,0.1), transparent);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

@keyframes bounceRight {
    0%, 20%, 50%, 80%, 100% { transform: translateX(0); }
    40% { transform: translateX(-10px); }
    60% { transform: translateX(-5px); }
}

@keyframes flashZone {
    0% { opacity: 0.6; box-shadow: inset 0 -20px 30px rgba(0,0,0,0.5); }
    100% { opacity: 1; box-shadow: inset 0 -50px 80px rgba(0,0,0,0.9); }
}

/* =========================================
   6. MOBILE RESPONSIVE OVERRIDES
   ========================================= */
@media (max-width: 768px) {
    .glass-nav {
        width: 100%; border-radius: 0; top: 0; margin-top: 0; text-align: center;
        background: rgba(255, 255, 255, 0.95) !important;
    }

    .hero-header { height: auto !important; min-height: auto !important; display: block; }
    .hero-bg-img { position: relative; height: 100%; width: 100%; object-fit: initial; }
    
    .hero-content {
        position: absolute !important; top: 60% !important; left: 50% !important;
        transform: translate(-50%, -50%) !important; bottom: auto !important;      
        width: 90%; z-index: 2;
    }
    
    .hero-content h1 { font-size: 2rem; margin-bottom: 0.05rem; }
    .hero-content p { font-size: 1rem; margin-bottom: 1.5rem; }
    .scroll-prompt { display: none !important; }

    .service-card { height: 200px !important; border-radius: 15px; }
    .card-overlay { padding: 15px !important; justify-content: flex-end; }
    .card-overlay h3, .card-overlay h4 { font-size: 1.1rem; margin-bottom: 0; }
    
    .footer-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .footer-links li a { white-space: nowrap; }
    
    .scroll-prompt-right { width: 80px; background: linear-gradient(to left, rgba(0,0,0,0.4), transparent); }

    .mobile-glass-menu {
        max-height: 50vh; overflow-y: auto;
        background: rgba(231, 230, 230, 0.80);
        border: 1px solid rgba(231, 230, 230, 1);
        box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
    }
}

/* Hover-capable devices only */
@media (hover: hover) {
    .service-card:hover { transform: translateY(-5px); }
    .service-card:hover .card-overlay { background: rgba(0, 10, 50, 0.7); padding-bottom: 50px; }
    .service-card:hover .card-img { transform: scale(1.1); }
}

.accordion-item {
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 15px !important;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.accordion-button {
    font-weight: 700;
    color: var(--color-brand-dark);
    background-color: white;
    padding: 20px 25px;
}

.accordion-button:not(.collapsed) {
    color: var(--color-brand-primary);
    background-color: var(--bg-soft-blue);
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: rgba(0,0,0,0.1);
}

.accordion-body {
    color: var(--color-text-muted);
    line-height: 1.6;
    padding: 25px;
}

.blog-card-img {
    height: 240px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-img {
    transform: scale(1.05);
}

.category-badge {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-brand-primary);
}

.read-more-link {
    color: var(--color-brand-dark);
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
}

.read-more-link:hover {
    color: var(--color-brand-primary);
    transform: translateX(5px);
}