/* ============================================
   LOCAL MARKETPLACE THEMING SYSTEM
   ============================================
   Bootstrap 5.3.3 variable overrides + custom design tokens
   Primary color (#00471F) matches the logo forest green
   Last updated: 2026-01-23
   ============================================ */

:root {
    /* ==========================================
       PRIMARY BRAND COLORS (from Logo)
       ========================================== */
    --brand-primary: #01aa49ff; /* Logo forest green - exact match */
    --brand-primary-hover: #01b972ff; /* Lighter hover state (+40% lightness) */
    --brand-primary-active: #01aa49ff; /* Darker active/pressed state (-20% lightness) */
    --brand-primary-light: #E8F5E9; /* Light tint for backgrounds */
    --brand-primary-dark: #002410; /* Darkest shade for emphasis */

    /* ==========================================
       BOOTSTRAP COLOR OVERRIDES
       ========================================== */
    /* Primary (Green Theme) */
    --bs-primary: var(--brand-primary);
    --bs-primary-rgb: 0, 71, 31; /* RGB for rgba() functions */
    --bs-primary-text-emphasis: var(--brand-primary-dark);
    --bs-primary-bg-subtle: var(--brand-primary-light);
    --bs-primary-border-subtle: #C8E6C9;

    /* Success (aligned with green theme) */
    --bs-success: #22C55E;
    --bs-success-rgb: 34, 197, 94;
    --bs-success-text-emphasis: #166534;
    --bs-success-bg-subtle: #DCFCE7;
    --bs-success-border-subtle: #BBF7D0;

    /* Danger */
    --bs-danger: #DC2626;
    --bs-danger-rgb: 220, 38, 38;
    --bs-danger-text-emphasis: #991B1B;
    --bs-danger-bg-subtle: #FEE2E2;
    --bs-danger-border-subtle: #FECACA;

    /* Warning */
    --bs-warning: #F59E0B;
    --bs-warning-rgb: 245, 158, 11;
    --bs-warning-text-emphasis: #92400E;
    --bs-warning-bg-subtle: #FEF3C7;
    --bs-warning-border-subtle: #FDE68A;

    /* Info */
    --bs-info: #06B6D4;
    --bs-info-rgb: 6, 182, 212;
    --bs-info-text-emphasis: #164E63;
    --bs-info-bg-subtle: #CFFAFE;
    --bs-info-border-subtle: #A5F3FC;

    /* Secondary (gray tones) */
    --bs-secondary: #6B7280;
    --bs-secondary-rgb: 107, 114, 128;
    --bs-secondary-text-emphasis: #374151;
    --bs-secondary-bg-subtle: #F3F4F6;
    --bs-secondary-border-subtle: #D1D5DB;

    /* Light/Dark */
    --bs-light: #F9FAFB;
    --bs-light-rgb: 249, 250, 251;
    --bs-dark: #1F2937;
    --bs-dark-rgb: 31, 41, 55;

    /* Body colors */
    --bs-body-color: #1F2937; /* Dark text */
    --bs-body-bg: #FFFFFF;
    --bs-secondary-color: #6B7280; /* Muted text */
    --bs-secondary-bg: #F9FAFB;
    --bs-tertiary-color: #9CA3AF;
    --bs-tertiary-bg: #F3F4F6;

    /* Link colors */
    --bs-link-color: var(--brand-primary);
    --bs-link-hover-color: var(--brand-primary-hover);
    --bs-link-color-rgb: 0, 71, 31;
    --bs-link-hover-color-rgb: 0, 107, 45;

    /* Border colors */
    --bs-border-color: #E5E7EB;
    --bs-border-color-translucent: rgba(0, 0, 0, 0.075);

    /* Focus/Active states */
    --bs-focus-ring-width: 0.25rem;
    --bs-focus-ring-opacity: 0.25;
    --bs-focus-ring-color: rgba(0, 71, 31, 0.25);

    /* Form controls */
    --bs-form-valid-color: #22C55E;
    --bs-form-valid-border-color: #22C55E;
    --bs-form-invalid-color: #DC2626;
    --bs-form-invalid-border-color: #DC2626;

    /* ==========================================
       CUSTOM DESIGN TOKENS
       ========================================== */

    /* Grays (consistent scale for design system) */
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* Semantic Colors */
    --color-text-primary: var(--gray-900);
    --color-text-secondary: var(--gray-600);
    --color-text-muted: var(--gray-500);
    --color-text-disabled: var(--gray-400);
    --color-bg-primary: #FFFFFF;
    --color-bg-secondary: var(--gray-50);
    --color-bg-tertiary: var(--gray-100);
    --color-border: var(--gray-200);
    --color-border-strong: var(--gray-300);
    --color-overlay: rgba(0, 0, 0, 0.5);

    /* Card shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.15);
    --shadow-focus: 0 0 0 3px var(--bs-focus-ring-color);

    /* ==========================================
       TYPOGRAPHY TOKENS
       ========================================== */

    /* Font families (Arimo-like stack from Figma) */
    --font-family-base: "Arimo", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --font-family-headings: var(--font-family-base);
    --font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

    /* Font sizes */
    --font-size-xs: 0.75rem; /* 12px */
    --font-size-sm: 0.875rem; /* 14px */
    --font-size-base: 1rem; /* 16px */
    --font-size-lg: 1.125rem; /* 18px */
    --font-size-xl: 1.25rem; /* 20px */
    --font-size-2xl: 1.5rem; /* 24px */
    --font-size-3xl: 1.875rem; /* 30px */
    --font-size-4xl: 2.25rem; /* 36px */
    --font-size-5xl: 3rem; /* 48px */

    /* Font weights */
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;

    /* Line heights */
    --line-height-none: 1;
    --line-height-tight: 1.25;
    --line-height-snug: 1.375;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
    --line-height-loose: 2;

    /* Letter spacing */
    --letter-spacing-tighter: -0.05em;
    --letter-spacing-tight: -0.025em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.025em;
    --letter-spacing-wider: 0.05em;
    --letter-spacing-widest: 0.1em;

    /* ==========================================
       SPACING TOKENS
       ========================================== */

    /* Spacing scale (matches Bootstrap but explicit) */
    --spacing-0: 0;
    --spacing-px: 1px;
    --spacing-0-5: 0.125rem; /* 2px */
    --spacing-1: 0.25rem; /* 4px */
    --spacing-1-5: 0.375rem; /* 6px */
    --spacing-2: 0.5rem; /* 8px */
    --spacing-2-5: 0.625rem; /* 10px */
    --spacing-3: 0.75rem; /* 12px */
    --spacing-3-5: 0.875rem; /* 14px */
    --spacing-4: 1rem; /* 16px */
    --spacing-5: 1.25rem; /* 20px */
    --spacing-6: 1.5rem; /* 24px */
    --spacing-7: 1.75rem; /* 28px */
    --spacing-8: 2rem; /* 32px */
    --spacing-9: 2.25rem; /* 36px */
    --spacing-10: 2.5rem; /* 40px */
    --spacing-11: 2.75rem; /* 44px */
    --spacing-12: 3rem; /* 48px */
    --spacing-14: 3.5rem; /* 56px */
    --spacing-16: 4rem; /* 64px */
    --spacing-20: 5rem; /* 80px */
    --spacing-24: 6rem; /* 96px */
    --spacing-32: 8rem; /* 128px */

    /* ==========================================
       BORDER TOKENS
       ========================================== */

    /* Border radius */
    --radius-none: 0;
    --radius-sm: 0.125rem; /* 2px */
    --radius-base: 0.25rem; /* 4px - Bootstrap default */
    --radius-md: 0.375rem; /* 6px */
    --radius-lg: 0.5rem; /* 8px */
    --radius-xl: 0.75rem; /* 12px */
    --radius-2xl: 1rem; /* 16px */
    --radius-3xl: 1.5rem; /* 24px */
    --radius-full: 9999px; /* Pill shape */

    /* Border widths */
    --border-width-0: 0;
    --border-width-thin: 1px;
    --border-width-base: 1px;
    --border-width-thick: 2px;
    --border-width-thicker: 4px;

    /* ==========================================
       COMPONENT-SPECIFIC TOKENS
       ========================================== */

    /* Buttons */
    --btn-border-radius: var(--radius-base);
    --btn-border-radius-sm: var(--radius-sm);
    --btn-border-radius-lg: var(--radius-md);
    --btn-padding-x: 0.75rem;
    --btn-padding-y: 0.375rem;
    --btn-padding-x-sm: 0.5rem;
    --btn-padding-y-sm: 0.25rem;
    --btn-padding-x-lg: 1rem;
    --btn-padding-y-lg: 0.5rem;
    --btn-font-weight: var(--font-weight-medium);

    /* Cards */
    --card-border-radius: var(--radius-lg);
    --card-border-width: var(--border-width-base);
    --card-border-color: var(--color-border);
    --card-box-shadow: var(--shadow-sm);
    --card-bg: var(--color-bg-primary);
    --card-spacer-y: 1rem;
    --card-spacer-x: 1rem;

    /* Inputs */
    --input-border-radius: var(--radius-base);
    --input-border-width: var(--border-width-base);
    --input-border-color: var(--color-border);
    --input-focus-border-color: var(--brand-primary);
    --input-focus-ring: var(--bs-focus-ring-color);
    --input-bg: var(--color-bg-primary);
    --input-disabled-bg: var(--gray-100);
    --input-padding-x: 0.75rem;
    --input-padding-y: 0.375rem;

    /* Badges */
    --badge-border-radius: var(--radius-base);
    --badge-padding-x: 0.5rem;
    --badge-padding-y: 0.25rem;
    --badge-font-size: var(--font-size-xs);
    --badge-font-weight: var(--font-weight-medium);

    /* Modals */
    --modal-content-border-radius: var(--radius-lg);
    --modal-content-box-shadow: var(--shadow-xl);
    --modal-backdrop-bg: var(--color-overlay);

    /* Tooltips */
    --tooltip-border-radius: var(--radius-base);
    --tooltip-bg: var(--gray-900);
    --tooltip-opacity: 0.9;

    /* Dropdowns */
    --dropdown-border-radius: var(--radius-md);
    --dropdown-border-color: var(--color-border);
    --dropdown-box-shadow: var(--shadow-lg);

    /* ==========================================
       TRANSITIONS & ANIMATIONS
       ========================================== */

    /* Transition durations */
    --transition-faster: 100ms;
    --transition-fast: 150ms;
    --transition-base: 200ms;
    --transition-slow: 300ms;
    --transition-slower: 500ms;

    /* Transition timing functions */
    --ease-linear: linear;
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-index scale */
    --z-index-dropdown: 1000;
    --z-index-sticky: 1020;
    --z-index-fixed: 1030;
    --z-index-modal-backdrop: 1040;
    --z-index-modal: 1050;
    --z-index-popover: 1060;
    --z-index-tooltip: 1070;
}

/* ==========================================
   RESPONSIVE TYPOGRAPHY & GLOBAL STYLES
   ========================================== */

html {
    font-size: 16px;
}

body {
    font-family: var(--font-family-base);
    font-size: 16px;
    line-height: 1.5;
    color: var(--gray-900);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Heading styles (matching Figma design principles) */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-family-headings);
    font-weight: 400;
    line-height: 1.3;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

h1, .h1 {
    font-size: 2.5rem; /* 40px */
    line-height: 1.2;
}

h2, .h2 {
    font-size: 2rem; /* 32px */
    line-height: 1.25;
}

h3, .h3 {
    font-size: 1.5rem; /* 24px */
    line-height: 1.3;
}

h4, .h4 {
    font-size: 1.25rem; /* 20px */
    line-height: 1.4;
}

h5, .h5 {
    font-size: 1.125rem; /* 18px */
    line-height: 1.5;
}

h6, .h6 {
    font-size: 1rem; /* 16px */
    line-height: 1.5;
}

/* Paragraph and text styles */
p {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.5;
}

.lead {
    font-size: 1.25rem;
    font-weight: 300;
    line-height: 1.6;
}

small, .small {
    font-size: 0.875rem; /* 14px */
    line-height: 1.4;
}

@media (max-width: 767px) {
    h1, .h1 {
        font-size: 2rem;
    }

    h2, .h2 {
        font-size: 1.75rem;
    }

    h3, .h3 {
        font-size: 1.375rem;
    }
}

/* ==========================================
   UTILITY CLASSES (Optional enhancements)
   ========================================== */

/* Smooth transitions for interactive elements */
a,
button,
.btn,
.form-control,
.form-select,
.card {
    transition-duration: var(--transition-fast);
    transition-timing-function: var(--ease-in-out);
}

/* Focus visible for accessibility */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* Custom scrollbar (webkit browsers) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* ==========================================
   BOOTSTRAP COMPONENT OVERRIDES
   ==========================================

   Bootstrap's precompiled CSS has hardcoded colors.
   These overrides force Bootstrap components to use
   our custom CSS variables.
   ========================================== */

/* Buttons */
.btn-primary {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--brand-primary-hover) !important;
    border-color: var(--brand-primary-hover) !important;
}

.btn-primary:active,
.btn-primary.active {
    background-color: var(--brand-primary-active) !important;
    border-color: var(--brand-primary-active) !important;
}

.btn-outline-primary {
    color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
}

.btn-outline-primary:hover {
    background-color: var(--brand-primary-hover) !important;
    border-color: var(--brand-primary-hover) !important;
    color: white !important;
}

.btn-outline-primary:active,
.btn-outline-primary.active,
.btn-outline-primary.show,
.btn-outline-primary:focus {
    background-color: var(--brand-primary-active) !important;
    border-color: var(--brand-primary-active) !important;
    color: white !important;
}

/* Links */
a {
    color: var(--bs-link-color);
}

a:hover {
    color: var(--bs-link-hover-color);
}

/* Badges */
.badge.bg-primary {
    background-color: var(--bs-primary) !important;
}

/* Alerts */
.alert-primary {
    background-color: var(--bs-primary-bg-subtle) !important;
    border-color: var(--bs-primary-border-subtle) !important;
    color: var(--bs-primary-text-emphasis) !important;
}

/* Text colors */
.text-primary {
    color: var(--bs-primary) !important;
}

/* Background colors */
.bg-primary {
    background-color: var(--bs-primary) !important;
}

/* Border colors */
.border-primary {
    border-color: var(--bs-primary) !important;
}

/* Form controls focus */
.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color);
}

/* Nav pills */
.nav-pills .nav-link.active {
    background-color: var(--bs-primary) !important;
}

/* Pagination */
.pagination .page-link {
    color: var(--bs-primary);
}

.pagination .page-item.active .page-link {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
}

/* Progress bars */
.progress-bar {
    background-color: var(--bs-primary) !important;
}

/* List group */
.list-group-item.active {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
}