/* Coffee Farm GPS Management System - Styles */

/* CSS Variables */
:root {
    --primary-color: #6f4e37; /* coffee brown */
    --primary-light: #8b5e3c; /* lighter coffee */
    --primary-dark: #3b2a20; /* darker coffee */
    --secondary-color: #8b4513; 
    --secondary-light: #a0522d;
    --accent-color: #d4a574;
    --success-color: #6b8e23; /* olive/earthy positive */
    --warning-color: #c07b3a; /* warm amber/brown */
    --danger-color: #dc3545;
    --info-color: #6f8b8f; /* muted teal to pair with coffee tones */

    --bg-color: #f5f5f0;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-muted: #6c757d;
    --border-color: #dee2e6;

    --navbar-height: 60px;
    --bottom-nav-height: 65px;
    --sidebar-width: 250px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --transition: all 0.3s ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px; /* slightly reduced base font size for a more compact UI */
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 0.95rem; /* slightly smaller body text */
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 { font-size: 1.6rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.12rem; }
h4 { font-size: 1rem; }

.lead { font-size: 0.95rem; }

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    color: var(--primary-light);
}

/* Navbar overrides for Bootstrap */
.navbar-brand .brand-icon { font-size: 1.25rem; }

/* Dark & Light theme tokens and overrides */
:root {
    /* Light (default) theme */
    --primary-color: #6f4e37; /* coffee brown */
    --primary-light: #8b5e3c;
    --primary-dark: #3b2a20;
    --primary-contrast: #ffffff;

    --bg-body: #f6efe9; /* light coffee-cream background */
    --card-bg: #ffffff;
    --text-body: #2b2b2b;
    --text-muted: #6c757d;
    --border-color: #e6ded6;
    --surface-muted: #f8f9fa;
}

[data-theme="dark"] {
    /* Dark coffee theme */
    --primary-color: #8b5e3c; /* brighter accent for contrast */
    --primary-light: #a86f47;
    --primary-dark: #3b2a20;
    --primary-contrast: #ffffff;

    --bg-body: #0f0b09; /* deep coffee background */
    --card-bg: #14110f;
    --text-body: #f3efe9; /* light cream text */
    --text-muted: #bfb6ad;
    --text-color: var(--text-body); /* ensure legacy --text-color maps to light text in dark mode */
    --border-color: rgba(255,255,255,0.06);
    --surface-muted: rgba(255,255,255,0.02);

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.6);
} 

/* Base body colors */
body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-body);
}

/* Cards and surfaces */
.card, .list-group-item, .empty-state {
    background: var(--card-bg);
    color: var(--text-body);
    border-color: var(--border-color);
}

/* Forms */
.form-control, .form-select {
    background: transparent;
    color: var(--text-body);
    border-color: var(--border-color);
}
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background: rgba(255,255,255,0.02);
}

/* Buttons */
.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--primary-contrast);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--primary-light);
    border-color: var(--primary-light);
    color: var(--primary-contrast);
}

/* Light-mode specific button */
.btn-light {
    color: #333;
    background: #ffffff;
    border-color: var(--border-color);
}
[data-theme="dark"] .btn-light {
    background: rgba(255,255,255,0.04);
    color: var(--text-body);
    border-color: rgba(255,255,255,0.06);
}

/* Navbar */
.navbar {
    background: var(--primary-color);
}
.navbar .nav-link, .navbar .navbar-brand {
    color: var(--primary-contrast);
}
[data-theme="dark"] .navbar .nav-link { color: rgba(255,255,255,0.95); }

/* Tables */
.table th { background: rgba(0,0,0,0.03); }
[data-theme="dark"] .table th { background: rgba(255,255,255,0.02); color: var(--text-body); }
.table tbody tr:hover { background: rgba(0,0,0,0.04); }
[data-theme="dark"] .table tbody tr:hover { background: rgba(255,255,255,0.02); }

/* Empty states and icons */
.empty-state { color: var(--text-body); }
.empty-state-icon { color: var(--primary-color); }

/* Focus visibility */
:focus {
    outline: 3px solid rgba(139,94,60,0.22);
    outline-offset: 2px;
}

/* Ensure responsive visibility on small screens */
@media (max-width: 768px) {
    .navbar.fixed-bottom { background: var(--card-bg); }
    .navbar.fixed-bottom .nav-link { color: var(--text-body); }
}


/* adjust bottom fixed nav spacing */
main.main-content { padding-top: calc(var(--navbar-height) + 1rem); }

/* keep previous mobile bottom nav look minimal when converted */
.navbar.fixed-bottom .nav-link { color: var(--text-body); }
.navbar.fixed-bottom { border-top: 1px solid var(--border-color); }

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 2rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--primary-contrast);
    border-radius: var(--radius-md);
    transition: var(--transition);
    font-size: 0.9rem;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,0.15);
    color: white;
}

.nav-icon {
    font-size: 1.1rem;
}

/* Ensure icon fonts and inline SVGs inherit color (useful for theme switching) */
.bi, i, svg {
    color: inherit;
    fill: currentColor;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.user-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    padding: 0.5rem;
}

.logout-link {
    color: rgba(255,255,255,0.8);
    padding: 0.5rem;
}

.logout-link:hover {
    color: white;
}

/* Bottom Navigation (Mobile) */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: white;
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 0.5rem;
    transition: var(--transition);
}

.bottom-nav-item.active {
    color: var(--primary-color);
}

.bottom-nav-icon {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

/* Main Content */
.main-content {
    padding-top: var(--navbar-height);
    min-height: 100vh;
}

.main-content.no-nav {
    padding-top: 0;
}

/* Login Page Background */
.login-page {
    min-height: calc(100vh - var(--navbar-height));
    display: flex;
    align-items: center;
    background-image: url('/static/images/reiseuhu-2GrRlrLReQc-unsplash.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    padding: 3rem 0;
}
.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 0;
}
.login-page .card {
    background: rgba(255,255,255,0.94);
    position: relative;
    z-index: 1;
    border: none;
}

/* Register Page Background */
.register-page {
    min-height: calc(100vh - var(--navbar-height));
    display: flex;
    align-items: center;
    background-image: url('/static/images/delicious-organic-coffee-still-life.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    padding: 3rem 0;
}
.register-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 0;
}
.register-page .card {
    background: rgba(255,255,255,0.96);
    position: relative;
    z-index: 1;
    border: none;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: var(--surface-muted);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(111, 78, 55, 0.12);
}

/* Password visibility toggle */
.form-group.password-field { position: relative; }
.form-group.password-field .form-control {
    padding-right: 3rem; /* increased space for the toggle to avoid overlap */
}
.form-group.password-field .password-toggle-btn {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.05rem;
    color: var(--text-muted);
    padding: 0 0.35rem;
    height: auto;
    line-height: 1;
}
.password-toggle-btn:focus {
    outline: none;
    color: var(--primary-color);
}

/* Registration stepper */
.registration-steps { gap: 0.5rem; }
.registration-steps .step-indicator {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.registration-steps .step-indicator.active {
    background: var(--primary-color);
    color: var(--primary-contrast);
    font-weight: 600;
}
.reg-step {
    display: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 240ms ease, transform 240ms ease;
}
.reg-step.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Progress bar for registration */
.registration-progress {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}
.registration-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), #8b5e3c);
    transition: width 300ms ease;
}

/* Avatar button and dropdown styling */
.avatar-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-body);
    box-shadow: var(--shadow-sm);
}
.avatar-btn:hover,
.avatar-btn:focus {
    background: var(--primary-color);
    color: var(--primary-contrast);
    border-color: var(--primary-color);
}

.avatar-initial {
    font-weight: 700;
    font-size: 0.95rem;
}

.dropdown-menu {
    background: var(--card-bg);
    color: var(--text-body);
    border: 1px solid var(--border-color);
}
.dropdown-item {
    color: var(--text-body);
}
.dropdown-item:hover, .dropdown-item:focus {
    background: rgba(139,94,60,0.06);
}
[data-theme="dark"] .dropdown-item:hover, [data-theme="dark"] .dropdown-item:focus {
    background: rgba(255,255,255,0.03);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23333' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-light);
    color: white;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: var(--secondary-light);
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
} 

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-block {
    width: 100%;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-weight: 600;
    background: var(--surface-muted);
    white-space: nowrap;
}

.table tbody tr:hover {
    background: var(--surface-muted);
}

/* Lists */
.list-group {
    list-style: none;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.list-item:last-child {
    border-bottom: none;
}

.list-item:hover {
    background: var(--surface-muted);
}

.list-item-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.list-item-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary { background: var(--primary-color); color: white; }
.badge-success { background: var(--success-color); color: white; }
.badge-warning { background: var(--warning-color); color: #333; }
.badge-danger { background: var(--danger-color); color: white; }
.badge-info { background: var(--info-color); color: white; }

/* Messages / Alerts */
.messages-container {
    position: fixed;
    top: calc(var(--navbar-height) + 1rem);
    right: 1rem;
    z-index: 1100;
    max-width: 420px;
}

.message {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-md);
    background: var(--card-bg);
    color: var(--text-body);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    border: 1px solid var(--border-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.message-success { border-left: 4px solid var(--success-color); }
.message-error { border-left: 4px solid var(--danger-color); }
.message-warning { border-left: 4px solid var(--warning-color); }
.message-info { border-left: 4px solid var(--info-color); }

.message-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    line-height: 1;
}

/* Map Container */
.map-container {
    height: calc(100vh - var(--navbar-height));
    width: 100%;
    position: relative;
}

.map-container.with-bottom-nav {
    height: calc(100vh - var(--navbar-height) - var(--bottom-nav-height));
}

#map {
    height: 100%;
    width: 100%;
}

/* Map Controls */
.map-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.map-control-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--card-bg);
    border: none;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-control-btn:hover {
    background: var(--surface-muted);
}

.map-control-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Map Info Panel */
.map-info-panel {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    max-width: 400px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 50vh;
    overflow-y: auto;
    display: none;
}

.map-info-panel.visible {
    display: block;
}

.map-info-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.map-info-body {
    padding: 1rem;
}

.map-info-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* GPS Location Indicator */
.gps-indicator {
    position: fixed;
    top: calc(var(--navbar-height) + 1rem);
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-bg);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.gps-pulse {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--success-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

.gps-pulse.inactive {
    background: var(--text-muted);
    animation: none;
}

/* Plot Card */
.plot-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.plot-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.plot-card-header {
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.plot-card-body {
    padding: 1rem;
}

.plot-card-footer {
    padding: 0.75rem 1rem;
        background: var(--surface-muted);
    gap: 0.5rem;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 50%, var(--primary-light) 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.auth-header {
    text-align: center;
    padding: 2rem;
    background: var(--bg-color);
}

.auth-logo {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.auth-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-body {
    padding: 2rem;
}

.auth-footer {
    text-align: center;
    padding: 1.5rem;
    background: var(--surface-muted);
/* Landing Page */
.landing-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 50%, var(--primary-light) 100%);
    color: white;
}

.hero-logo {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-hero {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    border-radius: var(--radius-lg);
}

.btn-hero-primary {
    background: white;
    color: var(--primary-color);
}

.btn-hero-primary:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.btn-hero-outline {
    background: transparent;
    border: 2px solid white;
    color: white;
}

.btn-hero-outline:hover {
    background: white;
    color: var(--primary-color);
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: 1rem;
}

/* Surface helpers */
.bg-surface { background: var(--card-bg) !important; }

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

.hidden { display: none; }

/* Responsive Design */
@media (max-width: 992px) {
    .nav-menu {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-user .user-name {
        display: none;
    }
}

@media (max-width: 768px) {
    :root {
        --navbar-height: 56px;
    }

    .navbar {
        padding: 0 0.75rem;
    }

    .brand-text {
        display: none;
    }

    .bottom-nav {
        display: flex;
    }

    .main-content {
        padding-bottom: var(--bottom-nav-height);
    }

    .map-container.with-bottom-nav {
        height: calc(100vh - var(--navbar-height) - var(--bottom-nav-height));
    }

    .container {
        padding: 0.75rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .messages-container {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .btn {
        padding: 0.6rem 1.2rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn-hero {
        width: 100%;
    }
}

/* Hero carousel styles */
.hero-section { position: relative; overflow: hidden; }
.hero-img { height: 460px; object-fit: cover; object-position: center; width: 100%; display: block; }
.carousel-item { position: relative; }
/* subtle dark overlay for better text contrast */
.carousel-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1;
    pointer-events: none;
    transition: background 200ms ease;
}
.carousel-caption { position: absolute; top: 50%; transform: translateY(-50%); left: 5%; right: 5%; text-align: left; z-index: 2; }
.carousel-caption .display-4 { font-size: 2.4rem; color: rgba(255,255,255,0.98); text-shadow: 0 3px 10px rgba(0,0,0,0.6); }
.carousel-caption h1, .carousel-caption p, .carousel-caption .lead, .carousel-caption .display-4 { color: #fff; text-shadow: 0 3px 14px rgba(0,0,0,0.6); }

/* Outline buttons in captions should appear white */
.carousel-caption .btn-outline-secondary {
    color: #fff;
    border-color: rgba(255,255,255,0.7);
}
.carousel-caption .btn-outline-secondary:hover,
.carousel-caption .btn-outline-secondary:focus {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-color: rgba(255,255,255,0.9);
}

/* Indicators styling */
.carousel-indicators {
    bottom: 12px;
}
.carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background-color: rgba(255,255,255,0.6);
}
.carousel-indicators .active {
    background-color: #fff;
}

@media (max-width: 767px) {
    .hero-img { height: 260px; }
    .carousel-caption { left: 1rem; right: 1rem; }
    .carousel-caption .display-4 { font-size: 1.6rem; }
    .carousel-caption h1 { font-size: 1.2rem; }
}

/* Print Styles */
@media print {
    .navbar, .bottom-nav, .map-controls, .btn {
        display: none !important;
    }

    .main-content {
        padding: 0 !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
