/* Wainwright - Vehicle Lifecycle Manager */

/* Wainwright Brand Colors */
:root {
  --wainwright-primary: #1B4332;      /* Dark forest green */
  --wainwright-secondary: #C9A227;    /* Gold/mustard */
  --wainwright-background: #FAFAF8;   /* Off-white */
  --wainwright-text: #2D2D2D;         /* Dark gray */
  --wainwright-accent: #95A88C;       /* Sage green */

  /* Bootstrap overrides */
  --bs-primary: #1B4332;
  --bs-primary-rgb: 27, 67, 50;
  --bs-link-color: #1B4332;
  --bs-link-hover-color: #143726;
}

/* Override Bootstrap primary button */
.btn-primary {
  --bs-btn-bg: var(--wainwright-primary);
  --bs-btn-border-color: var(--wainwright-primary);
  --bs-btn-hover-bg: #143726;
  --bs-btn-hover-border-color: #143726;
  --bs-btn-active-bg: #0f2a1c;
  --bs-btn-active-border-color: #0f2a1c;
}

.btn-outline-primary {
  --bs-btn-color: var(--wainwright-primary);
  --bs-btn-border-color: var(--wainwright-primary);
  --bs-btn-hover-bg: var(--wainwright-primary);
  --bs-btn-hover-border-color: var(--wainwright-primary);
  --bs-btn-active-bg: #143726;
  --bs-btn-active-border-color: #143726;
}

/* Navbar with brand colors */
.navbar.bg-primary {
  background-color: var(--wainwright-primary) !important;
}

/* Accent color for highlights */
.text-accent {
  color: var(--wainwright-secondary);
}

.bg-accent {
  background-color: var(--wainwright-secondary);
}

/* Card accent border */
.card-accent {
  border-left: 4px solid var(--wainwright-secondary);
}

/* Body background */
body {
  background-color: var(--wainwright-background);
  color: var(--wainwright-text);
}

/* Mobile Optimizations */
@media (max-width: 767.98px) {
  /* Container padding for mobile */
  .container {
    padding-left: 10px;
    padding-right: 10px;
  }
  
  /* Stats cards mobile layout */
  .stats-cards .card {
    margin-bottom: 1rem;
  }
  
  .stats-cards .display-4 {
    font-size: 1.8rem;
  }
  
  /* Form improvements */
  .form-label {
    font-weight: 600;
    margin-bottom: 0.25rem;
  }
  
  /* Larger touch targets */
  .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    min-height: 48px; /* Apple/Google touch target guidelines */
  }
  
  .form-control-lg {
    font-size: 1.1rem;
    padding: 0.75rem 1rem;
    min-height: 48px;
  }
  
  /* Table responsiveness */
  .table-responsive {
    border: none;
  }
  
  .table-mobile {
    font-size: 0.875rem;
  }
  
  .table-mobile th,
  .table-mobile td {
    padding: 0.5rem 0.25rem;
    vertical-align: middle;
  }
  
  /* Hide less important columns on mobile */
  .table-mobile .hide-mobile {
    display: none;
  }
  
  /* Mobile action buttons */
  .mobile-actions {
    display: flex;
    gap: 0.25rem;
  }
  
  .mobile-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
  }
}

/* Tablet optimizations */
@media (min-width: 768px) and (max-width: 991.98px) {
  .form-control-lg {
    font-size: 1rem;
  }
  
  .btn-lg {
    font-size: 1rem;
  }
}

/* Desktop and larger */
@media (min-width: 992px) {
  .table th {
    background-color: var(--bs-gray-100);
    border-bottom: 2px solid var(--bs-border-color);
  }
}

/* Common improvements for all devices */
.card {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  border: 1px solid rgba(0, 0, 0, 0.125);
}

.card-title {
  color: var(--bs-primary);
  font-weight: 600;
}

/* Loading and feedback states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Toast positioning for mobile */
@media (max-width: 767.98px) {
  .toast-container {
    padding: 1rem !important;
  }
  
  .toast {
    max-width: calc(100vw - 2rem) !important;
  }
}

/* Focus states for accessibility */
.form-control:focus,
.btn:focus {
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Navigation improvements */
.navbar-brand {
  font-weight: 700;
  color: var(--bs-primary) !important;
}

/* Utility classes for mobile */
.text-mobile-center {
  text-align: center;
}

@media (min-width: 768px) {
  .text-mobile-center {
    text-align: left;
  }
}

/* Quick action floating button for mobile */
@media (max-width: 767.98px) {
  .fab-add {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 1000;
  }
}

/* Mobile Content Reordering for Cars Page */
@media (max-width: 767.98px) {
  .mobile-reorder-container {
    display: flex;
    flex-direction: column;
  }
  
  /* Car actions section - show first on mobile */
  .mobile-cars-section {
    order: 1;
    margin-bottom: 2rem;
  }
  
  /* Add car button - show second */
  .mobile-add-section {
    order: 2;
    margin-bottom: 2rem;
  }
  
  /* Fleet overview - show third on mobile */
  .mobile-overview-section {
    order: 3;
    margin-bottom: 1.5rem;
  }
  
  /* Vehicle summary - show fourth */
  .mobile-summary-section {
    order: 4;
    margin-bottom: 1.5rem;
  }

  /* Consolidated car cards for mobile */
  .mobile-car-card {
    border-left: 4px solid var(--bs-primary);
    margin-bottom: 1rem;
  }
  
  .mobile-car-card .card-body {
    padding: 1rem;
  }
  
  .mobile-car-stats {
    display: flex;
    justify-content: space-around;
    margin: 0.75rem 0;
    font-size: 0.875rem;
  }
  
  .mobile-car-stat {
    text-align: center;
  }
  
  .mobile-car-stat-value {
    font-weight: 600;
    color: var(--bs-primary);
  }
  
  .mobile-car-stat-label {
    color: var(--bs-secondary);
    font-size: 0.75rem;
  }
  
  /* Larger touch targets for mobile car selection */
  .mobile-car-card .btn {
    min-height: 44px;
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
  }
}

/* Car card photo */
.car-card-photo {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

.car-card-photo img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Car card placeholder when no photo */
.car-card-placeholder {
  width: 100%;
  padding-top: 56.25%; /* 16:9 aspect ratio */
  position: relative;
  background-color: var(--bs-gray-100);
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

.car-card-placeholder i {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  color: var(--bs-gray-400);
}

/* Car photo in settings modal */
.car-settings-photo {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--bs-gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.125);
}

.car-settings-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.car-settings-photo i {
  font-size: 2rem;
  color: var(--bs-gray-400);
}

/* Maintenance type badges in table */
.maintenance-badge {
  font-size: 0.75rem;
  font-weight: 500;
  margin: 1px;
}

/* Maintenance checkbox group layout */
.maintenance-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0;
}

/* Mobile: stack checkboxes vertically for touch targets */
@media (max-width: 767.98px) {
  .maintenance-checkbox-group .form-check-inline {
    display: flex;
    margin-right: 0;
    width: 100%;
    padding: 0.35rem 0;
    padding-left: 1.5em;
  }
}

/* Reminder status badges */
.reminder-status-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25em 0.6em;
}

/* Vehicle specs card */
#vehicleSpecsCard {
  border-left: 4px solid var(--wainwright-secondary);
}

#vehicleSpecsCard .fw-semibold {
  font-size: 1.1rem;
}

/* Glove Box Accordion */
.glovebox-accordion-item .accordion-button:not(.collapsed) {
  background-color: rgba(27, 67, 50, 0.05);
  color: var(--wainwright-primary);
}

.glovebox-accordion-item .accordion-button:focus {
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.15);
}

/* Glove Box field grid */
.glovebox-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1.5rem;
}

.glovebox-field {
  display: flex;
  flex-direction: column;
}

.glovebox-field-label {
  font-size: 0.75rem;
  color: var(--bs-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.glovebox-field-value {
  font-weight: 600;
  font-size: 0.95rem;
}

/* Glove Box actions */
.glovebox-actions {
  display: flex;
  gap: 0.25rem;
}

/* Glove Box item separator */
.glovebox-item {
  padding-bottom: 0.5rem;
}

/* Stack fields on mobile */
@media (max-width: 767.98px) {
  .glovebox-fields {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

/* Auth Card Styles */
.auth-card {
  max-width: 420px;
  margin: 0 auto;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--bs-gray-300);
}

.auth-divider span {
  padding: 0 1rem;
  color: var(--bs-gray-500);
  font-size: 0.875rem;
}

.auth-toggle {
  font-size: 0.9rem;
}

.auth-toggle a {
  color: var(--wainwright-primary);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.auth-toggle a:hover {
  text-decoration: underline;
}

/* Password strength indicator */
.password-strength {
  height: 4px;
  border-radius: 2px;
  margin-top: 0.25rem;
  transition: all 0.3s ease;
}

.password-strength-text {
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

/* Email verification notice */
.verification-notice {
  background-color: rgba(27, 67, 50, 0.05);
  border: 1px solid rgba(27, 67, 50, 0.15);
  border-radius: 0.375rem;
  padding: 1.5rem;
}

/* Google button styling */
.btn-google {
  background-color: #fff;
  border: 1px solid var(--bs-gray-300);
  color: var(--wainwright-text);
  font-weight: 500;
}

.btn-google:hover {
  background-color: var(--bs-gray-100);
  border-color: var(--bs-gray-400);
  color: var(--wainwright-text);
}

/* Desktop Content Ordering - Preserve original order */
@media (min-width: 768px) {
  .mobile-reorder-container {
    display: flex;
    flex-direction: column;
  }
  
  /* Desktop order: Overview → Summary → Cars → Add */
  .mobile-overview-section {
    order: 1;
    margin-bottom: 2rem;
  }
  
  .mobile-summary-section {
    order: 2;
    margin-bottom: 2rem;
  }
  
  .mobile-cars-section {
    order: 3;
    margin-bottom: 1.5rem;
  }
  
  .mobile-add-section {
    order: 4;
    margin-bottom: 0;
    text-align: left;
  }
}