/* Modern Cosmic Dark Theme - 2025 Style
   Inspired by starry night sky
   Clean, Minimal, Professional
*/

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Cosmic Dark Theme Colors */
    --brand-primary: #00c6ff;
    --brand-primary-hover: #0072ff;
    --brand-primary-light: rgba(0, 198, 255, 0.1);

    /* Dark Cosmic Palette */
    --cosmic-dark: #050518;
    --cosmic-medium: #0b0f2f;
    --cosmic-light: #1a1f45;
    --gray-50: #0f1428;
    --gray-100: #1a1f45;
    --gray-200: #252b52;
    --gray-300: #303763;
    --gray-400: #4a5280;
    --gray-500: #6b7599;
    --gray-600: #8891b8;
    --gray-700: #a5aed1;
    --gray-800: #c2c9e8;
    --gray-900: #e0e4f5;

    /* Semantic Colors */
    --success: #00f2fe;
    --success-light: rgba(0, 242, 254, 0.1);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.1);
    --info: #00c6ff;
    --info-light: rgba(0, 198, 255, 0.1);

    /* Backgrounds */
    --bg-primary: #0b0f2f;
    --bg-secondary: #1a1f45;
    --bg-tertiary: #252b52;

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #a5aed1;
    --text-tertiary: #8891b8;

    /* Borders */
    --border-color: #303763;
    --border-color-dark: #4a5280;

    /* Shadows - Cosmic glow */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.5), 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.5);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Typography */
    --font-sans: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Bootstrap overrides for dark theme */
.text-muted {
    color: var(--text-secondary) !important;
}

.text-dark,
.text-body {
    color: var(--text-primary) !important;
}

/* Global text visibility fixes */
label,
legend,
.form-text,
.input-group-text {
    color: var(--text-primary) !important;
}

input,
textarea,
select {
    color: var(--text-primary) !important;
    background: var(--bg-secondary) !important;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-tertiary) !important;
}

/* Ensure all headings are visible - EXCEPT in map popups */
h1:not(.leaflet-popup-content *),
h2:not(.leaflet-popup-content *),
h3:not(.leaflet-popup-content *),
h4:not(.leaflet-popup-content *),
h5:not(.leaflet-popup-content *),
h6:not(.leaflet-popup-content *) {
    color: var(--text-primary) !important;
}

.leaflet-popup-content h1,
.leaflet-popup-content h2,
.leaflet-popup-content h3,
.leaflet-popup-content h4,
.leaflet-popup-content h5,
.leaflet-popup-content h6 {
    color: #1a1a1a !important;
}

/* Paragraph and text elements */
p, span, div:not(.btn) {
    color: inherit;
}

/* Strong emphasis should be visible */
strong:not(.leaflet-popup-content *),
b:not(.leaflet-popup-content *) {
    color: var(--text-primary);
    font-weight: 700;
}

.leaflet-popup-content strong,
.leaflet-popup-content b {
    color: #1a1a1a !important;
}

.container-fluid {
    padding: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

/* Navbar - Cosmic Dark */
.auth-navbar {
    background: var(--cosmic-medium);
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-md) 0;
    position: sticky;
    top: 0;
    z-index: 1050;
    backdrop-filter: blur(8px);
    background: rgba(11, 15, 47, 0.95);
}

.auth-navbar .navbar-brand {
    color: var(--text-primary) !important;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.auth-navbar *,
.auth-navbar a,
.auth-navbar span,
.auth-navbar button {
    color: var(--text-primary) !important;
}

.navbar-light .navbar-brand,
.navbar-light .navbar-nav .nav-link {
    color: var(--text-primary) !important;
}

.navbar-light .navbar-toggler {
    border-color: var(--border-color);
}

.navbar-light .navbar-toggler-icon {
    filter: invert(1);
}

/* General navbar styling for all navbars */
.navbar {
    background: var(--cosmic-medium) !important;
    border-bottom: 1px solid var(--border-color);
}

.navbar *,
.navbar a,
.navbar span,
.navbar button:not(.btn-primary):not(.btn-success) {
    color: var(--text-primary) !important;
}

.navbar .btn {
    color: white !important;
}

/* Dark Mode Progress Bars */
.progress {
    background-color: var(--cosmic-light) !important;
    border: 1px solid var(--border-color) !important;
}

.progress-bar {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-hover) 100%) !important;
    color: #ffffff !important;
}

.progress-bar.bg-success {
    background: linear-gradient(135deg, var(--success) 0%, #00c6ff 100%) !important;
}

#progressContainer .card,
#progressContainerMobile .card {
    background: var(--bg-secondary) !important;
    border-color: var(--brand-primary) !important;
}

#progressText,
#progressTextMobile {
    color: var(--brand-primary) !important;
}

.spinner-border.text-primary {
    color: var(--brand-primary) !important;
}

/* Theme Toggle Button */
#themeToggle {
    background: transparent !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
    transition: all 0.3s ease;
}

#themeToggle:hover {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color-dark) !important;
}

/* Dropdown */
.dropdown-menu {
    z-index: 1060 !important;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-sm);
    margin-top: var(--space-xs);
}

.dropdown-item {
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.15s ease;
}

.dropdown-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Purple background elements should have white text */
.btn-primary,
.progress-bar,
.day-title,
.day-header,
.stats-card,
.step-number,
.hero-section,
.navbar-brand,
.footer-brand,
[style*="linear-gradient(135deg, #667eea"],
[style*="background: #667eea"] {
    color: #ffffff !important;
}

.btn-primary *,
.progress-bar *,
.day-title *,
.day-header *,
.stats-card *,
.step-number * {
    color: #ffffff !important;
}

/* Checkbox styling for dark theme */
.form-check-input {
    width: 1.2em;
    height: 1.2em;
    margin-top: 0.15em;
    vertical-align: top;
    background-color: var(--bg-tertiary);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    border: 2px solid var(--border-color-dark);
    border-radius: 0.25em;
    appearance: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
}

.form-check-input:hover {
    border-color: #667eea;
}

.form-check-input:focus {
    border-color: #667eea;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-check-label {
    cursor: pointer;
    user-select: none;
}

/* Classic Checkbox Styling for Preferences - High Contrast */
.form-check-input.preference-checkbox {
    width: 1.3em !important;
    height: 1.3em !important;
    margin-top: 0.15em !important;
    background-color: #ffffff !important;
    border: 2.5px solid var(--gray-500) !important;
    border-radius: 0.35em !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: contain !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
}

.form-check-input.preference-checkbox:checked {
    background-color: #667eea !important;
    border-color: #667eea !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e") !important;
}

.form-check-input.preference-checkbox:hover {
    border-color: #667eea !important;
    box-shadow: 0 0 6px rgba(102, 126, 234, 0.3) !important;
}

.form-check-input.preference-checkbox:focus {
    border-color: #667eea !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25) !important;
}

.form-check .form-check-label {
    margin-left: 0.5rem;
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* User Menu */
.user-menu {
    display: none;
}

.user-menu.show {
    display: block;
}

/* Map */
#map {
    height: 100vh;
    width: 100%;
    border-radius: 0;
}

/* Left Panel - Clean Scrollbar */
.left-panel {
    height: 100vh;
    overflow-y: auto;
    background: var(--bg-primary);
    padding: var(--space-xl);
    color: var(--text-primary) !important;
}

.left-panel *:not(.btn):not(button) {
    color: var(--text-primary) !important;
}

.left-panel .text-muted,
.left-panel small {
    color: var(--text-secondary) !important;
}

.left-panel::-webkit-scrollbar {
    width: 6px;
}

.left-panel::-webkit-scrollbar-track {
    background: transparent;
}

.left-panel::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius-full);
}

.left-panel::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

.left-panel h4,
.left-panel h5 {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: var(--space-lg);
    letter-spacing: -0.01em;
}

/* Remove decorative underlines */
.left-panel h4::after,
.left-panel h5::after {
    display: none;
}

/* Forms - Clean like Stripe */
.form-label {
    color: var(--text-primary) !important;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: var(--space-sm);
    display: block;
}

.form-control,
.form-select {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    font-size: 15px;
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    transition: all 0.15s ease;
    width: 100%;
}

.form-control option,
.form-select option {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

.form-control:hover,
.form-select:hover {
    border-color: var(--border-color-dark);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--brand-primary-light);
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

/* Buttons - Minimal & Clean */
.btn {
    border-radius: var(--radius-md);
    padding: 10px 16px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.15s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    line-height: 1;
}

/* Primary Button - Cosmic gradient */
.btn-primary {
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-primary-hover));
    color: white;
    box-shadow: 0 4px 15px rgba(0, 198, 255, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(0, 198, 255, 0.5);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Secondary Button - Ghost style */
.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--brand-primary);
    color: var(--text-primary) !important;
}

/* Success Button */
.btn-success {
    background: linear-gradient(90deg, var(--success), var(--brand-primary-hover));
    color: white;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.btn-success:hover {
    box-shadow: 0 8px 25px rgba(0, 242, 254, 0.5);
    transform: translateY(-1px);
}

/* Outline Buttons */
.btn-outline-primary {
    background: transparent;
    color: var(--brand-primary) !important;
    border: 1px solid var(--brand-primary);
}

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

.btn-outline-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color);
}

.btn-outline-secondary:hover,
.btn-outline-secondary.active {
    background: var(--bg-tertiary);
    border-color: var(--brand-primary);
    color: var(--text-primary) !important;
}

.btn-outline-success {
    background: transparent;
    color: var(--success) !important;
    border: 1px solid var(--success);
}

.btn-outline-success:hover {
    background: var(--success-light);
    color: var(--success) !important;
}

/* Button Sizes */
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

/* Lists */
.list-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.list-group-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    transition: all 0.15s ease;
    color: var(--text-primary) !important;
}

.list-group-item * {
    color: var(--text-primary) !important;
}

.list-group-item small,
.list-group-item .text-muted {
    color: var(--text-secondary) !important;
}

.list-group-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--border-color-dark);
}

/* Itinerary Items */
.itinerary-item {
    cursor: pointer;
    color: var(--text-primary) !important;
}

.itinerary-item * {
    color: var(--text-primary) !important;
}

.itinerary-item small,
.itinerary-item .text-muted,
.itinerary-item .activity-detail {
    color: var(--text-secondary) !important;
}

.itinerary-item:hover {
    background: var(--bg-secondary);
}

.itinerary-item.selected {
    background: var(--brand-primary-light);
    border-color: var(--brand-primary);
}

/* Activity Cards */
.activity-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    background: var(--bg-primary);
    transition: all 0.15s ease;
}

.activity-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--brand-primary);
}

.activity-card h6,
.activity-card h5,
.activity-card h4,
.activity-card .activity-title {
    color: var(--text-primary) !important;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: var(--space-sm);
}

.activity-card p,
.activity-card .activity-detail,
.activity-card small,
.activity-card .text-muted {
    color: var(--text-secondary) !important;
    font-size: 14px;
    line-height: 1.6;
}

/* Day Headers */
.day-header {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 700;
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-md);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--border-color);
}

.day-header:hover {
    background: var(--bg-tertiary);
    border-color: var(--brand-primary);
}

/* Add Activity Item */
.add-activity-item {
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color-dark);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    text-align: center;
    transition: all 0.15s ease;
}

.add-activity-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--brand-primary);
}

.add-activity-item button {
    width: 100%;
    padding: var(--space-md);
    font-weight: 600;
    font-size: 14px;
    color: var(--brand-primary);
    background: transparent;
    border: none;
    cursor: pointer;
}

/* Modals */
.modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.modal-content *:not(.btn) {
    color: var(--text-primary) !important;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-lg) var(--space-xl);
    background: var(--bg-primary);
}

.modal-title {
    color: var(--text-primary) !important;
    font-weight: 700;
    font-size: 1.25rem;
}

.modal-body {
    padding: var(--space-xl);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: var(--space-lg) var(--space-xl);
    gap: var(--space-sm);
    background: var(--bg-primary);
}

.modal-body label,
.modal-body .form-label {
    color: var(--text-primary) !important;
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    border-left: 4px solid;
}

.alert-info {
    background: var(--info-light);
    border-left-color: var(--info);
    color: var(--info) !important;
}

.alert-success {
    background: var(--success-light);
    border-left-color: var(--success);
    color: var(--success) !important;
}

.alert-warning {
    background: var(--warning-light);
    border-left-color: var(--warning);
    color: var(--warning) !important;
}

.alert-danger {
    background: var(--danger-light);
    border-left-color: var(--danger);
    color: var(--danger) !important;
}

/* Badges */
.badge {
    border-radius: var(--radius-full);
    padding: 4px 10px;
    font-weight: 600;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
}

/* Spinner */
.spinner-border {
    color: var(--brand-primary);
}

/* Button Groups */
.btn-group {
    display: inline-flex;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.btn-check {
    display: none;
}

/* Saved Itineraries */
.saved-itineraries,
.itinerary-container {
    overflow-y: visible;
}

/* Map Markers */
.selected-day-marker {
    filter: hue-rotate(120deg) saturate(1.5) brightness(1.2);
}

.map-picker-marker {
    filter: hue-rotate(60deg) saturate(1.5) brightness(1.2);
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Show Map Button (Mobile) */
.show-activity-map-btn,
.show-map-btn {
    display: none;
    width: 100%;
    padding: var(--space-md);
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-primary-hover));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    margin-top: var(--space-md);
    box-shadow: 0 4px 15px rgba(0, 198, 255, 0.3);
}

/* Map Modal Styles */
#mapModal {
    z-index: 1055;
}

#mapModal .modal-dialog {
    max-width: 95%;
    margin: 1rem auto;
}

#mapModal .modal-body {
    padding: 0;
    height: 80vh;
    position: relative;
    overflow: hidden;
}

#mapModalContent {
    height: 100% !important;
    width: 100% !important;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Desktop Layout */
.desktop-layout {
    margin: 0;
    display: flex;
}

.desktop-layout .col-lg-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
}

.desktop-layout .col-lg-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
}

.mobile-layout {
    display: none;
}

/* Responsive Design */
@media (max-width: 991px) {
    .left-panel {
        height: auto;
        padding: var(--space-lg);
    }

    #map {
        height: 60vh;
    }
}

@media (max-width: 767px) {
    body {
        font-size: 14px;
    }

    /* Mobile Layout */
    .desktop-layout {
        display: none !important;
    }

    .mobile-layout {
        display: block !important;
        height: auto;
        min-height: calc(100vh - 80px);
    }

    .mobile-left-panel {
        padding: var(--space-md);
        background: var(--bg-primary);
    }

    .left-panel {
        padding: var(--space-md);
    }

    .left-panel h4,
    .left-panel h5 {
        font-size: 1rem;
    }

    /* Show map buttons on mobile */
    .show-activity-map-btn,
    .show-map-btn {
        display: block;
    }

    /* Buttons */
    .btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .btn-sm {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* Cards */
    .activity-card {
        padding: var(--space-md);
    }

    .activity-card h6 {
        font-size: 0.9375rem;
    }

    /* Add Activity */
    .add-activity-item {
        padding: var(--space-sm);
    }

    .add-activity-item button {
        padding: var(--space-sm) var(--space-md);
        font-size: 13px;
        white-space: normal;
        line-height: 1.4;
    }

    /* Day Headers */
    .day-header {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.9375rem;
    }

    /* Modals */
    .modal-header,
    .modal-footer {
        padding: var(--space-md) var(--space-lg);
    }

    .modal-body {
        padding: var(--space-md) var(--space-lg);
    }

    .modal-title {
        font-size: 1.125rem;
    }

    /* Forms */
    .form-control {
        padding: 10px;
        font-size: 14px;
    }

    .form-label {
        font-size: 12px;
    }

    /* Lists */
    .list-group-item {
        padding: var(--space-sm) var(--space-md);
    }

    /* Navbar */
    .auth-navbar {
        padding: var(--space-sm) 0;
    }

    .auth-navbar .navbar-brand {
        font-size: 1.125rem;
    }
}

@media (max-width: 576px) {
    .left-panel {
        padding: var(--space-sm);
    }

    /* Extra compact for very small screens */
    .add-activity-item button {
        font-size: 12px;
        padding: var(--space-xs) var(--space-sm);
    }

    /* Stack button groups vertically */
    .btn-group {
        display: flex;
        flex-direction: column;
    }

    .btn-group .btn {
        border-radius: var(--radius-md) !important;
        margin-bottom: var(--space-xs);
    }
}

/* Utility Classes */
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-tertiary) !important; }
.bg-primary { background: var(--bg-primary) !important; }
.bg-secondary { background: var(--bg-secondary) !important; }

/* Hide decorative gradients */
.google-review,
.google-link {
    background: var(--brand-primary) !important;
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
    margin-top: var(--space-sm);
    text-decoration: none;
    transition: all 0.15s ease;
}

.google-review:hover,
.google-link:hover {
    background: var(--brand-primary-hover) !important;
    color: white;
    transform: translateY(-1px);
}

/* Google Places Autocomplete */
.pac-container {
    z-index: 10000 !important;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-top: 4px;
    font-family: var(--font-sans);
    border: 1px solid var(--border-color);
}

.pac-item {
    padding: 10px 14px;
    border-top: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 14px;
}

.pac-item:first-child {
    border-top: none;
}

.pac-item:hover {
    background: var(--bg-secondary);
}

.pac-item-selected {
    background: var(--bg-tertiary);
}

.pac-matched {
    font-weight: 700;
    color: var(--brand-primary);
}

/* Activity Highlight Animation */
@keyframes activityHighlight {
    0% {
        background-color: #fff3cd;
        transform: scale(1);
    }
    50% {
        background-color: #fffaeb;
        transform: scale(1.02);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

.activity-highlight {
    animation: activityHighlight 2s ease-in-out;
    border-left: 4px solid #ffc107 !important;
    transition: all 0.3s ease;
}

/* ===================================
   Map Popup Fixes - Ensure Good Contrast in All Modes
   =================================== */

/* Leaflet popup overrides - Light background with dark text */
.leaflet-popup-content-wrapper,
.leaflet-popup-content-wrapper * {
    background: #ffffff !important;
}

.leaflet-popup-content-wrapper {
    color: #2c3e50 !important;
}

.leaflet-popup-content,
.leaflet-popup-content *:not(.btn):not(button) {
    color: #2c3e50 !important;
}

.leaflet-popup-content h1,
.leaflet-popup-content h2,
.leaflet-popup-content h3,
.leaflet-popup-content h4,
.leaflet-popup-content h5,
.leaflet-popup-content h6,
.leaflet-popup-content strong,
.leaflet-popup-content b {
    color: #1a1a1a !important;
    font-weight: 700 !important;
}

.leaflet-popup-content p,
.leaflet-popup-content span:not(.btn),
.leaflet-popup-content div:not(.btn),
.leaflet-popup-content small,
.leaflet-popup-content i:not(.fa):not(.fas):not(.far):not(.fab),
.leaflet-popup-content a:not(.btn) {
    color: #333333 !important;
}

.leaflet-popup-tip {
    background: #ffffff !important;
}

.leaflet-popup-close-button {
    color: #666666 !important;
}

.leaflet-popup-close-button:hover {
    color: #333333 !important;
}

/* Ensure buttons in popups are visible */
.leaflet-popup-content button:not(.leaflet-popup-close-button),
.leaflet-popup-content .btn {
    color: #ffffff !important;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-primary-hover)) !important;
    border: none !important;
}

/* Override any global text color rules for popups - force dark text on light bg */
.leaflet-popup *:not(.btn):not(button) {
    color: #2c3e50 !important;
}

.leaflet-popup button,
.leaflet-popup .btn {
    color: #ffffff !important;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-primary-hover)) !important;
}

/* Google Maps Info Window - Force light background with dark text in dark mode */
/* Target all Google Maps info window containers */
.gm-style .gm-style-iw,
.gm-style .gm-style-iw-c,
.gm-style .gm-style-iw-d,
.gm-style-iw,
.gm-style-iw-c,
.gm-style-iw-d,
div.gm-style-iw,
div.gm-style-iw-c,
div.gm-style-iw-d {
    background-color: #ffffff !important;
    background: #ffffff !important;
    color: #2c3e50 !important;
}

/* Force dark text on ALL children - override body's white text */
.gm-style-iw *,
.gm-style-iw-c *,
.gm-style-iw-d *,
.gm-style .gm-style-iw *,
.gm-style .gm-style-iw-c *,
.gm-style .gm-style-iw-d * {
    color: #2c3e50 !important;
    background-color: transparent !important;
}

/* Headings - darker and bold */
.gm-style-iw h1,
.gm-style-iw h2,
.gm-style-iw h3,
.gm-style-iw h4,
.gm-style-iw h5,
.gm-style-iw h6,
.gm-style-iw strong,
.gm-style-iw b,
.gm-style-iw-c h1,
.gm-style-iw-c h2,
.gm-style-iw-c h3,
.gm-style-iw-c h4,
.gm-style-iw-c h5,
.gm-style-iw-c h6,
.gm-style-iw-c strong,
.gm-style-iw-c b,
.gm-style-iw-d h1,
.gm-style-iw-d h2,
.gm-style-iw-d h3,
.gm-style-iw-d h4,
.gm-style-iw-d h5,
.gm-style-iw-d h6,
.gm-style-iw-d strong,
.gm-style-iw-d b {
    color: #1a1a1a !important;
    font-weight: 700 !important;
}

/* Regular text elements */
.gm-style-iw p,
.gm-style-iw span,
.gm-style-iw div,
.gm-style-iw small,
.gm-style-iw a,
.gm-style-iw-c p,
.gm-style-iw-c span,
.gm-style-iw-c div,
.gm-style-iw-c small,
.gm-style-iw-c a,
.gm-style-iw-d p,
.gm-style-iw-d span,
.gm-style-iw-d div,
.gm-style-iw-d small,
.gm-style-iw-d a {
    color: #333333 !important;
}

/* Links - make them blue and visible */
.gm-style-iw a,
.gm-style-iw-c a,
.gm-style-iw-d a {
    color: #0066cc !important;
    text-decoration: underline !important;
}

.gm-style-iw a:hover,
.gm-style-iw-c a:hover,
.gm-style-iw-d a:hover {
    color: #0052a3 !important;
}

/* Buttons - keep white text on colored background */
.gm-style-iw button:not(.gm-ui-hover-effect),
.gm-style-iw .btn,
.gm-style-iw-c button:not(.gm-ui-hover-effect),
.gm-style-iw-c .btn,
.gm-style-iw-d button:not(.gm-ui-hover-effect),
.gm-style-iw-d .btn {
    color: #ffffff !important;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-primary-hover)) !important;
    border: none !important;
}

/* Google Maps close button */
button.gm-ui-hover-effect,
.gm-ui-hover-effect {
    background: rgba(0, 0, 0, 0.05) !important;
}

button.gm-ui-hover-effect:hover,
.gm-ui-hover-effect:hover {
    background: rgba(0, 0, 0, 0.1) !important;
}

button.gm-ui-hover-effect span,
.gm-ui-hover-effect span {
    color: #666666 !important;
}

/* Info window background wrapper */
.gm-style .gm-style-iw-t::after {
    background: #ffffff !important;
}

/* Info window tail/pointer */
.gm-style .gm-style-iw-tc::after {
    background: #ffffff !important;
}
