/*
 * SmartBuild Design System v2.0
 * AODA-compliant design framework for construction project management
 * Based on FINAL_DESIGN_SPEC_002.md
 *
 * Features:
 * - Dual-mode support (dark/light) with smooth transitions
 * - WCAG AA/AAA compliant color contrasts
 * - Montserrat typography system
 * - Comprehensive component library
 * - 8px spacing system
 */


/* ============================================================================
   CSS VARIABLES - DARK/LIGHT MODE COLORS
   ============================================================================ */

:root {
    /* Default to light mode */
    --mode: 'light';
    /* Light Mode Colors */
    --sb-bg-primary: #FFFFFF;
    --sb-bg-secondary: #F5F7FA;
    --sb-accent-primary: #00B2E3;
    --sb-accent-secondary: #76A3B2;
    --sb-text-primary: #0F1419;
    --sb-text-secondary: #76777A;
    --sb-border-color: #E1E4E8;
    --sb-btn-primary: #00B2E3;
    --sb-btn-secondary: #006998;
    --sb-error: #FF5F5F;
    --sb-warning: #FFA726;
    --sb-success: #2BB8A6;
    /* Shadow values for light mode */
    --sb-shadow-sm: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.1);
    --sb-shadow-md: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.1);
    --sb-shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    /* Transition timing */
    --sb-transition-fast: 200ms ease;
    --sb-transition-normal: 300ms ease;
}

/* Dark Mode Colors */
[data-theme="dark"] {
    --mode: 'dark';
    --sb-bg-primary: #0F1419;
    --sb-bg-secondary: #1F2C35;
    --sb-accent-primary: #00B2E3;
    --sb-accent-secondary: #76A3B2;
    --sb-text-primary: #FFFFFF;
    --sb-text-secondary: #76777A;
    --sb-border-color: #2E3A44;
    --sb-btn-primary: #00B2E3;
    --sb-btn-secondary: #006998;
    --sb-error: #FF5F5F;
    --sb-warning: #FFA726;
    --sb-success: #2BB8A6;
    /* Shadow values for dark mode */
    --sb-shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.3);
    --sb-shadow-md: 0 4px 6px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.3);
    --sb-shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
}

/* Smooth transitions for theme switching */
* {
    transition: background-color var(--sb-transition-normal), color var(--sb-transition-normal), border-color var(--sb-transition-normal), box-shadow var(--sb-transition-normal);
}

    /* Disable transitions on elements that shouldn't animate */
    *:focus,
    *:active,
    .no-transition {
        transition: none;
    }

/* ============================================================================
   BASE STYLES
   ============================================================================ */

body {
    background-color: var(--sb-bg-primary);
    color: var(--sb-text-primary);
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    font-weight: 400;
    margin: 0;
    padding: 0;
}

/* ============================================================================
   TYPOGRAPHY SCALE
   ============================================================================ */

h1, .h1 {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--sb-text-primary);
    margin-bottom: 1rem;
}

h2, .h2 {
    font-size: 36px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--sb-text-primary);
    margin-bottom: 0.875rem;
}

h3, .h3 {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--sb-text-primary);
    margin-bottom: 0.75rem;
}

h4, .h4 {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--sb-text-primary);
    margin-bottom: 0.75rem;
}

h5, .h5 {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--sb-text-primary);
    margin-bottom: 0.5rem;
}

h6, .h6 {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--sb-text-primary);
    margin-bottom: 0.5rem;
}

p {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--sb-text-primary);
    margin-bottom: 1rem;
}

.text-large {
    font-size: 18px;
    font-weight: 400;
    line-height: 1.6;
}

.text-small {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
}

.text-caption {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    color: var(--sb-text-secondary);
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    border-radius: 8px;
    padding: 12px 24px;
    transition: all var(--sb-transition-fast);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

    /* Primary Button - High specificity to override Bootstrap */
    .btn-primary,
    .sb-btn-primary,
    .btn.btn-primary,
    .btn.sb-btn-primary {
        background-color: var(--sb-btn-primary) !important;
        color: #FFFFFF !important;
        border-color: var(--sb-btn-primary) !important;
        box-shadow: 0 4px 12px rgba(0, 178, 227, 0.3);
    }

        .btn-primary:hover,
        .sb-btn-primary:hover,
        .btn.btn-primary:hover,
        .btn.sb-btn-primary:hover,
        .btn-primary:focus,
        .sb-btn-primary:focus,
        .btn.btn-primary:focus,
        .btn.sb-btn-primary:focus,
        .btn-primary:active,
        .sb-btn-primary:active,
        .btn.btn-primary:active,
        .btn.sb-btn-primary:active {
            background-color: var(--sb-btn-secondary) !important;
            color: #FFFFFF !important;
            border-color: var(--sb-btn-secondary) !important;
            opacity: 0.9;
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0, 103, 160, 0.4);
        }

    /* Secondary Button - Filled */
    .btn-secondary,
    .btn.btn-secondary {
        background-color: var(--sb-btn-secondary) !important;
        border-color: var(--sb-btn-secondary) !important;
        color: #FFFFFF !important;
    }

        .btn-secondary:hover,
        .btn.btn-secondary:hover,
        .btn-secondary:focus,
        .btn.btn-secondary:focus {
            background-color: var(--sb-btn-primary) !important;
            border-color: var(--sb-btn-primary) !important;
            color: #FFFFFF !important;
            opacity: 0.9;
        }

    /* Outlined Buttons */
    .btn-outline-primary,
    .sb-btn-outline,
    .btn.btn-outline-primary,
    .btn.sb-btn-outline {
        background-color: transparent !important;
        border: 2px solid var(--sb-btn-primary) !important;
        color: var(--sb-btn-primary) !important;
    }

        .btn-outline-primary:hover,
        .sb-btn-outline:hover,
        .btn.btn-outline-primary:hover,
        .btn.sb-btn-outline:hover,
        .btn-outline-primary:focus,
        .sb-btn-outline:focus,
        .btn.btn-outline-primary:focus,
        .btn.sb-btn-outline:focus {
            background-color: var(--sb-btn-primary) !important;
            border-color: var(--sb-btn-primary) !important;
            color: #FFFFFF !important;
            transform: translateY(-2px);
        }

    .btn-outline-secondary,
    .btn.btn-outline-secondary {
        background-color: transparent !important;
        border: 2px solid var(--sb-text-secondary) !important;
        color: var(--sb-text-secondary) !important;
    }

        .btn-outline-secondary:hover,
        .btn.btn-outline-secondary:hover,
        .btn-outline-secondary:focus,
        .btn.btn-outline-secondary:focus {
            background-color: var(--sb-text-secondary) !important;
            border-color: var(--sb-text-secondary) !important;
            color: #FFFFFF !important;
        }

    /* Error/Danger Button */
    .btn-danger,
    .btn-error,
    .btn.btn-danger,
    .btn.btn-error {
        background-color: var(--sb-error) !important;
        border-color: var(--sb-error) !important;
        color: #FFFFFF !important;
    }

        .btn-danger:hover,
        .btn-error:hover,
        .btn.btn-danger:hover,
        .btn.btn-error:hover,
        .btn-danger:focus,
        .btn-error:focus,
        .btn.btn-danger:focus,
        .btn.btn-error:focus {
            background-color: var(--sb-error) !important;
            border-color: var(--sb-error) !important;
            color: #FFFFFF !important;
            opacity: 0.85;
        }

    .btn-outline-danger,
    .btn.btn-outline-danger {
        background-color: transparent !important;
        border: 2px solid var(--sb-error) !important;
        color: var(--sb-error) !important;
    }

        .btn-outline-danger:hover,
        .btn.btn-outline-danger:hover,
        .btn-outline-danger:focus,
        .btn.btn-outline-danger:focus {
            background-color: var(--sb-error) !important;
            border-color: var(--sb-error) !important;
            color: #FFFFFF !important;
        }

    /* Success Button */
    .btn-success,
    .btn.btn-success {
        background-color: var(--sb-success) !important;
        border-color: var(--sb-success) !important;
        color: #FFFFFF !important;
    }

        .btn-success:hover,
        .btn.btn-success:hover,
        .btn-success:focus,
        .btn.btn-success:focus {
            background-color: var(--sb-success) !important;
            border-color: var(--sb-success) !important;
            color: #FFFFFF !important;
            opacity: 0.85;
        }

    .btn-outline-success,
    .btn.btn-outline-success {
        background-color: transparent !important;
        border: 2px solid var(--sb-success) !important;
        color: var(--sb-success) !important;
    }

        .btn-outline-success:hover,
        .btn.btn-outline-success:hover,
        .btn-outline-success:focus,
        .btn.btn-outline-success:focus {
            background-color: var(--sb-success) !important;
            border-color: var(--sb-success) !important;
            color: #FFFFFF !important;
        }

/* Button Sizes */
.btn-sm {
    font-size: 14px;
    padding: 8px 16px;
}

.btn-lg {
    font-size: 18px;
    padding: 16px 32px;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* ============================================================================
   CARDS
   ============================================================================ */

.card {
    background-color: var(--sb-bg-secondary);
    border: 1px solid var(--sb-border-color);
    border-radius: 6px;
    padding: 24px;
    box-shadow: var(--sb-shadow-sm);
    transition: all var(--sb-transition-fast);
}

    .card:hover {
        box-shadow: var(--sb-shadow-md);
    }

.card-header {
    background-color: var(--sb-bg-secondary);
    border-bottom: 1px solid var(--sb-border-color);
    padding: 16px 24px;
    border-radius: 6px 6px 0 0;
    margin: -24px -24px 24px -24px;
}

.card-body {
    color: var(--sb-text-primary);
}

.card-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--sb-text-primary);
    margin-bottom: 0.5rem;
}

/* White Cards (always white background regardless of mode) */
.card-white {
    background-color: #FFFFFF;
    color: #0F1419;
}

    .card-white .card-title,
    .card-white h1, .card-white h2, .card-white h3,
    .card-white h4, .card-white h5, .card-white h6 {
        color: #0F1419;
    }

    .card-white .text-muted {
        color: #76777A !important;
    }

/* Gradient Cards - Tom's Design Spec */

/* Performance Card (Blue Gradient) - Stats, Metrics, Analytics */
.card-gradient-primary,
.gradient-card-performance {
    background: linear-gradient(to top, rgba(0, 178, 227, 0.12) 0%, rgba(255, 255, 255, 1) 100%);
    border: 1px solid var(--sb-border-color);
    border-radius: 6px;
    padding: 24px;
    box-shadow: var(--sb-shadow-sm);
    transition: all var(--sb-transition-fast);
}

[data-theme="dark"] .card-gradient-primary,
[data-theme="dark"] .gradient-card-performance {
    background: linear-gradient(to top, rgba(0, 178, 227, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Completed Card (Green/Teal Gradient) - Success States, Achievements */
.card-gradient-success,
.gradient-card-completed {
    background: linear-gradient(to top, rgba(43, 184, 166, 0.12) 0%, rgba(255, 255, 255, 1) 100%);
    border: 1px solid var(--sb-border-color);
    border-radius: 6px;
    padding: 24px;
    box-shadow: var(--sb-shadow-sm);
    transition: all var(--sb-transition-fast);
}

[data-theme="dark"] .card-gradient-success,
[data-theme="dark"] .gradient-card-completed {
    background: linear-gradient(to top, rgba(43, 184, 166, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Resources Card (Blue-grey Gradient) - Information, Documentation */
.card-gradient-secondary,
.gradient-card-resources {
    background: linear-gradient(to top, rgba(118, 163, 178, 0.12) 0%, rgba(255, 255, 255, 1) 100%);
    border: 1px solid var(--sb-border-color);
    border-radius: 6px;
    padding: 24px;
    box-shadow: var(--sb-shadow-sm);
    transition: all var(--sb-transition-fast);
}

[data-theme="dark"] .card-gradient-secondary,
[data-theme="dark"] .gradient-card-resources {
    background: linear-gradient(to top, rgba(118, 163, 178, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Warning Card (Amber Gradient) - Warnings, Alerts */
.card-gradient-warning,
.gradient-card-warning {
    background: linear-gradient(to top, rgba(255, 167, 38, 0.12) 0%, rgba(255, 255, 255, 1) 100%);
    border: 1px solid var(--sb-border-color);
    border-radius: 6px;
    padding: 24px;
    box-shadow: var(--sb-shadow-sm);
    transition: all var(--sb-transition-fast);
}

[data-theme="dark"] .card-gradient-warning,
[data-theme="dark"] .gradient-card-warning {
    background: linear-gradient(to top, rgba(255, 167, 38, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Error Card (Red Gradient) - Errors, Critical Alerts */
.card-gradient-error,
.gradient-card-error {
    background: linear-gradient(to top, rgba(255, 95, 95, 0.12) 0%, rgba(255, 255, 255, 1) 100%);
    border: 1px solid var(--sb-border-color);
    border-radius: 6px;
    padding: 24px;
    box-shadow: var(--sb-shadow-sm);
    transition: all var(--sb-transition-fast);
}

[data-theme="dark"] .card-gradient-error,
[data-theme="dark"] .gradient-card-error {
    background: linear-gradient(to top, rgba(255, 95, 95, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Hover states for all gradient cards */
.card-gradient-primary:hover,
.card-gradient-success:hover,
.card-gradient-secondary:hover,
.card-gradient-warning:hover,
.card-gradient-error:hover,
.gradient-card-performance:hover,
.gradient-card-completed:hover,
.gradient-card-resources:hover,
.gradient-card-warning:hover,
.gradient-card-error:hover {
    transform: translateY(-4px);
    box-shadow: var(--sb-shadow-lg);
    cursor: pointer;
}

[data-theme="dark"] .card-gradient-primary:hover,
[data-theme="dark"] .card-gradient-success:hover,
[data-theme="dark"] .card-gradient-secondary:hover,
[data-theme="dark"] .card-gradient-warning:hover,
[data-theme="dark"] .card-gradient-error:hover,
[data-theme="dark"] .gradient-card-performance:hover,
[data-theme="dark"] .gradient-card-completed:hover,
[data-theme="dark"] .gradient-card-resources:hover,
[data-theme="dark"] .gradient-card-warning:hover,
[data-theme="dark"] .gradient-card-error:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Mobile: Reduce padding on gradient cards */
@media (max-width: 1024px) {
    .card-gradient-primary,
    .card-gradient-success,
    .card-gradient-secondary,
    .card-gradient-warning,
    .card-gradient-error,
    .gradient-card-performance,
    .gradient-card-completed,
    .gradient-card-resources,
    .gradient-card-warning,
    .gradient-card-error {
        padding: 16px;
    }
}

/* ============================================================================
   FORM ELEMENTS
   ============================================================================ */

.form-control {
    background-color: var(--sb-bg-primary);
    border: 1px solid var(--sb-border-color);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 16px;
    font-family: 'Montserrat', sans-serif;
    color: var(--sb-text-primary);
    transition: all var(--sb-transition-fast);
}

    .form-control:focus {
        border-color: var(--sb-accent-primary);
        outline: none;
        box-shadow: 0 0 0 3px rgba(0, 178, 227, 0.1);
    }

    .form-control::placeholder {
        color: var(--sb-text-secondary);
        opacity: 0.6;
    }

label {
    font-size: 14px;
    font-weight: 500;
    color: var(--sb-text-primary);
    margin-bottom: 8px;
    display: block;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
}

/* Input Groups */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group-prepend,
.input-group-append {
    display: flex;
    align-items: center;
}

.input-group-text {
    background-color: var(--sb-bg-secondary);
    border: 1px solid var(--sb-border-color);
    padding: 12px 16px;
    color: var(--sb-text-secondary);
    border-radius: 8px 0 0 8px;
}

.input-group .form-control {
    border-radius: 0 8px 8px 0;
}

/* Checkboxes & Radio Buttons */
.custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--sb-accent-primary);
    border-color: var(--sb-accent-primary);
}

/* Toggle Switches */
.custom-switch .custom-control-label::before {
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background-color: var(--sb-border-color);
}

.custom-switch .custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--sb-accent-primary);
}

/* Progress Bars */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: var(--sb-border-color);
    overflow: hidden;
}

.progress-bar {
    background-color: var(--sb-accent-primary);
    transition: width 0.3s ease;
}

/* ============================================================================
   BADGES
   ============================================================================ */

.badge {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-primary {
    background-color: var(--sb-accent-primary);
    color: #FFFFFF;
}

.badge-secondary {
    background-color: var(--sb-bg-secondary);
    color: var(--sb-text-secondary);
    border: 1px solid var(--sb-border-color);
}

.badge-success {
    background-color: var(--sb-success);
    color: #FFFFFF;
}

.badge-warning {
    background-color: var(--sb-warning);
    color: #FFFFFF;
}

.badge-danger,
.badge-error {
    background-color: var(--sb-error);
    color: #FFFFFF;
}

/* ============================================================================
   ALERTS
   ============================================================================ */

.alert {
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 1rem;
    border: 1px solid;
    display: flex;
    align-items: start;
    gap: 12px;
}

    .alert-info,
    .alert.alert-info {
        background-color: rgba(0, 178, 227, 0.1) !important;
        border-color: var(--sb-accent-primary) !important;
        color: var(--sb-text-primary) !important;
    }

[data-theme="dark"] .alert-info,
[data-theme="dark"] .alert.alert-info {
    background-color: rgba(0, 178, 227, 0.15) !important;
}

.alert-warning,
.alert.alert-warning {
    background-color: rgba(255, 167, 38, 0.1) !important;
    border-color: var(--sb-warning) !important;
    color: var(--sb-text-primary) !important;
}

[data-theme="dark"] .alert-warning,
[data-theme="dark"] .alert.alert-warning {
    background-color: rgba(255, 167, 38, 0.15) !important;
}

.alert-danger,
.alert-error,
.alert.alert-danger,
.alert.alert-error {
    background-color: rgba(255, 95, 95, 0.1) !important;
    border-color: var(--sb-error) !important;
    color: var(--sb-text-primary) !important;
}

[data-theme="dark"] .alert-danger,
[data-theme="dark"] .alert-error,
[data-theme="dark"] .alert.alert-danger,
[data-theme="dark"] .alert.alert-error {
    background-color: rgba(255, 95, 95, 0.15) !important;
}

.alert-success,
.alert.alert-success {
    background-color: rgba(43, 184, 166, 0.1) !important;
    border-color: var(--sb-success) !important;
    color: var(--sb-text-primary) !important;
}

[data-theme="dark"] .alert-success,
[data-theme="dark"] .alert.alert-success {
    background-color: rgba(43, 184, 166, 0.15) !important;
}

/* ============================================================================
   MODALS
   ============================================================================ */

.modal-content {
    background-color: var(--sb-bg-primary);
    border: 2px solid var(--sb-border-color);
    border-radius: 6px;
    color: var(--sb-text-primary);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.1);
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

[data-theme="dark"] .modal-content {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.modal-header {
    border-bottom: 1px solid var(--sb-border-color);
    background-color: var(--sb-bg-primary);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    color: var(--sb-text-primary);
    font-weight: 600;
    font-size: 20px;
    line-height: 1.5;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-body {
    padding: 24px;
    color: var(--sb-text-primary);
    background-color: var(--sb-bg-primary);
}

.modal-footer {
    border-top: 1px solid var(--sb-border-color);
    background-color: var(--sb-bg-primary);
    padding: 16px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

    .modal-footer .btn {
        margin: 0;
    }

/* Modal backdrop - darker for better modal visibility */
.modal-backdrop.show {
    opacity: 0.6;
}

[data-theme="dark"] .modal-backdrop.show {
    opacity: 0.75;
}

/* ============================================================================
   DARK/LIGHT MODE TOGGLE BUTTON (In Header)
   ============================================================================ */

/* Theme toggle is now in the header via #theme-toggle-btn - no floating button needed */

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.text-primary {
    color: var(--sb-text-primary) !important;
}

.text-secondary {
    color: var(--sb-text-secondary) !important;
}

.text-muted {
    color: var(--sb-text-secondary) !important;
}

.text-accent {
    color: var(--sb-accent-primary) !important;
}

.text-success {
    color: var(--sb-success) !important;
}

.text-warning {
    color: var(--sb-warning) !important;
}

.text-error,
.text-danger {
    color: var(--sb-error) !important;
}

.bg-primary {
    background-color: var(--sb-bg-primary) !important;
}

.bg-secondary {
    background-color: var(--sb-bg-secondary) !important;
}

/* Spacing utilities (8px base system) */
.gap-xs {
    gap: 4px;
}

.gap-sm {
    gap: 8px;
}

.gap-md {
    gap: 16px;
}

.gap-lg {
    gap: 24px;
}

.gap-xl {
    gap: 32px;
}

/* Border utilities */
.border {
    border: 1px solid var(--sb-border-color);
}

.border-top {
    border-top: 1px solid var(--sb-border-color);
}

.border-bottom {
    border-bottom: 1px solid var(--sb-border-color);
}

.border-left {
    border-left: 1px solid var(--sb-border-color);
}

.border-right {
    border-right: 1px solid var(--sb-border-color);
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
    h1, .h1 {
        font-size: 36px;
    }

    h2, .h2 {
        font-size: 28px;
    }

    h3, .h3 {
        font-size: 24px;
    }

    h4, .h4 {
        font-size: 20px;
    }

    h5, .h5 {
        font-size: 18px;
    }

    h6, .h6 {
        font-size: 16px;
    }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--sb-accent-primary);
    outline-offset: 2px;
}

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--sb-accent-primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
}

    .skip-to-content:focus {
        top: 0;
    }



/* ============================================================================
   APP-SPECIFIC STYLES (Extracted from index.html)
   ============================================================================ */

/* ========== CRITICAL CSS - MUST STAY (Cannot be Tailwind-ified) ========== */

/* Mobile Viewport Fix - Prevent address bar cutting off content */
/* These CSS vars are set dynamically by JavaScript in index.html */
:root {
    --vh: 1vh;
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* Fade-out class for page transitions (applied dynamically by app.js) */
#app.fade-out {
    opacity: 0;
}

/* Professional Polish - disable heavy animations on mobile (performance optimization) */
@media (max-width: 1024px) {
    * {
        animation-duration: 200ms !important;
        transition-duration: 200ms !important;
    }

    /* No scale transforms on mobile (prevents janky animations) */
    .hover\:scale-105,
    .hover\:scale-110,
    .hover\:scale-102 {
        transform: none !important;
    }
}

/* === BEAUTIFUL BLUR BACKDROP FOR ALL MODALS === */
/* Inspired by offline SmartBuild - way better than dark overlay! */
.modal-backdrop {
    background-color: rgba(255, 255, 255, 0.3) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

[data-theme="dark"] .modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5) !important;
}

/* Ensure modal content pops over the blur */
.modal {
    z-index: 1050;
}

.modal-backdrop {
    z-index: 1040;
}

/* === FORCE REPORT FORMS TO IGNORE DARK MODE === */
/* Only override dark mode styles - keep all original Bootstrap styling */
[data-theme="dark"] #report_form,
[data-theme="dark"] #report_form *:not(.btn):not(.badge) {
    color: inherit !important;
}

[data-theme="dark"] #report_form {
    background-color: #ffffff !important;
}

    [data-theme="dark"] #report_form input,
    [data-theme="dark"] #report_form textarea,
    [data-theme="dark"] #report_form select {
        background-color: #ffffff !important;
        color: #495057 !important;
    }

    [data-theme="dark"] #report_form .table {
        background-color: #ffffff !important;
    }

        [data-theme="dark"] #report_form .table th,
        [data-theme="dark"] #report_form .table td {
            background-color: inherit !important;
            color: #212529 !important;
        }

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

