:root {
    --primary-color: #0c1222;
    --primary-light: #1e293b;
    --secondary-color: #3b82f6;
    --secondary-hover: #2563eb;
    --accent-color: #fbbf24;
    --accent-soft: rgba(251, 191, 36, 0.1);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --bg-light: #f8fafc;
    --bg-soft-blue: #f1f5f9;
    --white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08);
}

html,
body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    background-color: #f4f7fc; /* Sophisticated off-white background */
    line-height: 1.6;
    overflow-x: hidden !important;
    width: 100% !important;
    position: relative;
}

* {
    box-sizing: border-box;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: var(--primary-color);
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navbar */
.navbar {
    padding: 1.5rem 0;
    transition: var(--transition);
    background: transparent;
    z-index: 10000 !important; /* Extremely high to beat any decorators */
}

.navbar-toggler {
    z-index: 10001 !important;
    position: relative;
    border: none !important;
    padding: 10px !important;
}

.navbar-toggler-icon {
    width: 1.25em !important;
    height: 1.25em !important;
}

.navbar.scrolled {
    padding: 1rem 0;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
}

.navbar-brand img {
    transition: var(--transition);
}

.navbar.scrolled .navbar-brand img {
    height: 32px;
}

@media (max-width: 576px) {
    .navbar-brand img {
        height: 32px;
    }
    .navbar-brand .fs-4 {
        font-size: 1.25rem !important;
    }
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

.nav-link {
    font-weight: 500;
    color: var(--text-main) !important;
    margin: 0 1rem;
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: var(--secondary-color) !important;
}

.brand-text span:not(.text-gradient) {
    color: var(--primary-color);
}

.brand-text span[style] {
    color: #64748b !important;
}

/* Navbar icon fix - ensure toggler is visible if needed */
.navbar-toggler {
    border: none;
    padding: 8px; /* Restore padding to prevent "dubakna" */
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* Buttons */
.btn-premium {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e293b 100%);
    color: var(--white);
    padding: 0.5rem 1.5rem; /* Even smaller padding */
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem; /* Smaller font */
    transition: var(--transition);
    border: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    white-space: nowrap; /* Prevent wrapping */
}

.btn-premium:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    color: var(--white);
    background: linear-gradient(135deg, #1e293b 0%, var(--primary-color) 100%);
}

.btn-outline-premium {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem 1.5rem; /* Even smaller padding */
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem; /* Smaller font */
    transition: var(--transition);
    white-space: nowrap; /* Prevent wrapping */
}

.btn-outline-premium:hover {
    background: var(--primary-color);
    color: var(--white) !important;
    transform: translateY(-3px);
}

/* Hero Section */
.hero-section {
    padding: 160px 0 100px;
    background: radial-gradient(circle at 90% 10%, rgba(37, 99, 235, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 10% 90%, rgba(245, 158, 11, 0.05) 0%, transparent 40%);
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: var(--secondary-color);
    filter: blur(150px);
    opacity: 0.05;
    top: -100px;
    right: -100px;
    border-radius: 50%;
    z-index: -1;
}

.hero-img-container {
    position: relative;
    perspective: 1000px;
}

.hero-img {
    border-radius: 32px;
    box-shadow: 0 50px 100px -20px rgba(15, 23, 42, 0.25), 0 30px 60px -30px rgba(0, 0, 0, 0.3);
    transform: rotateY(-5deg) rotateX(2deg);
    transition: var(--transition);
}

@media (max-width: 991px) {
    .hero-img {
        transform: rotateY(0) rotateX(0);
        border-radius: 20px;
    }
}

.hero-img-container:hover .hero-img {
    transform: rotateY(0) rotateX(0) scale(1.02);
}

/* Stats Cards */
.stat-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05); /* Shadow Bordered */
    text-align: center;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.stat-card:hover,
.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
}

/* Service Cards */
.service-card {
    background: var(--white);
    padding: 2.5rem 2rem;
    border-radius: 24px;
    border: 1px solid rgba(0, 0, 0, 0.08); /* Shadow Bordered */
    transition: var(--transition);
    height: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 30px 60px -12px rgba(15, 23, 42, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    background: var(--white);
}

.service-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    margin-bottom: 2rem;
    font-size: 1.6rem;
    transition: var(--transition);
}

.service-card:hover .service-icon {
    background: var(--secondary-color);
    color: var(--white);
    transform: rotate(5deg) scale(1.1);
}

.service-card h4,
.service-card h5 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.service-card p {
    font-size: 0.875rem;
}

/* Footer */
footer {
    background: var(--primary-color);
    color: var(--white);
    padding: 80px 0 30px;
}

.footer-link {
    color: #cbd5e1;
    text-decoration: none;
    transition: var(--transition);
    display: block;
    margin-bottom: 0.5rem;
}

.footer-link:hover {
    color: var(--white);
    padding-left: 5px;
}

.social-icons a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--white);
    margin-right: 0.5rem;
    transition: var(--transition);
}

.social-icons a:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
    color: var(--white);
}

/* Features */
.feature-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.feature-icon {
    width: 24px;
    height: 24px;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    margin-right: 1rem;
    margin-top: 5px;
    flex-shrink: 0;
}

/* Section Title */
.section-tag {
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 2px;
    color: var(--secondary-color);
    display: block;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

/* Mega Menu Styling */
.mega-dropdown {
    position: relative;
}

.mega-menu {
    width: 750px;
    left: 50%;
    right: auto;
    transform: translateX(-50%) translateY(20px);
    margin-top: 15px;
    border-radius: 24px;
    overflow: hidden;
    display: none;
    opacity: 0;
    transition: var(--transition);
    box-shadow: 0 40px 80px -15px rgba(15, 23, 42, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.mega-dropdown:hover .mega-menu {
    display: block;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 991px) {
    .mega-menu {
        width: 100%;
        left: 0;
        transform: none;
        position: static;
        box-shadow: none;
        border: none !important;
        opacity: 1;
        display: none; /* Controlled by bootstrap collapse or d-block */
    }

    .mega-dropdown:hover .mega-menu {
        transform: none;
    }

    .mega-dropdown .show.mega-menu {
        display: block !important;
    }
}

.mega-menu-sidebar {
    width: 250px !important;
    background: #f8fafc !important;
    border-right: 1px solid #f1f5f9;
}

.mega-menu-sidebar .nav-link {
    border-radius: 10px;
    margin: 0;
    padding: 12px 20px;
    color: var(--text-main) !important;
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap !important;
}

.mega-menu-sidebar .nav-link.active {
    background-color: #000 !important;
    color: var(--white) !important;
}

.mega-menu-sidebar .nav-link:hover:not(.active) {
    background-color: #f1f5f9;
}

.mega-menu-content {
    min-width: 200px !important;
}

.mega-menu-content .dropdown-item {
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: var(--transition);
    padding: 10px 15px !important;
}

.mega-menu-content .dropdown-item:hover {
    color: #000;
    background: #f1f5f9;
    padding-left: 20px !important;
    font-weight: 600;
}

/* Decorative Bg Section */
.bg-colored-soft {
    background-color: #f6f9ff;
    position: relative;
}

.bg-colored-soft::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(var(--secondary-color) 0.5px, transparent 0.5px);
    background-size: 30px 30px;
    opacity: 0.1;
    pointer-events: none;
}

/* Universal Shadow Bordered Card Style */
.card, .calculator-result-card, .p-4.rounded-4.border.bg-white {
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05) !important;
    border-radius: 20px !important;
    transition: var(--transition);
}

.card:hover, .calculator-result-card:hover, .p-4.rounded-4.border.bg-white:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
}

@media (max-width: 991px) {
    .navbar {
        padding: 0.75rem 0 !important;
        background: var(--white) !important;
        box-shadow: var(--shadow-md);
        width: 100% !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        margin: 0 !important;
        z-index: 10000 !important;
    }

    .navbar .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
        display: flex !important;
        flex-wrap: wrap !important; /* Changed to wrap to allow menu to drop down */
        align-items: center !important;
        justify-content: space-between !important;
    }

    .navbar-brand {
        max-width: 70% !important;
        margin-right: 10px !important;
        overflow: hidden;
    }

    .brand-logo {
        height: 30px !important;
    }

    .navbar-collapse {
        flex-basis: 100%; /* Force full width on mobile */
        margin-top: 1rem;
        background: var(--white);
        padding: 1.5rem;
        border-radius: 20px;
        box-shadow: 0 20px 40px rgba(0,0,0,0.1);
        border: 1px solid rgba(0,0,0,0.05);
        max-height: 80vh; /* Limit height to 80% of screen */
        overflow-y: auto; /* Enable vertical scrolling */
        -webkit-overflow-scrolling: touch; /* Smooth scroll for iOS */
    }

    .nav-link {
        margin: 0.4rem 0;
        padding: 10px 15px !important;
        color: var(--text-main) !important;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }

    .mega-menu-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        background: transparent !important;
        padding: 1rem !important;
    }

    .mega-menu-sidebar .nav-link {
        border-bottom: none;
    }

    .mega-menu-content {
        padding: 1rem !important;
        background: transparent !important;
    }

    .dropdown-menu {
        background: var(--white) !important;
        border: 1px solid rgba(0,0,0,0.1) !important;
    }

    .dropdown-item {
        color: var(--text-muted) !important;
    }

    .dropdown-item:hover {
        background: var(--bg-soft-blue) !important;
        color: var(--text-main) !important;
    }
}

.form-control,
.form-select {
    border-radius: 12px;
    padding: 0.8rem 1.2rem;
    border: 1px solid #e2e8f0;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.text-white-50 {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Custom Utilities for templates */
.-space-x-2 {
    display: flex;
}
.-space-x-2 > * + * {
    margin-left: -0.5rem;
}

@media (max-width: 768px) {
    .hero-section {
        padding: 120px 0 60px;
        text-align: center;
    }

    .cta-container {
        padding: 2.5rem 1.5rem !important;
    }

    .hero-section .d-flex.align-items-center {
        justify-content: center;
        flex-direction: column;
        gap: 1rem !important;
    }

    .section-title {
        font-size: 1.75rem;
        line-height: 1.3;
    }

    .display-4 {
        font-size: 2.25rem;
        font-weight: 800;
    }

    .hero-section .lead {
        font-size: 1rem;
    }

    .hero-section .d-flex.flex-wrap {
        justify-content: center;
    }

    .section-title br {
        display: none;
    }

    .btn-premium.ms-lg-3 {
        padding: 0.6rem 1.2rem !important; /* Smaller mobile padding */
        font-size: 0.9rem !important;
        width: 100%;
        margin-top: 15px;
        display: block;
    }

    .stat-number-dark {
        font-size: 3.5rem;
    }

    .stat-title-dark {
        font-size: 1.1rem;
    }

    .stats-dark-section .section-title-white {
        font-size: 1.5rem;
        padding: 0 15px;
    }
}

/* Dark Stats Section */
.stats-dark-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    color: var(--white);
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.stats-dark-section::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    z-index: 0;
}

.stats-dark-section .container {
    position: relative;
    z-index: 1;
}

.stats-dark-section .section-title-white {
    color: var(--white);
    max-width: 850px;
    margin: 0 auto 60px;
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.4;
}

.stat-item-dark {
    text-align: center;
    padding: 30px;
    transition: var(--transition);
}

.stat-item-dark:hover {
    transform: translateY(-10px);
}

.stat-number-dark {
    font-size: 5rem;
    font-weight: 800;
    margin-bottom: 5px;
    display: block;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -2px;
}

.stat-title-dark {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 15px;
    display: block;
    color: var(--accent-color);
}

.stat-desc-dark {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

/* Tools Page Specialized UI */
.tool-sidebar-link {
    transition: var(--transition);
    border-radius: 12px !important;
    padding: 12px 20px !important;
    font-weight: 500;
    margin-bottom: 5px;
}

.tool-sidebar-link:hover {
    background: #f1f5f9;
    color: var(--secondary-color) !important;
    padding-left: 25px !important;
}

.tool-sidebar-link.active {
    background: var(--primary-color) !important;
    color: var(--white) !important;
    box-shadow: 0 10px 15px -3px rgba(12, 18, 34, 0.2);
}

.calculator-result-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.form-range::-webkit-slider-thumb {
    background: var(--secondary-color);
}

.form-range::-moz-range-thumb {
    background: var(--secondary-color);
}