/* CSS Variables */
:root {
  /* Colors */
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --text-light: #ffffff;
  --text-dark: #2d3748;
  --text-muted: #718096;
  --border-color: rgba(255, 255, 255, 0.2);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.3);
  --success: #38a169;
  --warning: #ecc94b;
  --error: #e53e3e;
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  
  /* Border Radius */
  --border-radius: 16px;
  --border-radius-sm: 8px;
  --border-radius-lg: 24px;
  
  /* Transitions */
  --transition: all 0.3s ease;
  --transition-slow: all 0.5s ease;
  --transition-fast: all 0.15s ease;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.service-name {
  font-weight: 600;
  color: #2d3748; /* Default color for service names */
}

.police {
  color: #007bff; /* Blue for police */
}

.firefighter {
  color: #ff0000; /* Red for firefighters */
}

/* Remaining styles... */

body {
  font-family: 'Segoe UI', 'Roboto', sans-serif;
  background: var(--primary-gradient);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  line-height: 1.6;
  overflow-x: hidden;
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.container {
  width: 100%;
  max-width: 1200px;
  padding: 2rem;
  margin: 0 auto;
}

/* Header Styles */
.header {
  text-align: center;
  margin-bottom: 3rem;
  animation: fadeInUp 1s ease;
}

.main-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff 0%, #e2e8f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.highlight {
  background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
  font-weight: 300;
}

/* Main Content */
.main-content {
  margin-bottom: 4rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

/* Service Cards */
.service-card {
  position: relative;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius);
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  background: rgba(255, 255, 255, 0.15);
}

.service-card:hover .card-hover-effect {
  transform: scale(1);
  opacity: 1;
}

.card-icon {
  margin-bottom: 1.5rem;
}

.card-icon img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  transition: var(--transition);
}

.service-card:hover .card-icon img {
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.4);
}

.card-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-light);
}

.card-content p {
  opacity: 0.8;
  font-size: 0.95rem;
}

.card-hover-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  transform: scale(0.8);
  opacity: 0;
  transition: var(--transition);
  z-index: -1;
}

/* Emergency Section */
.footer {
  width: 100%;
}

.emergency-section {
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--border-radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.emergency-title {
  color: var(--text-dark);
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-align: center;
}

.emergency-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 250px;
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.copy-btn {
  padding: 0.75rem 1.5rem;
  background: var(--success);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.copy-btn:hover {
  background: #2c9c9c;
  transform: translateY(-2px);
}

/* Emergency Table */
.emergency-table-container {
  overflow-x: auto;
  margin-bottom: 2rem;
}

.emergency-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.emergency-table th {
  background: #667eea;
  color: white;
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.emergency-table td {
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
  color: var(--text-dark);
}

.emergency-table tr:last-child td {
  border-bottom: none;
}

.emergency-table tr:hover {
  background: #f7fafc;
}

.service-name {
  font-weight: 600;
  color: #2d3748;
}

.service-number {
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 1.1rem;
  color: #4a5568;
}

.copy-number-btn {
  padding: 0.5rem 1rem;
  background: #e6fffa;
  color: #234e52;
  border: 1px solid #81e6d9;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.copy-number-btn:hover {
  background: #b2f5ea;
  transform: translateY(-1px);
}

.error-message {
  text-align: center;
  color: #e53e3e;
  font-weight: 500;
}

/* Footer Copyright */
.footer-copyright {
  text-align: center;
  color: #718096;
  font-size: 0.9rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-overlay p {
  color: white;
  font-size: 1.1rem;
}

/* Notifications */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--success);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1001;
}

.notification.show {
  transform: translateX(0);
  opacity: 1;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .main-title {
    font-size: 2rem;
  }
  
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .service-card {
    padding: 2rem;
  }
  
  .emergency-section {
    padding: 1.5rem;
  }
  
  .emergency-controls {
    flex-direction: column;
  }
  
  .search-input {
    min-width: auto;
  }
  
  .emergency-table {
    font-size: 0.9rem;
  }
  
  .emergency-table th,
  .emergency-table td {
    padding: 0.75rem;
  }
}

@media (max-width: 480px) {
  .main-title {
    font-size: 1.5rem;
  }
  
  .subtitle {
    font-size: 1rem;
  }
  
  .service-card {
    padding: 1.5rem;
  }
  
  .card-icon img {
    width: 60px;
    height: 60px;
  }
  
  .emergency-table {
    font-size: 0.8rem;
  }
  
  .copy-number-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for accessibility */
.service-card:focus,
.search-input:focus,
.copy-btn:focus,
.copy-number-btn:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .service-card {
    border: 2px solid white;
  }
  
  .emergency-section {
    border: 2px solid #2d3748;
  }
}
