/**
 * EMT OnScene - Global Styles
 * Matches the design from the EMS landing page
 */

:root {
  /* EMS Brand Colors */
  --ems-primary: #013161;
  --ems-primary-alt: #dc3545;
  --ems-secondary: #0d6efd;
  --ems-dark: #212529;
  --ems-light: #f8f9fa;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 15px rgba(0,0,0,0.2);
}

/* Hover lift effect for cards */
.hover-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

/* Custom text colors for category icons */
.text-purple {
  color: #8E24AA !important;
}

.text-pink {
  color: #EC407A !important;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Navbar Styles */
.navbar {
  background: var(--ems-primary) !important;
  box-shadow: var(--shadow-sm);
}

.navbar-brand {
  font-weight: bold;
  font-size: 1.5rem;
}

/* Hero/Jumbotron Styles */
.jumbotron-custom {
  background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.7)),
              url('/assets/images/ambulance-hero.webp') center/cover;
  color: white;
  padding: 100px 0;
  margin-bottom: 0;
}

.jumbotron-custom h1 {
  font-size: 3.5rem;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.jumbotron-custom p {
  font-size: 1.5rem;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Button Styles */
.btn-ems {
  background-color: var(--ems-primary);
  border: none;
  padding: 12px 30px;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  color: white;
}

.btn-ems:hover {
  background-color: var(--ems-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: white;
}

.btn-ems:active, .btn-ems:focus {
  background-color: var(--ems-dark);
  color: white;
}

.btn-outline-ems {
  background-color: white;
  border: 1px solid var(--ems-primary);
  padding: 12px 30px;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  color: var(--ems-primary);
}

.btn-outline-ems:hover {
  background-color: var(--ems-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: white;
}

.btn-outline-ems:active, .btn-outline-ems:focus {
  background-color: var(--ems-dark);
  color: white;
}

/* Card Styles */
.card {
  border: none;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.card-img-top {
  height: 250px;
  object-fit: cover;
}

/* Section Titles */
.section-title {
  color: var(--ems-primary);
  font-weight: bold;
  margin-bottom: 2rem;
  position: relative;
  padding-bottom: 15px;
}

.section-title:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--ems-primary);
}

.section-title.text-start:after {
  left: 0;
  transform: translateX(0);
}

/* Text Container / Background Section */
.text-container {
  background-color: var(--ems-light);
  padding: 60px 0;
}

/* Stats Icons */
.stats-icon {
  font-size: 3rem;
  color: var(--ems-primary);
  margin-bottom: 1rem;
}

/* Footer Styles */
footer {
  background: linear-gradient(135deg, var(--ems-dark) 0%, #495057 100%);
  color: white;
  padding: 40px 0 20px;
  margin-top: auto;
}

footer a {
  color: #adb5bd;
  text-decoration: none;
  transition: color 0.3s ease;
}

footer a:hover {
  color: white;
}

/* Emergency Badge */
.emergency-badge {
  background-color: var(--ems-primary);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: bold;
  display: inline-block;
}

/* Form Styles */
.form-control:focus {
  border-color: var(--ems-primary);
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Auth Pages */
.auth-container {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}

.auth-card {
  max-width: 500px;
  width: 100%;
  margin: 0 auto;
}

.social-login-btn {
  width: 100%;
  margin-bottom: 10px;
  padding: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
}

.btn-google {
  background-color: #fff;
  border: 1px solid #ddd;
  color: #444;
}

.btn-google:hover {
  background-color: #f8f9fa;
  box-shadow: var(--shadow-sm);
}

.btn-facebook {
  background-color: #1877f2;
  border: none;
  color: white;
}

.btn-facebook:hover {
  background-color: #166fe5;
  color: white;
}

.btn-apple {
  background-color: #000;
  border: none;
  color: white;
}

.btn-apple:hover {
  background-color: #333;
  color: white;
}

/* Dashboard Styles */
.dashboard-card {
  border-left: 4px solid var(--ems-primary);
}

.progress-bar-custom {
  background-color: var(--ems-primary);
  height: 8px;
  border-radius: 4px;
}

/* Scenario Cards */
.scenario-card {
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.scenario-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.scenario-category-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: bold;
  color: white;
  text-transform: uppercase;
}

.difficulty-easy {
  background-color: #28a745;
}

.difficulty-medium {
  background-color: #ffc107;
  color: #000;
}

.difficulty-hard {
  background-color: #dc3545;
}

/* Question Styles */
.question-option {
  border: 2px solid #dee2e6;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: white;
}

.question-option:hover {
  border-color: var(--ems-primary);
  background-color: #f8f9fa;
}

.question-option.selected {
  border-color: var(--ems-secondary);
  background-color: rgba(13, 110, 253, 0.1);
}

.question-option.correct {
  border-color: #28a745;
  background-color: rgba(40, 167, 69, 0.1);
}

.question-option.incorrect {
  border-color: #dc3545;
  background-color: rgba(220, 53, 69, 0.1);
}

.question-option.disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Vital Signs Display */
.vitals-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-left: 4px solid var(--ems-primary);
  padding: 15px;
  margin-bottom: 20px;
}

.vital-item {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid #dee2e6;
}

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

/* Results/Statistics */
.stat-card {
  text-align: center;
  padding: 30px;
  border-radius: 10px;
  background: white;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
}

.stat-value {
  font-size: 3rem;
  font-weight: bold;
  color: var(--ems-primary);
  margin: 10px 0;
}

.stat-label {
  color: #6c757d;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Loading Spinner */
.spinner-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

/* Alert Styles */
.alert-ems {
  border-left: 4px solid var(--ems-primary);
  background-color: rgba(220, 53, 69, 0.1);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .jumbotron-custom h1 {
    font-size: 2.5rem;
  }

  .jumbotron-custom p {
    font-size: 1.2rem;
  }

  .navbar-brand {
    font-size: 1.2rem;
  }

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

  .stat-value {
    font-size: 2rem;
  }

  .card-img-top {
    height: 200px;
  }
}

@media (max-width: 576px) {
  .jumbotron-custom {
    padding: 60px 0;
  }

  .jumbotron-custom h1 {
    font-size: 2rem;
  }

  .jumbotron-custom p {
    font-size: 1rem;
  }

  .text-container {
    padding: 40px 0;
  }
}

/* Utility Classes */
.text-ems-primary {
  color: var(--ems-primary) !important;
}

.bg-ems-primary {
  background-color: var(--ems-primary) !important;
}

.text-ems-secondary {
  color: var(--ems-secondary) !important;
}

.bg-ems-secondary {
  background-color: var(--ems-secondary) !important;
}

.border-ems-primary {
  border-color: var(--ems-primary) !important;
}

/* Highlight Animation */
@keyframes highlightPulse {
  0% {
    background-color: transparent;
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
  }
  25% {
    background-color: rgba(220, 53, 69, 0.15);
    box-shadow: 0 0 15px 5px rgba(220, 53, 69, 0.3);
  }
  50% {
    background-color: rgba(220, 53, 69, 0.25);
    box-shadow: 0 0 20px 8px rgba(220, 53, 69, 0.4);
  }
  75% {
    background-color: rgba(220, 53, 69, 0.15);
    box-shadow: 0 0 15px 5px rgba(220, 53, 69, 0.3);
  }
  100% {
    background-color: transparent;
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
  }
}

.highlight-on-load {
  animation: highlightPulse 2s ease-in-out;
  padding: 8px;
  margin: -8px;
  border-radius: 8px;
}

/* Heading Accessibility Fixes */
/* Make h3 elements look like h5 for proper semantic heading hierarchy */
h3.card-title,
h3.card-title.mt-3,
footer h3.mb-3 {
  font-size: 1.25rem; /* Bootstrap h5 size */
  font-weight: 500;
  line-height: 1.2;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

/* OAuth Loading Overlay */
.oauth-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.oauth-loading-card {
  background-color: white;
  padding: 2rem 3rem;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.oauth-loading-spinner {
  width: 3rem;
  height: 3rem;
}

/* Admin Panel Styles */
.admin-nav {
  background: var(--ems-dark);
  padding: 8px 0;
  border-bottom: 3px solid var(--ems-primary-alt);
}

.admin-nav .nav-link {
  font-size: 0.9rem;
  padding: 4px 12px;
}

.admin-nav .nav-link:hover {
  opacity: 1 !important;
}

.admin-badge {
  background-color: var(--ems-primary-alt);
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.admin-stat-card {
  border-left: 4px solid var(--ems-primary);
  transition: transform 0.2s ease;
}

.admin-stat-card:hover {
  transform: translateY(-3px);
}

.admin-table th {
  background-color: #f8f9fa;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6c757d;
  border-bottom: 2px solid #dee2e6;
  padding: 10px 12px;
}

.admin-table td {
  padding: 10px 12px;
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background-color: #f8f9fa;
}
