/* CSS Custom Properties */
:root {
  --text-muted: #6c757d;
  --text-muted-hover: #545b62;
  --text-dark: #212529;
  --text-medium: #495057;
  --primary-blue: #007bff;
  --primary-blue-hover: #0056b3;
  --accent-blue-light: #e8f4f8; /* Light blue from CTA band - subtle accent color */
  --accent-blue-medium: #d4e8f0; /* Medium blue from CTA band gradient */
  --warning-yellow: #e6a700; /* Darker yellow for WCAG AA contrast (3:1 minimum for UI components) */
  --border-light: #dee2e6;
  --border-lighter: #e1e4e8;
  --bg-light: #fafbfc;
  --bg-light-gray: #f8f9fa;
  --bg-breadcrumb: #eaecf0;
  --white: #ffffff;
  --placeholder-color: #8c959d;
  --logo-circle-bg: #1e3a5f;
  --gradient-blue-start: #2c5282;
  --gradient-blue-end: #1e3a5f;
  --featured-gradient: linear-gradient(135deg, #eaf0fb 0%, #f4f7fc 100%);
  --featured-calendar-gradient: linear-gradient(135deg, #1a4f82 0%, #2d6db5 100%);
  --featured-border-accent: #f0a030;

  /* Crosshatch pattern variables - decorative overlays for gradient backgrounds
     Light pattern: white lines for dark backgrounds (navbar, hero, footer)
     Dark pattern: black lines for light backgrounds (breadcrumb) */
  --crosshatch-pattern-light:
    linear-gradient(45deg, transparent 49%, rgba(255, 255, 255, 0.6) 49%, rgba(255, 255, 255, 0.6) 51%, transparent 51%),
    linear-gradient(-45deg, transparent 49%, rgba(255, 255, 255, 0.6) 49%, rgba(255, 255, 255, 0.6) 51%, transparent 51%);
  --crosshatch-pattern-dark:
    linear-gradient(45deg, transparent 49%, rgba(0, 0, 0, 0.1) 49%, rgba(0, 0, 0, 0.1) 51%, transparent 51%),
    linear-gradient(-45deg, transparent 49%, rgba(0, 0, 0, 0.1) 49%, rgba(0, 0, 0, 0.1) 51%, transparent 51%);
  --crosshatch-size: 60px;

  /* Z-index layers for pattern overlays */
  --z-pattern-overlay: 0;
  --z-content-above-pattern: 1;
}

/* Main content area - flex layout to push footer to bottom */
content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Placeholder text styling - lighter color to distinguish from user input */
/* Override Bootstrap's default placeholder color */
.form-control::placeholder,
.form-select::placeholder,
textarea::placeholder,
input::placeholder {
  color: var(--placeholder-color);
  opacity: 1;
}

/* Top navigation */
.navbar.bg-dark {
  background: linear-gradient(180deg, var(--gradient-blue-start) 0%, var(--gradient-blue-end) 100%) !important;
  padding-left: 1rem;
  position: relative;
  overflow: hidden;
}

/* Crosshatch pattern overlay for navbar */
.navbar.bg-dark::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--crosshatch-pattern-light);
  background-size: var(--crosshatch-size) var(--crosshatch-size);
  opacity: 0.03;
  pointer-events: none;
  z-index: var(--z-pattern-overlay);
}

/* Ensure navbar content stays above the pattern */
.navbar.bg-dark > * {
  position: relative;
  z-index: var(--z-content-above-pattern);
}


/* Visible focus indicator for keyboard navigation (WCAG 2.1 Level AA) */
.navbar-brand:focus {
  outline: 2px solid #ffffff;
  outline-offset: 4px;
  border-radius: 4px;
}

/* ============================================
   Footer Styles
   ============================================ */

.site-footer {
  --footer-accent: #2c5282;
  --footer-text: #f8f9fa;
  --footer-muted: #a0aec0;

  background: linear-gradient(180deg, var(--gradient-blue-end) 0%, var(--gradient-blue-start) 100%);
  color: var(--footer-text);
  padding: 0;
  margin-top: auto;
  position: relative;
  overflow: hidden;
  border-top: 2px solid #3d8fc0;
}

/* Crosshatch pattern overlay for footer */
.site-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--crosshatch-pattern-light);
  background-size: var(--crosshatch-size) var(--crosshatch-size);
  opacity: 0.03;
  pointer-events: none;
  z-index: var(--z-pattern-overlay);
}

/* Ensure footer content stays above the pattern */
.site-footer .container {
  padding: 3rem 1.5rem 2rem;
  position: relative;
  z-index: var(--z-content-above-pattern);
}

/* Asymmetric 3-column grid */
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 3rem;
  align-items: start;
}

/* Brand column */
.footer-brand {
  border-left: 3px solid var(--footer-accent);
  padding-left: 1.25rem;
}

.footer-logo {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--footer-text);
}

.footer-tagline {
  font-size: 0.9rem;
  color: var(--footer-muted);
  margin-top: 0.75rem;
  margin-bottom: 0;
  line-height: 1.5;
}

/* Navigation column */
.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-nav a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--footer-text);
  text-decoration: none;
  position: relative;
  width: fit-content;
  padding-bottom: 2px;
  transition: color 0.2s ease;
}

.footer-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--footer-accent);
  transition: width 0.3s ease;
}

.footer-nav a:hover {
  color: var(--footer-accent);
}

.footer-nav a:hover::after {
  width: 100%;
}

/* Mission column */
.footer-mission {
  background: rgba(255, 255, 255, 0.03);
  padding: 1.5rem;
  border-radius: 0.375rem;
  border-top: 2px solid var(--footer-accent);
}

.footer-mission p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--footer-muted);
  margin: 0;
}

.footer-mission p + p {
  margin-top: 0.75rem;
}

.footer-mission a {
  color: var(--footer-text);
}

.footer-mission a:hover {
  color: #fff;
}

/* Bottom bar */
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-copyright {
  font-size: 0.85rem;
  color: var(--footer-muted);
  margin: 0;
}

.footer-sponsor {
  font-size: 0.8rem;
  color: var(--footer-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-sponsor:hover {
  color: var(--footer-text);
}

/* Footer responsive */
@media (max-width: 992px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-mission {
    grid-column: 1 / -1;
  }
}

@media (max-width: 576px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* ============================================
   Avatar & User Photo Utilities
   ============================================ */

/* Avatar size progression: xs (24px) → sm (28px) → md (48px) → lg (80px)
   Used for user avatars across different UI contexts:
   - xs: dropdown menu items
   - sm: mobile header, compact lists
   - md: profile cards, standard displays
   - lg: edit pages, full profile views
   - placeholder: special size for user list placeholders (40px) */

.avatar-xs {
  width: 24px;
  height: 24px;
}

.avatar-sm {
  width: 28px;
  height: 28px;
}

.avatar-md {
  width: 48px;
  height: 48px;
}

.avatar-lg {
  width: 80px;
  height: 80px;
}

.avatar-placeholder {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   Layout & Container Utilities
   ============================================ */

.description-cell {
  max-width: 300px;
}

.search-input-container {
  width: 100%;
  max-width: 500px;
}

.hero-search-check {
  margin-left: 1rem;
}

/* Default: light background (search results page) */
.search-tips-trigger {
  color: var(--bs-secondary-color, #6c757d);
  text-decoration: none;
  font-size: 0.875rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.search-tips-trigger:hover,
.search-tips-trigger:focus {
  color: var(--bs-body-color, #212529);
  text-decoration: underline;
}

/* Dark background variant (hero section) */
.hero-section .search-tips-trigger {
  color: rgba(255, 255, 255, 0.7);
}

.hero-section .search-tips-trigger:hover,
.hero-section .search-tips-trigger:focus {
  color: rgba(255, 255, 255, 0.95);
}

.search-help-table td,
.search-help-table th {
  vertical-align: top;
  padding: 0.4rem 0.6rem;
  font-weight: normal;
}

.search-help-table code {
  white-space: nowrap;
}

.auth-button-container {
  max-width: 300px;
}

.qr-code-container {
  max-width: 200px;
}

/* ============================================
   Brand & Logo
   ============================================ */

.navbar-logo {
  height: clamp(1.75rem, 4vw, 3rem); /* Scales 28-48px based on viewport */
  margin-right: 0.625rem; /* 10px */
}

/* ============================================
   Typography Utilities
   ============================================ */

.legend-text {
  font-size: 1rem;
}

.badge-sm {
  font-size: 0.875rem;
}

/* Utility class for badges that may wrap to multiple lines */
.badge-wrap {
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
}

.verification-code {
  letter-spacing: 0.3em;
  font-size: 1.5rem;
  text-transform: uppercase;
}

/* ============================================
   Interactive Elements
   ============================================ */

.summary-clickable {
  cursor: pointer;
}

/* ============================================
   Honeypot Fields (Anti-spam)
   ============================================ */

.honeypot-field {
  position: absolute;
  left: -9999px;
}

/* Star button styling */
.star-btn, .org-star-btn {
  background: none;
  border: none;
  padding: 0;
  margin-left: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  transition: color 0.2s;
}

.star-btn:hover, .org-star-btn:hover {
  color: var(--text-medium);
}

.star-btn.starred, .org-star-btn.starred {
  color: var(--warning-yellow);
}

.star-btn:hover .bi, .org-star-btn:hover .bi {
  transform: scale(1.1);
}

.star-btn .bi, .org-star-btn .bi {
  transition: transform 0.2s;
}

.star-btn:disabled, .org-star-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Toast container styling */
.toast-container {
  z-index: 9999;
}

/* Calendar dropdown styling */
.calendar-dropdown {
  display: inline-block;
  margin-left: 8px;
}

.calendar-dropdown .btn-link {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
}

.calendar-dropdown .btn-link:hover {
  color: var(--text-medium);
}

.calendar-dropdown .dropdown-toggle::after {
  display: none;
}

.calendar-dropdown-link {
  display: inline-block;
  margin-left: 8px;
  color: var(--text-muted);
  font-size: 1rem;
}

.calendar-dropdown-link:hover {
  color: var(--text-medium);
}

/* Fix dropdown positioning to prevent horizontal overflow */
.navbar .dropdown-menu {
  right: 0;
  left: auto;
}

/* Honeypot field - hidden spam trap */
.honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

/* ============================================
   Login Page Styles
   ============================================ */

/* OR divider - visual separator between auth methods */
.or-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
}

.or-divider::before,
.or-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-light, #dee2e6);
}

.or-divider span {
  padding: 0 1rem;
  color: var(--text-muted, #6c757d);
  font-size: 0.875rem;
}

/* Auth button styling for login page */
.auth-button-container {
  width: 240px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
}

.auth-button-container img {
  max-width: 100%;
  height: 48px;
}

.auth-button-container a {
  padding: 8px 32px;
  display: inline-block;
}

/* Past event styling - works with .listing-card */
.past-event.listing-card {
  opacity: 0.6;
  border-left-color: var(--border-light);
}

.past-event a {
  color: var(--text-muted);
}

/* Featured event badge */
.badge-featured {
  background-color: var(--gradient-blue-end);
  color: #fff;
}

/* Featured styling - shared by events and organizations */
.listing-card.featured-event,
.listing-card.featured-organization {
  border: 1px solid #cddcf0;
  border-left: 3px solid var(--featured-border-accent);
  background: var(--featured-gradient);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Non-featured organization cards use .listing-card border for visual separation.
   No additional separators or special styling needed. */

/* Tag filter section */
.tag-filter-container {
  padding-left: 0.875rem; /* Match country-item padding */
}

.tag-filter-label {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-medium, #495057);
  white-space: nowrap;
}

.tag-filter-btn {
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
}

.tag-filter-more-btn {
  margin-bottom: 0.25rem;
  color: var(--bs-link-color);
  font-size: 0.8125rem;
}

/* On mobile, put "Filter by:" on its own line and reduce tag button size */
@media (max-width: 576px) {
  .tag-filter-label {
    width: 100%; /* Forces tags to wrap to next line */
    margin-bottom: 0.25rem;
  }

  .tag-filter-btn,
  .tag-filter-more-btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
}

/* Breadcrumb background */
.breadcrumb-bg {
  background-color: var(--bg-breadcrumb);
  position: relative;
  overflow: hidden;
}

/* Crosshatch pattern overlay for breadcrumb - darker lines for light background */
.breadcrumb-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--crosshatch-pattern-dark);
  background-size: var(--crosshatch-size) var(--crosshatch-size);
  opacity: 0.15;
  pointer-events: none;
  z-index: var(--z-pattern-overlay);
}

/* Ensure breadcrumb content stays above the pattern */
.breadcrumb-bg .breadcrumb {
  position: relative;
  z-index: var(--z-content-above-pattern);
}

/* Remove underlines from breadcrumb links */
.breadcrumb-item a {
  text-decoration: none;
  color: var(--primary-blue);
}

.breadcrumb-item a:hover {
  text-decoration: underline;
  color: var(--primary-blue-hover);
}

/* Remove bottom margin from breadcrumb ol */
.breadcrumb-bg .breadcrumb {
  margin-bottom: 0;
}

/* Organization section wrapper - subtle border around entire section */
.organizations-section-wrapper {
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 16px;
  background: var(--bg-light);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Shared card styling for events and organizations */
.listing-card {
  background: var(--white);
  border: 1px solid var(--border-lighter);
  border-left: 3px solid var(--accent-blue-light);
  border-radius: 4px;
  padding: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.listing-card:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  border-left-color: var(--accent-blue-medium);
}

.listing-card strong {
  font-size: 1.1em;
}

.listing-card a strong {
  color: inherit;
}

.listing-card a {
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 500;
}

.listing-card a:hover {
  color: var(--primary-blue-hover);
  text-decoration: underline;
}

.listing-card .text-muted {
  color: var(--text-muted) !important;
  font-size: 0.9em;
}

.listing-card p.text-muted {
  margin-top: 8px;
  margin-bottom: 4px;
  line-height: 1.4;
}

/* Organization card - extends listing-card */
.organization-card {
  /* Inherits all .listing-card styles */
}

/* Event card - extends listing-card */
.event-card {
  /* Inherits all .listing-card styles */
}

/* Organization description quote styling */
.organization-description {
  border-left: 3px solid var(--border-light);
  padding-left: 12px;
  font-style: italic;
  margin-left: 0;
}

/* Tom Select tag input customization */
.tag-select-control {
  min-height: 38px;
}

.ts-control {
  border: 1px solid var(--border-light);
  border-radius: 0.375rem;
}

.ts-control .item {
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  margin: 0.125rem;
  font-size: 0.875rem;
}

.ts-dropdown {
  border: 1px solid var(--border-light);
  border-radius: 0.375rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  max-height: 300px;
  overflow-y: auto;
}

.ts-dropdown .option {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  color: var(--text-dark);
}

/* Active state (keyboard navigation) */
.ts-dropdown .option.active {
  background-color: var(--primary-blue);
  color: white !important;
}

/* Hover state */
.ts-dropdown .option:hover {
  background-color: var(--bg-light);
  color: var(--text-dark) !important;
}

/* Active + hover state (keyboard selection while hovering) */
.ts-dropdown .option.active:hover {
  background-color: var(--primary-blue-hover);
  color: white !important;
}

/* Selected state (for already selected items shown in dropdown) */
.ts-dropdown .option.selected {
  background-color: #e9ecef;
  color: var(--text-dark) !important;
}

/* Mobile-friendly improvements for Tom Select */
@media (max-width: 768px) {
  .ts-control {
    min-height: 44px;
  }

  .ts-control .item {
    padding: 0.375rem 0.625rem;
    font-size: 0.9375rem;
  }

  .ts-dropdown {
    max-height: 250px;
  }

  .ts-dropdown .option {
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
  }

  /* Make remove buttons larger on mobile */
  .ts-control .remove {
    padding: 0.25rem 0.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
  }
}

/* Homepage sections */

/* Hero Section with Search */
.hero-section {
  background: linear-gradient(180deg, var(--gradient-blue-start) 0%, var(--gradient-blue-end) 100%);
  color: var(--white, white);
  padding: 3rem 0 2.5rem;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}

/* Crosshatch pattern overlay - Extra Thin Lines variation */
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--crosshatch-pattern-light);
  background-size: var(--crosshatch-size) var(--crosshatch-size);
  opacity: 0.03;
  pointer-events: none;
  z-index: var(--z-pattern-overlay);
}

/* Ensure hero content stays above the pattern */
.hero-section > * {
  position: relative;
  z-index: var(--z-content-above-pattern);
}

.hero-headline {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.hero-tagline {
  font-size: 1.1rem;
  margin-bottom: 0;
  line-height: 1.5;
  opacity: 0.95;
}

.hero-tagline a {
  color: inherit;
  text-decoration: underline;
}


/* Mobile responsiveness improvements */
@media (max-width: 768px) {
  .container {
    max-width: 100% !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

  /* Ensure full width on mobile for better readability */
  .container-fluid {
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Adjust search form on mobile */
  .navbar-nav .form-inline {
    width: 100%;
    margin-top: 10px;
  }

  .navbar-nav .input-group {
    width: 100%;
  }

  /* Hero section mobile adjustments */
  .hero-headline {
    font-size: 1.75rem;
  }

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

  .hero-section {
    padding: 2rem 0 2rem;
  }

  /* Star button touch targets - WCAG 2.1 Level AA requires 24x24px minimum */
  .star-btn, .org-star-btn {
    padding: 8px; /* Creates 32x32px touch target (16px icon + 8px padding on each side) */
    margin-left: 4px; /* Reduced from 8px to account for added padding */
  }
}

/* Organization Autocomplete Styles */
.autocomplete-container {
  position: relative;
}

.autocomplete-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white, #ffffff);
  border: 1px solid var(--border-light, #dee2e6); /* Bootstrap gray-300 */
  border-radius: 0.375rem;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.autocomplete-results.show {
  display: block;
}

.autocomplete-result-item {
  padding: 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-lighter, #e1e4e8);
}

/* Mobile-friendly improvements for autocomplete (WCAG 2.1 AA) */
@media (max-width: 768px) {
  .autocomplete-results {
    max-height: 250px;
  }

  .autocomplete-result-item {
    padding: 14px 12px; /* Creates ~46px touch target */
  }
}

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

.autocomplete-result-item:hover,
.autocomplete-result-item.highlighted {
  background: var(--bg-light, #fafbfc);
}

/* Loading, error, and no-results states */
.autocomplete-loading,
.autocomplete-error,
.autocomplete-no-results {
  padding: 12px;
  color: var(--text-muted, #6c757d);
  font-style: italic;
  text-align: center;
}

.autocomplete-error {
  color: var(--danger, #dc3545); /* Bootstrap danger red */
}

.autocomplete-result-item .org-name {
  font-weight: 500;
  color: var(--text-dark, #212529);
}

.autocomplete-result-item .org-tags {
  margin-top: 4px;
}

.autocomplete-result-item .org-location {
  margin-top: 2px;
}

.autocomplete-result-item .place-name {
  font-weight: 500;
  color: var(--text-dark, #212529);
}

.autocomplete-result-item .place-address {
  margin-top: 2px;
}

.selected-organization {
  margin-top: 8px;
  padding: 10px 12px;
  background: #e8f4f8;
  border: 1px solid #b8daeb;
  border-radius: 4px;
  display: none;
}

.selected-organization.show {
  display: block;
}

.selected-organization .clear-organization {
  padding: 0.125rem 0.375rem;
  font-size: 0.875rem;
  line-height: 1;
}

@media (max-width: 768px) {
  .selected-organization {
    padding: 12px;
  }
}

.organization-save-error:empty,
.organization-saving-indicator:empty {
  display: none;
}

/* Multi-Organization Wizard Styling */
/* Refined workflow aesthetic with sophisticated colors and smooth interactions */

:root {
  --wizard-primary: #1e3a5f;
  --wizard-primary-light: #2c5282;
  --wizard-bg-overlay: rgba(30, 58, 95, 0.03);
  --wizard-border: #e2e8f0;
  --wizard-shadow-sm: 0 1px 3px rgba(30, 58, 95, 0.08);
  --wizard-shadow-md: 0 4px 12px rgba(30, 58, 95, 0.12);
}

/* Wizard Header - Rich gradient with sophisticated styling */
.wizard-header {
  background: linear-gradient(135deg, var(--wizard-primary) 0%, var(--wizard-primary-light) 100%);
  border: none !important;
  border-radius: 8px;
  padding: 1.75rem 1.5rem;
  color: white !important;
  box-shadow: var(--wizard-shadow-md);
  position: relative;
  overflow: hidden;
  animation: wizardHeaderFadeIn 0.4s ease-out;
}

@keyframes wizardHeaderFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Subtle overlay pattern for depth */
.wizard-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.wizard-header .alert-heading,
.wizard-header p,
.wizard-header strong,
.wizard-header i,
.wizard-header span,
.wizard-header hr {
  position: relative;
  color: white !important;
}

.wizard-header .alert-heading {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wizard-header .alert-heading i {
  font-size: 1.75rem;
  opacity: 0.9;
}

.wizard-header p {
  margin-bottom: 0.5rem;
  font-size: 1rem;
  line-height: 1.6;
  opacity: 0.95;
}

.wizard-header p strong {
  font-weight: 600;
  opacity: 1;
}

.wizard-header hr {
  border-color: rgba(255, 255, 255, 0.25);
  margin: 1rem 0;
  opacity: 1;
}

/* Wizard progress bar */
.wizard-progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  margin-top: 0.75rem;
  overflow: hidden;
}

.wizard-progress-fill {
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Wizard extraction info badge - integrated into header */
.wizard-extraction-info {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.95rem;
  margin-top: 0.5rem;
  backdrop-filter: blur(10px);
}

.wizard-extraction-info i {
  font-size: 1.1rem;
}

/* Wizard actions container - Better spacing and organization */
.wizard-actions {
  background: var(--wizard-bg-overlay);
  border-top: 2px solid var(--wizard-border) !important;
  border-radius: 0 0 6px 6px;
  padding: 1.25rem 1rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .wizard-header {
    padding: 1.5rem 1.25rem;
  }

  .wizard-header .alert-heading {
    font-size: 1.25rem;
  }

  .wizard-header .alert-heading i {
    font-size: 1.5rem;
  }

  .wizard-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .wizard-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Animation for wizard progression */
@keyframes wizardProgress {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.wizard-mode form {
  animation: wizardProgress 0.3s ease-out;
}

/* Gradient Card - Reusable gradient styling for featured cards */
.gradient-card {
  background: linear-gradient(135deg, var(--wizard-primary) 0%, var(--wizard-primary-light) 100%);
  border: none !important;
  border-radius: 8px;
  color: white !important;
  box-shadow: var(--wizard-shadow-md);
  position: relative;
  overflow: hidden;
}

.gradient-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.gradient-card .card-body,
.gradient-card .card-header,
.gradient-card .card-title,
.gradient-card .card-text,
.gradient-card p,
.gradient-card h1,
.gradient-card h2,
.gradient-card h3,
.gradient-card h4,
.gradient-card h5,
.gradient-card h6,
.gradient-card i,
.gradient-card .bi {
  position: relative;
  color: white !important;
}

.gradient-card .card-title {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.gradient-card .btn-primary {
  background-color: white;
  border-color: white;
  color: var(--wizard-primary) !important;
  font-weight: 600;
}

.gradient-card .btn-primary:hover {
  background-color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.9);
  color: var(--wizard-primary) !important;
}

.gradient-card .text-muted {
  color: rgba(255, 255, 255, 0.85) !important;
}

/* ============================================
   Accessibility - Reduced Motion Support
   ============================================ */

/* Respect user's motion preferences for accessibility
   Disables all transitions and animations for users with
   vestibular disorders or motion sensitivity */
@media (prefers-reduced-motion: reduce) {
  /* Footer navigation links */
  .footer-nav a,
  .footer-nav a::after {
    transition: none;
  }

  /* Footer sponsor link */
  .footer-sponsor {
    transition: none;
  }

  /* Star button interactions */
  .star-btn,
  .star-btn .bi,
  .org-star-btn,
  .org-star-btn .bi {
    transition: none;
  }

  /* Disable hover scale animation */
  .star-btn:hover .bi,
  .org-star-btn:hover .bi {
    transform: none;
  }

  /* Organization cards */
  .organization-card {
    transition: none;
  }

  /* Wizard progress bar */
  .wizard-progress-fill {
    transition: none;
  }

  /* Wizard animations */
  .wizard-header {
    animation: none;
  }

  .wizard-mode form {
    animation: none;
  }

  /* Breadcrumb links */
  .breadcrumb-item a {
    transition: none;
  }

  /* Disable decorative patterns for users with motion sensitivity
     Static patterns can still cause visual discomfort for some users */
  .navbar.bg-dark::before,
  .site-footer::before,
  .breadcrumb-bg::before,
  .hero-section::before {
    display: none;
  }
}

/* ============================================
   Accessibility - High Contrast Support
   ============================================ */

/* Disable decorative patterns for users who prefer high contrast
   Patterns can reduce perceived contrast and visual clarity */
@media (prefers-contrast: high) {
  .navbar.bg-dark::before,
  .site-footer::before,
  .breadcrumb-bg::before,
  .hero-section::before {
    display: none;
  }
}

/* ============================================
   Accessibility - Reduced Transparency Support
   ============================================ */

/* Disable decorative patterns for users who prefer reduced transparency
   Some users with cognitive or visual processing differences benefit from
   simpler, flatter designs without overlays */
@media (prefers-reduced-transparency: reduce) {
  .navbar.bg-dark::before,
  .site-footer::before,
  .breadcrumb-bg::before,
  .hero-section::before {
    display: none;
  }
}

/* ============================================
   Credit System Visibility Styles
   ============================================ */

/* Credit badge in navbar */
.credit-badge {
  font-size: 0.875rem;
  padding: 0.25em 0.6em;
  cursor: pointer;
  text-decoration: none;
}

.credit-badge:hover {
  opacity: 0.8;
  text-decoration: none;
}

/* Profile credit card enhancements */
#credits.card {
  scroll-margin-top: 80px; /* Offset for navbar when jumping to anchor */
}

#credits .credit-display {
  font-size: 1.1rem;
}

/* Subtle card background tints for credit status */
#credits.border-warning {
  background-color: rgba(255, 193, 7, 0.03);
}

#credits.border-danger {
  background-color: rgba(220, 53, 69, 0.03);
}

/* Progress bar styling */
#credits .progress {
  border-radius: 0.5rem;
  background-color: rgba(0, 0, 0, 0.05);
}

#credits .progress-bar {
  font-weight: bold;
  font-size: 0.875rem;
}

/* Responsive border utility - only show border on md breakpoint and up */
@media (min-width: 768px) {
  .border-md-end {
    border-right: var(--bs-border-width) var(--bs-border-style) var(--bs-border-color) !important;
  }
}

/* Calendar URL regeneration animation states */
.calendar-url-fading {
  transition: opacity 0.3s;
  opacity: 0.3;
}

.calendar-url-visible {
  opacity: 1;
  transition: opacity 0.3s;
}

.calendar-url-highlight {
  background-color: #d1f0d1 !important;
}

.calendar-url-highlight-fade {
  transition: background-color 1s;
  background-color: transparent !important;
}

/* Past events accordion */
.past-events-header {
  text-decoration: none;
  color: var(--text-muted);
}

.past-events-header:hover {
  color: var(--primary-blue);
}

.past-events-header .chevron {
  display: inline-block;
  transition: transform 0.2s ease;
  margin-right: 0.25rem;
}

.past-events-header[aria-expanded="true"] .chevron {
  transform: rotate(90deg);
}

/* ============================================
   Event Description with Top-Right Toggle
   ============================================ */

/* Event description with expandable toggle button
   - Short descriptions (≤ 250 chars): displayed as plain text, no toggle
   - Long descriptions (> 250 chars): top-right toggle button */

.event-description {
  margin-bottom: 1rem;
}

/* Header with Description label and toggle button */
.description-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e0e0e0;
  background: #f8f9fa;
}

.description-label {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--bs-body-color);
}

/* Toggle button (always top-right, never moves) */
.description-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  min-height: 44px; /* WCAG 2.1 Level AA touch target */
  width: 120px; /* Fixed width prevents text length changes */
  border: 1px solid var(--bs-link-color);
  background: white;
  color: var(--bs-link-color);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s;
}

.description-toggle:hover {
  background: var(--bs-link-color);
  color: white;
}

.description-toggle:focus-visible {
  outline: 2px solid var(--bs-link-color);
  outline-offset: 2px;
}

/* Chevron icon rotation animation */
.toggle-icon {
  display: inline-block;
  transition: transform 200ms ease;
  font-size: 0.75rem;
}

.description-toggle[aria-expanded="true"] .toggle-icon {
  transform: rotate(180deg);
}

/* Toggle text (Show more / Show less) */
.description-toggle .desc-show-less {
  display: none;
}

.description-toggle[aria-expanded="true"] .desc-show-more {
  display: none;
}

.description-toggle[aria-expanded="true"] .desc-show-less {
  display: inline;
}

/* Description content area */
.description-content {
  padding: 1rem;
}

/* Text visibility (collapsed vs expanded) */
.desc-collapsed,
.desc-expanded,
.desc-full {
  line-height: 1.6;
  color: var(--bs-body-color);
}

.desc-expanded {
  display: none;
}

/* When toggle is expanded, show full text and hide truncated */
/* Use :has() to check if parent container has expanded button */
.event-description:has(.description-toggle[aria-expanded="true"]) .desc-collapsed {
  display: none;
}

.event-description:has(.description-toggle[aria-expanded="true"]) .desc-expanded {
  display: inline;
}

/* Graceful degradation: show full description when JS is disabled */
@supports not (display: flex) {
  .description-text.expanded {
    display: block;
  }
}

/* Review Queue Description Styles (mirrors event-description for table context) */
details.review-description {
  margin-bottom: 0;
}

details.review-description > summary {
  list-style: none;
  cursor: pointer;
}

details.review-description > summary::-webkit-details-marker {
  display: none;
}

details.review-description .desc-expanded,
details.review-description .desc-show-less {
  display: none;
}

details.review-description[open] .desc-collapsed,
details.review-description[open] .desc-show-more {
  display: none;
}

details.review-description[open] .desc-expanded,
details.review-description[open] .desc-show-less {
  display: inline;
}

details.review-description .desc-toggle-label {
  color: var(--bs-link-color);
  margin-left: 0.25rem;
}

details.review-description > summary:hover .desc-toggle-label {
  text-decoration: underline;
}

details.review-description > summary:focus-visible {
  outline: 2px solid var(--bs-link-color);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (max-width: 768px) {
  details.review-description > summary {
    padding: 0.5rem 0;
    min-height: 44px;
  }
}

div.review-description {
  margin-bottom: 0;
}

/* ============================================
   Form Validation Error Highlighting
   ============================================ */

/* Error alert at top of page - static, not sticky */
.validation-errors {
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Inline error messages dynamically added by JavaScript (not in Bootstrap) */
.field-error-message {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #dc3545;
}

/* Note: Red borders, focus states, and .invalid-feedback display
   are handled by Bootstrap's built-in .was-validated class */

/* ============================================
   WCAG-Compliant Touch Targets
   ============================================ */

/* Button class for mobile touch target compliance
   WCAG 2.1 Level AA (2.5.5 Target Size) requires 44x44px minimum */
.btn-touch-target {
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 1rem; /* Increase padding for better touch area */
}

/* ==========================================================================
   Advertising Banner
   ========================================================================== */

.ad-banner {
  background: linear-gradient(135deg, #e8f4f8 0%, #d4e8f0 100%);
  border-bottom: 1px solid #b8daeb;
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

/* Subtle crosshatch pattern overlay - extra light for advertising banner */
.ad-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--crosshatch-pattern-dark);
  background-size: var(--crosshatch-size) var(--crosshatch-size);
  opacity: 0.5;
  pointer-events: none;
  z-index: var(--z-pattern-overlay);
}

/* Ensure banner content stays above the pattern */
.ad-banner > * {
  position: relative;
  z-index: var(--z-content-above-pattern);
}

.ad-banner-link {
  color: #2c5282;
  transition: color 0.2s ease;
}

.ad-banner-link:hover {
  color: #007bff;
}

.ad-banner strong {
  font-weight: 600;
}

/* ============================================
   CTA Banners - Shared base styles
   ============================================ */

/* Shared CTA banner structure */
.event-cta,
.organization-cta {
  padding: 0.5rem 0; /* Match ad-banner py-2 height */
  margin-top: auto; /* Push to bottom of flex container (content element) */
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}

/* Subtle crosshatch pattern overlay - opacity 0.25 (vs 0.5 for ad-banner) for better text readability */
.event-cta::before,
.organization-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--crosshatch-pattern-dark);
  background-size: var(--crosshatch-size) var(--crosshatch-size);
  opacity: 0.25;
  pointer-events: none;
  /* Layering strategy: z-index 0 = decorative pattern */
  z-index: var(--z-pattern-overlay);
}

/* Ensure CTA content stays above the pattern */
.event-cta > *,
.organization-cta > * {
  position: relative;
  /* Layering strategy: z-index 1 = interactive content above pattern */
  z-index: var(--z-content-above-pattern);
}

/* Remove container-fluid padding for full-width CTA */
.event-cta .container-fluid,
.organization-cta .container-fluid {
  padding-left: 0;
  padding-right: 0;
}

.event-cta-content,
.organization-cta-content {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.event-cta-text,
.organization-cta-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-dark);
}

.event-cta-link,
.organization-cta-link {
  color: var(--primary-blue);
  text-decoration: underline;
  font-weight: 600;
  /* Ensure adequate touch target while preserving visual spacing */
  display: inline-block;
  padding: 0.5rem 0.25rem;
  margin: -0.5rem -0.25rem;
}

.event-cta-link:hover,
.organization-cta-link:hover {
  color: var(--primary-blue-hover);
}

.event-cta-link:focus-visible,
.organization-cta-link:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (max-width: 768px) {
  .event-cta-text,
  .organization-cta-text {
    font-size: 0.875rem;
  }

  .event-cta-link,
  .organization-cta-link {
    /* Increase touch target on mobile for WCAG 2.1 AA compliance */
    padding: 0.75rem 0.5rem;
    margin: -0.75rem -0.5rem;
  }
}

/* Event CTA - Blue gradient to match site theme */
.event-cta {
  background: linear-gradient(135deg, #e8f4f8 0%, #d4e8f0 100%);
  border-bottom: 1px solid #b8daeb;
}

/* Organization CTA - Purple/lavender gradient */
.organization-cta {
  background: linear-gradient(135deg, #f3e8f8 0%, #e4d4f0 100%);
  border-bottom: 1px solid #d4b8eb;
}

/* Modal body with scrolling for long content */
.modal-body-scrollable {
  max-height: 60vh;
  overflow-y: auto;
}

/* ============================================
   Country Browser - Athletic Newspaper Design
   Dense, scannable columns inspired by classified ads
   and race result timing boards
   ============================================ */

/* Country grid layout - newspaper column aesthetic */
.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px; /* Tight grid like newspaper columns */
  margin-top: 1.5rem;
  background: #e1e4e8; /* Soft gray for grid lines */
  border: 1px solid #e1e4e8; /* Soft gray border */
  border-radius: 8px; /* Rounded corners */
  overflow: hidden; /* Ensures rounded corners apply to grid items */
}

/* Letter section headers - makes alphabetical sorting obvious */
.country-letter-header {
  padding: 0.5rem 0.875rem;
  background: var(--accent-blue-medium); /* Light blue from CTA band */
  font-weight: 700;
  font-size: 0.75rem; /* Small, subtle */
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6b7280; /* Softer gray text */
  border-bottom: 1px solid #c0dce8;
  position: relative; /* For crosshatch overlay */
}

/* Crosshatch pattern on letter headers only */
.country-letter-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--crosshatch-pattern-dark);
  background-size: var(--crosshatch-size) var(--crosshatch-size);
  opacity: 0.15; /* Subtle but visible texture */
  pointer-events: none;
  z-index: 0;
}

/* Ensure letter text is above crosshatch */
.country-letter-header::before + * {
  position: relative;
  z-index: 1;
}

/* Individual country item - classified ad aesthetic */
.country-item {
  padding: 0.625rem 0.875rem; /* Tight but breathable */
  background: var(--accent-blue-light); /* Light blue from CTA band */
  transition: background-color 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  position: relative;
}

.country-item:hover {
  background: #c5ddf0; /* Slightly darker blue than letter headers */
}

/* Highlight user's country */
.country-item.user-country {
  background: linear-gradient(135deg, #fffef5 0%, #fff9e6 100%); /* Soft yellow like callout */
  border-left: 3px solid #ffd93d; /* Bright yellow accent */
  padding-left: calc(0.875rem - 3px); /* Compensate for border */
}

.country-item.user-country:hover {
  background: linear-gradient(135deg, #fff8d6 0%, #ffecb3 100%); /* More noticeable darker yellow on hover */
  border-left-color: #e6c235; /* Darker yellow border on hover */
}

/* Country name - bold like race bib numbers */
.country-name {
  font-weight: 700; /* Athletic boldness */
  font-size: 0.9375rem; /* 15px - tight but readable */
  letter-spacing: 0.01em; /* Slight tracking for clarity */
  color: #374151; /* Softer dark gray */
  display: block;
  line-height: 1.3;
}

/* Stats badges container - timing board aesthetic */
.country-stats {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
  font-variant-numeric: tabular-nums; /* Consistent number width like race clocks */
  align-items: baseline;
}

/* Individual stat badges - split time aesthetic */
.stat-badge {
  font-size: 0.8125rem; /* 13px - newspaper classified size */
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 500;
}

.stat-events {
  font-weight: 600; /* Primary stat gets emphasis */
  color: #047857; /* Dark green — 4.89:1 on #e8f4f8 bg */
  text-decoration: none;
}

.stat-events:hover {
  color: #065f46; /* 6.85:1 */
  text-decoration: underline;
}

.stat-active {
  color: #047857; /* Dark green — 4.89:1 on #e8f4f8 bg */
}

.stat-active:hover {
  color: #065f46; /* 6.85:1 */
  text-decoration: underline;
}

.stat-past {
  color: #4b5563; /* Dark gray — 6.74:1 on #e8f4f8 bg */
  font-style: italic; /* Subtle differentiation */
}

.stat-past:hover {
  color: #374151; /* 9.19:1 */
  text-decoration: underline;
}

.stat-orgs {
  color: #1d4ed8; /* Dark blue — 5.98:1 on #e8f4f8 bg */
}

.stat-orgs:hover {
  color: #1e40af; /* 7.78:1 */
  text-decoration: underline;
}

/* Summary section typography - newspaper header */
.country-browser-summary h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em; /* Tight heading */
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.country-browser-summary .lead-text {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-medium);
  margin-bottom: 1rem;
}

/* User location callout - highlighted bib aesthetic */
.user-location-callout {
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #fffef5 0%, #fff9e6 100%); /* Soft yellow background */
  border: 1px solid #e8e8e8; /* Gentle gray border - easy on the eyes */
  border-radius: 4px;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.user-location-callout strong {
  display: block;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: #6b6b6b; /* Soft gray text */
  margin-bottom: 0.5rem;
}

.user-location-rows {
  display: grid;
  grid-template-columns: auto auto auto;
  gap: 0.375rem 0.5rem;
  align-items: center;
  width: fit-content;
}

.user-location-row {
  display: contents;
}

.user-location-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1a1a1a;
}

.user-location-callout .badge-events,
.user-location-callout .badge-orgs {
  justify-self: stretch;
  text-align: right;
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: 1rem;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.3;
}

.user-location-callout .badge-events {
  background-color: #2a5298;
  color: white;
}

.user-location-callout .badge-events:hover {
  background-color: #1e3c72;
}

.user-location-callout .badge-orgs {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #dbeafe;
}

.user-location-callout .badge-orgs:hover {
  background-color: #dbeafe;
  color: #1e40af;
}

/* Responsive adjustments - maintain density */
@media (max-width: 992px) {
  .country-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (max-width: 768px) {
  .country-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .country-item {
    padding: 0.5rem 0.75rem;
  }

  .user-location-callout {
    padding: 0.875rem 1rem;
  }
}

@media (max-width: 576px) {
  .country-grid {
    grid-template-columns: 1fr 1fr; /* Two columns on mobile for scanability */
    gap: 1px;
  }

  .country-item {
    padding: 0.5rem 0.625rem;
  }

  .country-name {
    font-size: 0.875rem; /* 14px on mobile */
  }

  .stat-badge {
    font-size: 0.75rem; /* 12px on mobile — smaller than 13px desktop to fit two-column grid */
  }

  /* Stack search form checkbox below input on narrow screens */
  .hero-section .form-inline {
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero-search-check {
    margin-top: 0.5rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding-left: 0; /* Reset Bootstrap .form-check padding — flex gap handles spacing */
  }


}

/* FullCalendar overrides */
.fc .fc-event {
  border: none;
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 0.8rem;
  cursor: pointer;
}

/* Allow event titles to wrap in day cells instead of truncating with ellipsis.
   FullCalendar's embedded CSS sets overflow:hidden on the title and
   white-space:nowrap on the container — override both. */
.fc .fc-daygrid-event .fc-event-title {
  white-space: normal !important;
  overflow-wrap: break-word;
  overflow: visible !important;
}

.fc .fc-daygrid-event .fc-event-title-container {
  white-space: normal !important;
}

/* In compact multi-month views (6m, 12m), keep truncation since cells are small.
   The 3m stacked view has large enough cells for wrapping. */
.fc-multiMonth6-view .fc-daygrid-event .fc-event-title,
.fc-multiMonthYear-view .fc-daygrid-event .fc-event-title {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis;
}

.fc-multiMonth6-view .fc-daygrid-event .fc-event-title-container,
.fc-multiMonthYear-view .fc-daygrid-event .fc-event-title-container {
  white-space: nowrap !important;
}

/* Featured event gradient is applied via JS in calendar-grid.js using
   --featured-calendar-gradient (not --featured-gradient which is for listing cards).
   FullCalendar's embedded CSS takes precedence over external stylesheets. */
.fc .fc-event.fc-event-featured {
  border-left: 3px solid var(--featured-border-accent);
}

/* Smaller font keeps "+N more" text within compact calendar cells */
.fc .fc-daygrid-more-link {
  font-size: 0.7rem;
  white-space: nowrap;
}

.fc .fc-multimonth {
  border-color: var(--bs-border-color, #dee2e6);
}

/* Popover header: title + close button side by side (calendar popovers only) */
.calendar-event-popover .popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calendar-event-popover .popover-header .btn-close {
  padding: 0.25rem;
  margin: 0;
}

/* Shrink day numbers — they aren't touch targets */
.fc .fc-daygrid-day-number {
  font-size: 0.75rem;
  padding: 2px 4px;
}

#calendar-grid {
  min-height: 200px;
}

.fc-dayGridMonth-view .fc-daygrid-day-frame {
  min-height: 7em;
}

/* Keep non-grid calendar content at a readable width */
.calendar-narrow {
  max-width: 720px;
}

/* Mobile: tighter toolbar buttons and smaller text */
@media (max-width: 575.98px) {
  .fc .fc-toolbar {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .fc .fc-toolbar-title {
    font-size: 1rem;
  }

  .fc .fc-button {
    font-size: 0.75rem;
    padding: 0.4rem 0.5rem;
    min-height: 36px;
  }

  .fc .fc-daygrid-day-number {
    font-size: 0.65rem;
    padding: 1px 3px;
  }

  .fc .fc-event {
    font-size: 0.7rem;
    padding: 0 2px;
  }

  .fc .fc-col-header-cell-cushion {
    font-size: 0.7rem;
  }
}

@media (max-width: 400px) {
  .country-grid {
    grid-template-columns: 1fr; /* Single column only on very small screens */
  }
}

/* Organization event count badge - mobile-friendly sizing */
.org-event-badge {
  font-size: 0.875rem;
  padding: 0.375rem 0.625rem;
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
}

/* Mobile responsive adjustments (WCAG 2.1 AA - 44×44px minimum) */
@media (max-width: 768px) {
  .org-event-badge {
    font-size: 0.9375rem;
    padding: 0.625rem 0.875rem;
    min-height: 2.75rem; /* ~44px - WCAG Level AA compliance */
    margin-top: 0.5rem;
    display: inline-flex;
  }
}

/* Hybrid Organization + Events Design */
.organization-card {
  border-left: 4px solid #e2e8f0;
  transition: box-shadow 0.3s ease;
}

.organization-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.org-type-badge {
  display: inline-block;
  background: var(--primary-blue);
  color: white;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.org-tag-badge {
  display: inline-block;
  background: var(--logo-circle-bg);
  color: white;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .event-header-inline {
    flex-direction: column;
    gap: 0.4rem;
  }

  .event-date-badge {
    align-self: flex-start;
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .event-card,
  .organization-card {
    transition: none;
    transform: none;
  }

  .event-card:hover {
    transform: none;
  }
}

/* Bulk import URL preview table */
.bulk-url-table .url-label { cursor: pointer; min-width: 0; }
.bulk-url-table .url-text { max-width: 100%; }

/* Bulk org review table: stacked card layout on mobile */
@media (max-width: 767.98px) {
  .bulk-review-table thead {
    display: none;
  }

  .bulk-review-table tbody tr {
    display: block;
    border: 1px solid var(--border-light);
    border-radius: 0.375rem;
    margin-bottom: 0.75rem;
  }

  .bulk-review-table tbody td {
    display: block;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    padding: 0.5rem 0.75rem;
  }

  .bulk-review-table tbody td:last-child {
    border-bottom: none;
  }

  .bulk-review-table tbody tr.table-warning {
    border-color: #ffc107;
  }
}
