/* ==========================================================================
   Custom Properties
   ========================================================================== */
:root {
    /* Font Families */
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    
    /* Colors - Primary */
    --bs-primary: #34509c;
    --bs-primary-rgb: 52, 80, 156;
    --bs-primary-subtle: #eceef6;

    /* Colors - Accent */
    --bs-accent: #ea1f63;
    --bs-accent-rgb: 234, 31, 99;
    --bs-accent-subtle: #fee5ed;

    /* Colors - Grays */
    --bs-gray-100: #f8f9fa;
    --bs-gray-200: #e9ecef;
    --bs-gray-300: #dee2e6;
    --bs-gray-400: #ced4da;
    --bs-gray-500: #adb5bd;
    --bs-gray-600: #6c757d;
    --bs-gray-700: #495057;
    --bs-gray-800: #343a40;

    /* Text & Borders */
    --bs-body-color: var(--bs-gray-700);
    --bs-heading-color: var(--bs-primary);
    --bs-secondary-color: #566174; /* Enhanced contrast */
    --bs-border-color: var(--bs-gray-200);

    /* Font Sizes */
    --fs-display: clamp(2.5rem, 5vw, 3.5rem);
    --fs-h1: clamp(2rem, 4vw, 2.5rem);
    --fs-h2: clamp(1.75rem, 3vw, 2rem);
    --fs-lead: clamp(1.125rem, 2vw, 1.25rem);
    --fs-body: 1rem;
    --fs-small: 0.875rem;

    /* Font Weights */
    --fw-light: 300;
    --fw-normal: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --fw-extrabold: 800;

    /* Line Heights */
    --lh-heading: 1.2;
    --lh-body: 1.6;
    --lh-tight: 1.1;
    --lh-relaxed: 1.8;

    /* Letter Spacing */
    --ls-heading: -0.02em;
    --ls-body: 0;
    --ls-wide: 0.05em;

    /* Spacing */
    --space-xs: 0.5rem;   /* 8px */
    --space-sm: 1rem;     /* 16px */
    --space-md: 1.5rem;   /* 24px */
    --space-lg: 2rem;     /* 32px */
    --space-xl: 3rem;     /* 48px */
    --space-2xl: 4rem;    /* 64px */

    /* Other */
    --transition-base: 0.2s ease-in-out;
    --navbar-height: 64px;
    --container-padding: clamp(1.5rem, 5vw, 3rem);
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-body);
    font-weight: var(--fw-normal);
    line-height: var(--lh-body);
    color: var(--bs-body-color);
    font-size: var(--fs-body);
    letter-spacing: var(--ls-body);
    font-feature-settings: "kern" 1, "liga" 1;
}

/* Headings Typography */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-heading);
    font-weight: var(--fw-bold);
    line-height: var(--lh-heading);
    letter-spacing: var(--ls-heading);
    color: var(--bs-heading-color);
    margin-top: 0;
    margin-bottom: 0.5em;
    font-feature-settings: "kern" 1, "liga" 1, "ss01" 1; /* Inter's special features */
}

/* Specific heading weights */
h1, .h1 {
    font-weight: var(--fw-extrabold);
}

h2, .h2 {
    font-weight: var(--fw-bold);
}

h3, .h3 {
    font-weight: var(--fw-semibold);
}

h4, h5, h6, .h4, .h5, .h6 {
    font-weight: var(--fw-medium);
}

/* Paragraph and text elements */
p {
    margin-top: 0;
    margin-bottom: 1rem;
    font-family: var(--font-body);
    line-height: var(--lh-body);
}

/* Strong and bold */
strong, b {
    font-weight: var(--fw-semibold);
}

/* Links */
a {
    font-family: var(--font-body);
    text-decoration: underline;
    text-underline-offset: 0.2em;
    transition: all var(--transition-base);
}

a:hover {
    text-underline-offset: 0.3em;
}

/* Code and preformatted text */
code, kbd, pre, samp {
    font-family: var(--font-mono);
    font-size: 0.875em;
}

/* Blockquotes */
blockquote {
    font-family: var(--font-body);
    font-style: italic;
    font-weight: var(--fw-light);
    font-size: 1.125rem;
    line-height: var(--lh-relaxed);
    margin: 1.5rem 0;
    padding-left: 1.5rem;
    border-left: 4px solid var(--bs-primary);
}

img {
    max-width: 100%;
    height: auto;
}

svg {
    fill: currentColor;
}

/* Focus styles for accessibility */
:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* ==========================================================================
   Typography Classes
   ========================================================================== */
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-family: var(--font-heading);
    font-weight: var(--fw-extrabold);
    line-height: var(--lh-tight);
    letter-spacing: -0.03em;
}

.display-4 {
    font-size: var(--fs-display);
}

h1, .h1 {
    font-size: var(--fs-h1);
}

h2, .h2 {
    font-size: var(--fs-h2);
    clear: both;
}

.lead {
    font-size: var(--fs-lead);
    font-weight: var(--fw-light);
    line-height: var(--lh-relaxed);
}

.small {
    font-size: var(--fs-small);
}

/* Font weight utilities */
.fw-light { font-weight: var(--fw-light) !important; }
.fw-normal { font-weight: var(--fw-normal) !important; }
.fw-medium { font-weight: var(--fw-medium) !important; }
.fw-semibold { font-weight: var(--fw-semibold) !important; }
.fw-bold { font-weight: var(--fw-bold) !important; }
.fw-extrabold { font-weight: var(--fw-extrabold) !important; }

/* Font family utilities */
.font-heading { font-family: var(--font-heading) !important; }
.font-body { font-family: var(--font-body) !important; }
.font-mono { font-family: var(--font-mono) !important; }

/* Text transform utilities */
.text-uppercase {
    text-transform: uppercase !important;
    letter-spacing: var(--ls-wide);
    font-weight: var(--fw-semibold);
}

/* ==========================================================================
   Layout & Container
   ========================================================================== */
.container-xxl {
    padding-inline: var(--container-padding);
}

/* ==========================================================================
   Navigation
   ========================================================================== */
/* Navbar fixes */
.navbar {
    position: relative;
    z-index: 1030;
    height: auto;
    min-height: var(--navbar-height);
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.95));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-family: var(--font-body);
    transition: all 0.3s ease;
}

.navbar.shadow-sm {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    font-family: var(--font-heading);
    font-weight: var(--fw-bold);
    letter-spacing: var(--ls-heading);
    color: var(--bs-primary);
    transition: transform 0.2s ease;
}

.navbar-brand:hover {
    transform: translateX(5px);
    color: var(--bs-primary);
}

.navbar-brand span {
    background: linear-gradient(135deg, var(--bs-primary) 0%, #5668b3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-nav .nav-link {
    font-family: var(--font-body);
    font-weight: var(--fw-medium);
    color: var(--bs-gray-700);
    position: relative;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem !important;
    margin: 0 0.25rem;
    border-radius: 0.5rem;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--bs-primary) 0%, var(--bs-accent) 100%);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover {
    color: var(--bs-primary);
    background-color: rgba(52, 80, 156, 0.05);
}

.navbar-nav .nav-link:hover::after {
    width: 80%;
}

.navbar-nav .nav-link.active {
    color: var(--bs-primary);
    background-color: rgba(52, 80, 156, 0.1);
}

.navbar-toggler {
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.navbar-toggler:hover {
    background: rgba(52, 80, 156, 0.1);
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-collapse {
    background-color: var(--bs-white);
}

@media (max-width: 991.98px) {
    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 1rem;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
        margin: 0.25rem 0;
    }
    
    .navbar-collapse.show,
    .navbar-collapse.collapsing {
        margin-bottom: 1rem;
    }
    
    /* Add spacing to content below navbar when menu is expanded */
    .navbar-collapse.show + * {
        margin-top: var(--navbar-height);
    }
}

/* ==========================================================================
   Icons
   ========================================================================== */
.feature-icon {
    width: 24px;
    height: 24px;
}

.icon-sm {
    width: 16px;
    height: 16px;
}

.feature-icon,
.icon-sm {
    fill: currentColor;
    flex-shrink: 0;
}

/* ==========================================================================
   Footer - Using Primary Color Background
   ========================================================================== */
footer,
.footer-primary {
    background-color: var(--bs-primary) !important;
    color: rgba(255, 255, 255, 0.9);
    font-family: var(--font-body);
}

/* Footer Nested Flex Layout - 5 Column Grid System */
.footer-flex-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Footer Text Section - Spans 2 of 5 columns on desktop */
.footer-text-section {
    flex: 0 0 100%;
}

/* Footer Menu Section - Spans 3 of 5 columns on desktop */
.footer-menu-section {
    flex: 0 0 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

/* Each menu column - equally distributed within menu section */
.footer-menu-column {
    flex: 1 1 200px;
    min-width: 0;
}

/* Tablet layout */
@media (min-width: 768px) and (max-width: 991px) {
    .footer-text-section {
        flex: 0 0 100%;
    }
    
    .footer-menu-section {
        flex: 0 0 100%;
        gap: 1.5rem;
    }
    
    .footer-menu-column {
        flex: 1 1 calc(33.333% - 1rem);
    }
}

/* Desktop layout */
@media (min-width: 992px) {
    .footer-flex-wrapper {
        gap: 3rem;
    }
    
    .footer-text-section {
        flex: 0 0 calc(40% - 1.5rem);
    }
    
    .footer-menu-section {
        flex: 0 0 calc(60% - 1.5rem);
        gap: 2rem;
    }
    
    .footer-menu-column {
        flex: 1 1 0;
    }
}

/* Large desktop */
@media (min-width: 1200px) {
    .footer-flex-wrapper {
        gap: 4rem;
    }
    
    .footer-text-section {
        flex: 0 0 calc(40% - 2rem);
    }
    
    .footer-menu-section {
        flex: 0 0 calc(60% - 2rem);
        gap: 3rem;
    }
}

/* Extra large desktop - maximum spacing */
@media (min-width: 1400px) {
    .footer-flex-wrapper {
        gap: 5rem;
    }
    
    .footer-text-section {
        flex: 0 0 calc(40% - 2.5rem);
        padding-right: 2rem;
    }
    
    .footer-menu-section {
        flex: 0 0 calc(60% - 2.5rem);
        gap: 3rem;
    }
}

/* Footer headings */
footer h3,
footer .h5,
footer h4,
.footer-primary h3,
.footer-primary .h5 {
    color: #fff !important;
    font-family: var(--font-heading);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-heading);
}

/* Footer text */
footer p,
footer .text-secondary,
.footer-primary p,
.footer-primary .text-secondary {
    color: rgba(255, 255, 255, 0.8) !important;
    font-family: var(--font-body);
}

/* Footer small text */
footer .small,
.footer-primary .small {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Footer links */
.footer-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color var(--transition-base);
    padding: var(--space-xs) 0;
    font-size: 0.875rem;
    font-family: var(--font-body);
}

.footer-link:hover {
    color: #fff;
    text-decoration: underline;
}

/* Footer list links */
footer ul a,
.footer-primary ul a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color var(--transition-base);
    font-family: var(--font-body);
}

footer ul a:hover,
.footer-primary ul a:hover {
    color: #fff;
}

/* Footer borders */
footer .border-top,
.footer-primary .border-top {
    border-top-color: rgba(255, 255, 255, 0.2) !important;
}

/* Language link styles for footer */
footer .language-link,
.footer-primary .language-link {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    text-decoration: none;
    transition: all var(--transition-base);
    color: rgba(255, 255, 255, 0.9);
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
    font-family: var(--font-body);
}

footer .language-link:hover,
.footer-primary .language-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

footer .language-link.active,
.footer-primary .language-link.active {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    font-weight: var(--fw-medium);
}

footer .language-link img,
.footer-primary .language-link img {
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    vertical-align: middle;
}

/* Language dropdown in footer */
footer .dropdown-toggle,
.footer-primary .dropdown-toggle {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
    font-family: var(--font-body);
}

footer .dropdown-toggle:hover,
footer .dropdown-toggle:focus,
.footer-primary .dropdown-toggle:hover,
.footer-primary .dropdown-toggle:focus {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

/* Language switcher container adjustments */
footer .d-flex.flex-wrap.gap-3,
.footer-primary .d-flex.flex-wrap.gap-3 {
    gap: 0.75rem !important; /* Adjusted from default gap-3 */
}

@media (max-width: 767px) {
    footer .language-link,
    .footer-primary .language-link {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
    
    footer .language-link img,
    .footer-primary .language-link img {
        width: 20px;
        height: 15px;
    }
    
    footer .d-flex.flex-wrap.gap-3,
    .footer-primary .d-flex.flex-wrap.gap-3 {
        gap: 0.5rem !important;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    footer .d-flex.flex-wrap.gap-3,
    .footer-primary .d-flex.flex-wrap.gap-3 {
        gap: 0.625rem !important;
    }
}

/* Dropdown menu in footer */
footer .dropdown-menu,
.footer-primary .dropdown-menu {
    background-color: #fff;
    border: 1px solid var(--bs-gray-200);
}

footer .dropdown-item,
.footer-primary .dropdown-item {
    color: var(--bs-gray-700);
    font-family: var(--font-body);
}

footer .dropdown-item:hover,
footer .dropdown-item:focus,
.footer-primary .dropdown-item:hover,
.footer-primary .dropdown-item:focus {
    background-color: var(--bs-primary-subtle);
    color: var(--bs-primary);
}

footer .dropdown-item.active,
.footer-primary .dropdown-item.active {
    background-color: var(--bs-primary);
    color: #fff;
}

/* ==========================================================================
   Section Backgrounds
   ========================================================================== */
.cta {
    background-color: #edf3ff;
}

/* ==========================================================================
   Section Separator
   ========================================================================== */
.section-separator {
    position: relative;
    padding: var(--space-md) 0;
}

.separator-line {
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        var(--bs-gray-300) 20%,
        var(--bs-gray-300) 80%,
        transparent
    );
}

/* ==========================================================================
   Alert Boxes
   ========================================================================== */
/* Base alert box styles */
.alert-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: none;
    border-left: 4px solid #0d6efd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
    font-family: var(--font-body);
}

.alert-box:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.alert-box .alert-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    font-size: 1.25rem;
    font-weight: var(--fw-bold);
    font-family: var(--font-heading);
    color: #1e293b;
    margin-bottom: 1.25rem;
    padding-bottom: 0.875rem;
    border-bottom: 2px solid #e2e8f0;
}

.alert-box .alert-header i,
.alert-box .alert-header .bi {
    color: #0d6efd;
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Alert Tip - Green/Success theme */
.alert-box.alert-tip {
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
    border-left-color: #16a34a;
}

.alert-box.alert-tip .alert-header {
    border-bottom-color: #bbf7d0;
}

.alert-box.alert-tip .alert-header i,
.alert-box.alert-tip .alert-header .bi {
    color: #16a34a;
}

/* Alert Info - Blue theme (default) */
.alert-box.alert-info {
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
    border-left-color: #0d6efd;
}

.alert-box.alert-info .alert-header {
    border-bottom-color: #bfdbfe;
}

.alert-box.alert-info .alert-header i,
.alert-box.alert-info .alert-header .bi {
    color: #0d6efd;
}

/* Alert Warning - Yellow/Orange theme */
.alert-box.alert-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
    border-left-color: #f59e0b;
}

.alert-box.alert-warning .alert-header {
    border-bottom-color: #fde68a;
}

.alert-box.alert-warning .alert-header i,
.alert-box.alert-warning .alert-header .bi {
    color: #f59e0b;
}

/* Alert Important - Red/Danger theme */
.alert-box.alert-important {
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
    border-left-color: #dc2626;
}

.alert-box.alert-important .alert-header {
    border-bottom-color: #fecaca;
}

.alert-box.alert-important .alert-header i,
.alert-box.alert-important .alert-header .bi {
    color: #dc2626;
}