/* Brand Color Variables */
:root {
  --brand-navy: #0F172A;
  --brand-red: #B91C1C;
  --brand-offwhite: #F8FAFC;
  --brand-steel: #64748B;
  --brand-dark: #0A101C;
  --brand-navy-light: #162137;
}

/* Custom Tailwind Classes */
.bg-brand-navy { background-color: var(--brand-navy); }
.bg-brand-red { background-color: var(--brand-red); }
.bg-brand-offwhite { background-color: var(--brand-offwhite); }
.bg-brand-steel { background-color: var(--brand-steel); }
.bg-brand-dark { background-color: var(--brand-dark); }
.bg-brand-navy-light { background-color: var(--brand-navy-light); }

.text-brand-navy { color: var(--brand-navy); }
.text-brand-red { color: var(--brand-red); }
.text-brand-offwhite { color: var(--brand-offwhite); }
.text-brand-steel { color: var(--brand-steel); }
.text-brand-dark { color: var(--brand-dark); }

.border-brand-navy { border-color: var(--brand-navy); }
.border-brand-red { border-color: var(--brand-red); }
.border-brand-steel { border-color: var(--brand-steel); }
.border-brand-offwhite { border-color: var(--brand-offwhite); }
.border-brand-dark { border-color: var(--brand-dark); }

.hover\:bg-brand-offwhite:hover { background-color: var(--brand-offwhite); }
.hover\:text-brand-red:hover { color: var(--brand-red); }
.hover\:text-brand-navy:hover { color: var(--brand-navy); }
.hover\:bg-brand-red:hover { background-color: var(--brand-red); }
.hover\:text-white:hover { color: #ffffff; }

/* Industrial Grayscale Images — color on hover for usability */
.img-industrial {
  filter: grayscale(100%) contrast(1.25);
  transition: filter 0.3s ease;
}
.img-industrial:hover {
  filter: grayscale(0%) contrast(1);
}

/* Custom Checkbox - Industrial Style */
.checkbox-industrial {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--brand-steel);
  background-color: transparent;
  cursor: pointer;
  position: relative;
}

.checkbox-industrial:checked {
  background-color: var(--brand-red);
  border-color: var(--brand-red);
}

.checkbox-industrial:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Red Dash Section Label */
.section-label::before {
  content: '';
  display: inline-block;
  width: 32px;
  height: 2px;
  background-color: var(--brand-red);
  margin-right: 12px;
  vertical-align: middle;
}

/* Underline Input Style */
.input-underline {
  background-color: transparent;
  border: none;
  border-bottom: 1px solid var(--brand-steel);
  border-radius: 0;
  padding: 8px 0;
  outline: none;
  transition: border-color 0.2s;
}

.input-underline:focus {
  border-bottom-color: var(--brand-red);
}

/* Map Container */
#map {
  height: 500px;
  width: 100%;
  filter: grayscale(100%);
}

/* Leaflet Popup Customization */
.leaflet-popup-content-wrapper {
  border-radius: 0 !important;
  background-color: var(--brand-navy);
  color: var(--brand-offwhite);
}

.leaflet-popup-tip {
  background-color: var(--brand-navy) !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--brand-offwhite);
}

::-webkit-scrollbar-thumb {
  background: var(--brand-steel);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand-navy);
}

/* Smooth Transitions */
.transition-all {
  transition: all 0.3s ease;
}

/* Hover Effects for Cards */
.warehouse-card {
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.warehouse-card:hover {
  transform: translateX(4px);
  border-color: var(--brand-red);
}

/* Button Hover */
.btn-primary {
  background-color: var(--brand-red);
  color: white;
  padding: 14px 32px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-primary:hover {
  background-color: #991b1b;
}

.btn-secondary {
  background-color: transparent;
  color: var(--brand-navy);
  padding: 14px 32px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  border: 2px solid var(--brand-navy);
  cursor: pointer;
  transition: all 0.2s;
}

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

/* Loading State */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Success Message */
.success-message {
  background-color: #10b981;
  color: white;
  padding: 16px;
  margin-bottom: 24px;
  text-align: center;
  font-weight: 600;
}

/* Error Message */
.error-message {
  background-color: var(--brand-red);
  color: white;
  padding: 16px;
  margin-bottom: 24px;
  text-align: center;
  font-weight: 600;
}

/* Zone Tag */
.zone-tag {
  display: inline-block;
  padding: 6px 12px;
  background-color: var(--brand-navy);
  color: var(--brand-offwhite);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-right: 8px;
  margin-bottom: 8px;
}

.zone-tag.available {
  background-color: var(--brand-red);
}

/* Amenity Pill */
.amenity-pill {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--brand-steel);
  color: var(--brand-steel);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-right: 8px;
  margin-bottom: 8px;
}

/* Stats Display */
.stat-item {
  border-top: 2px solid var(--brand-red);
  padding-top: 16px;
}

.stat-value {
  font-size: 32px;
  font-weight: 600;
  color: var(--brand-navy);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--brand-steel);
  font-weight: 600;
}

/* =========================================================
   Mobile Optimizations
   ========================================================= */

/* Touch targets — minimum 44px on interactive elements */
@media (max-width: 768px) {
  #map {
    height: 300px;
  }

  .stat-value {
    font-size: 24px;
  }

  /* Enlarge touch targets for buttons and links */
  .btn-primary,
  .btn-secondary {
    padding: 16px 24px;
    min-height: 48px;
    font-size: 13px;
  }

  /* Larger tap area for filter inputs */
  .input-underline {
    padding: 12px 0;
    font-size: 16px; /* prevents iOS zoom on focus */
  }

  select.input-underline {
    font-size: 16px;
    min-height: 48px;
  }

  /* Checkbox touch targets */
  .checkbox-industrial {
    width: 24px;
    height: 24px;
  }

  .checkbox-industrial:checked::after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
  }

  /* Warehouse cards — full-width tap target */
  .warehouse-card {
    padding: 16px 0;
  }

  /* Compact booking cards on dashboard */
  .booking-card-actions {
    width: 100%;
    justify-content: stretch;
  }

  .booking-card-actions .btn-primary,
  .booking-card-actions .btn-secondary {
    flex: 1;
    text-align: center;
  }

  /* Sticky mobile CTA bar */
  .mobile-sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: var(--brand-navy);
    z-index: 40;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
  }

  .mobile-sticky-cta .btn-primary {
    width: 100%;
    padding: 14px 24px;
  }

  /* Add bottom padding to body when sticky CTA is present */
  body.has-sticky-cta {
    padding-bottom: 80px;
  }

  /* Mobile-first summary card (collapsible on booking page) */
  .mobile-summary-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--brand-navy);
    color: var(--brand-offwhite);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
  }

  .mobile-summary-toggle .iconify {
    transition: transform 0.2s;
  }

  .mobile-summary-toggle.active .iconify {
    transform: rotate(180deg);
  }

  /* Map popup touch improvements */
  .leaflet-popup-content-wrapper {
    min-width: 240px;
    padding: 12px !important;
  }

  .leaflet-popup-content {
    margin: 8px !important;
    font-size: 14px;
  }

  /* Stat cards — 2-column on mobile instead of 1 */
  .stats-grid-mobile {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Filter bar — stack vertically */
  .filter-bar-mobile {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Compact padding on mobile sections */
  .mobile-compact {
    padding-top: 8px;
    padding-bottom: 8px;
  }
}

/* Very small screens (< 375px) */
@media (max-width: 374px) {
  .stat-value {
    font-size: 20px;
  }

  .btn-primary,
  .btn-secondary {
    padding: 14px 16px;
    font-size: 12px;
  }
}

/* Safe area insets for notched phones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .mobile-sticky-cta {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  body.has-sticky-cta {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }
}
