/* Rapid Rescue - Optimized Black & White Theme */
/* Performance-optimized CSS with reduced redundancy and improved modularity */

:root {
  /* Streamlined color palette - only essential black/white/grey variables */
  --black: #000000;
  --white: #ffffff;
  --grey-100: #f5f5f5;
  --grey-300: #d4d4d4;
  --grey-400: #a3a3a3;
  --grey-600: #525252;
  --grey-700: #404040;
  --grey-800: #262626;
  --grey-900: #171717;

  /* Consolidated theme colors */
  --bg-primary: var(--black);
  --bg-secondary: var(--grey-900);
  --bg-card: var(--grey-900);
  --text-primary: var(--white);
  --text-secondary: var(--grey-400);
  --border-color: var(--grey-700);

  /* Optimized typography system */
  --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Simplified shadow system */
  --shadow: 0 4px 6px -1px rgba(255, 255, 255, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(255, 255, 255, 0.1);

  /* Unified transition timing */
  --transition: 0.2s ease-out;
  --transition-slow: 0.3s ease-out;
}

/* Import optimized with display=swap for better performance */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

/* Optimized global styles with better performance */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  font-family: var(--font-family);
  line-height: 1.6;
  font-weight: 400;
  margin: 0;
  overflow-x: hidden;
}

/* Consolidated typography with better hierarchy */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-family);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
}
h2 {
  font-size: 2rem;
}
h3 {
  font-size: 1.5rem;
}
h4 {
  font-size: 1.25rem;
}

/* Optimized card system with consistent styling */
.card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 12px !important;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  will-change: transform;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--white);
}

.card-header {
  background: var(--white) !important;
  color: var(--black) !important;
  border-bottom: 1px solid var(--border-color) !important;
  font-weight: 600;
  border: 1px white solid;
}

/* Streamlined form controls with better performance */
.form-control,
.form-select {
  background-color: var(--bg-primary) !important;
  border: 2px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  border-radius: 8px !important;
  padding: 12px 16px;
  font-weight: 500;
  transition: all var(--transition);
  will-change: transform, border-color;
}

.form-control:focus,
.form-select:focus {
  background-color: var(--bg-secondary) !important;
  border-color: var(--white) !important;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1) !important;
  color: var(--text-primary) !important;
  transform: translateY(-1px);
}

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

/* Optimized button system with consistent styling */
.btn {
  font-weight: 600;
  border-radius: 8px;
  padding: 12px 24px;
  transition: all var(--transition);
  border: none;
  position: relative;
  overflow: hidden;
  will-change: transform;
}

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

.btn-primary:hover {
  background: var(--grey-300);
  color: var(--black);
  transform: translateY(-2px);
}

.btn-outline-light {
  border: 2px solid var(--white);
  color: var(--white);
  background: transparent;
}

.btn-outline-light:hover {
  background: var(--white);
  color: var(--black);
  transform: translateY(-2px);
}

/* Simplified table styling */
.table-dark {
  --bs-table-bg: var(--bg-card);
  --bs-table-border-color: var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table-dark th {
  background: var(--grey-800);
  color: var(--white);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
}

.table-dark tbody tr {
  transition: background-color var(--transition);
}

.table-dark tbody tr:hover {
  background-color: var(--grey-800) !important;
}

/* Optimized hero section */
.hero-section {
  background: linear-gradient(135deg, var(--grey-900) 0%, var(--black) 100%);
  padding: 100px 0;
  position: relative;
}

.hero-section h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 24px;
}

.hero-section p {
  font-size: 1.25rem;
  margin-bottom: 32px;
  opacity: 0.9;
}

/* Streamlined info cards */
.info-card {
  transition: all var(--transition-slow);
  border-radius: 16px !important;
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  position: relative;
  will-change: transform;
}

.info-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-lg);
  border-color: var(--white);
}

.info-card .card-body {
  padding: 2rem;
}

.info-card i {
  font-size: 3rem;
  color: var(--white);
  margin-bottom: 1rem;
  transition: transform var(--transition-slow);
}

.info-card:hover i {
  transform: scale(1.1);
}

/* Consolidated alert system */
.alert {
  border-radius: 8px;
  border: none;
  font-weight: 500;
  box-shadow: var(--shadow);
}

.alert-success {
  background: var(--grey-800);
  border-left: 4px solid var(--white);
  color: var(--white);
}

.alert-danger {
  background: var(--grey-800);
  border-left: 4px solid var(--grey-400);
  color: var(--white);
}

.alert-warning {
  background: var(--grey-800);
  border-left: 4px solid var(--grey-300);
  color: var(--white);
}

.alert-info {
  background: var(--grey-800);
  border-left: 4px solid var(--grey-600);
  color: var(--white);
}

/* Simplified status badges */
.badge {
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.875rem;
}

.status-pending {
  background: var(--grey-600) !important;
  color: var(--white) !important;
}

.status-enroute {
  background: var(--grey-400) !important;
  color: var(--black) !important;
}

.status-completed {
  background: var(--white) !important;
  color: var(--black) !important;
}

/* Optimized navigation */
.navbar {
  backdrop-filter: blur(20px);
  background: rgba(0, 0, 0, 0.95) !important;
  border-bottom: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow);
}

.navbar-brand {
  font-weight: 800;
  font-size: 1.5rem;
  transition: transform var(--transition);
}

.navbar-brand:hover {
  transform: scale(1.05);
}

.nav-link {
  font-weight: 500;
  transition: all var(--transition);
  border-radius: 6px;
  margin: 0 4px;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

/* Simplified sidebar for admin */
.sidebar {
  background: var(--black) !important;
  border-right: 1px solid var(--border-color) !important;
}

.sidebar .nav-link {
  color: var(--grey-400) !important;
  padding: 12px 16px;
  margin-bottom: 4px;
  border-radius: 8px;
  transition: all var(--transition);
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background: var(--grey-800) !important;
  color: var(--white) !important;
  transform: translateX(4px);
}

/* Performance optimized animations */
.fade-in {
  opacity: 0;
  animation: fadeIn 0.6s ease-out forwards;
}

.slide-up {
  opacity: 0;
  transform: translateY(20px);
  animation: slideUp 0.6s ease-out forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive design optimizations */
@media (max-width: 768px) {
  .hero-section {
    padding: 60px 0;
  }

  .hero-section h1 {
    font-size: 2.5rem;
  }

  .info-card .card-body {
    padding: 1.5rem;
  }

  .sidebar {
    width: 100% !important;
    position: fixed !important;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
  }

  .sidebar.show {
    transform: translateX(0);
  }
}

@media (max-width: 576px) {
  .hero-section h1 {
    font-size: 2rem;
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
}

/* Performance utilities */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Focus styles for accessibility */
.btn:focus,
.form-control:focus,
.nav-link:focus {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

/* Map container optimization */
.map-container {
  height: 400px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all var(--transition);
}

.map-container:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--white);
}
