/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  --primary: #0066cc;
  --primary-dark: #004d99;
  --text: #333;
  --text-light: #666;
  --bg: #f8f9fa;
  --white: #fff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

.landing {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.hero {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  border-radius: 12px;
  margin-bottom: 3rem;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.hero .tagline {
  font-size: 1.25rem;
  opacity: 0.9;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.feature {
  background: var(--white);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.feature h3 {
  color: var(--primary);
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.feature p {
  color: var(--text-light);
}

.cta {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cta h2 {
  margin-bottom: 0.5rem;
  color: var(--text);
}

.cta p {
  color: var(--text-light);
}

/* Navbar */
.navbar {
  background: var(--white);
  padding: 1rem 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-user {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background-color 0.2s, border-color 0.2s;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

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

/* Flash messages */
.flash {
  max-width: 1200px;
  margin: 1rem auto;
  padding: 1rem 2rem;
  border-radius: 6px;
}

.flash-notice {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.flash-alert {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Auth forms */
.auth-container {
  max-width: 400px;
  margin: 4rem auto;
  padding: 2rem;
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.auth-container h1 {
  margin-bottom: 1.5rem;
  text-align: center;
  color: var(--text);
}

.auth-form .form-group {
  margin-bottom: 1rem;
}

.auth-form label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
  color: var(--text);
}

.auth-form input[type="email"],
.auth-form input[type="password"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}

.auth-form .form-actions {
  margin-top: 1.5rem;
}

.auth-form .btn {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
}

.auth-link {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-light);
}

.auth-link a {
  color: var(--primary);
}

.error-messages {
  background: #f8d7da;
  color: #721c24;
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  border: 1px solid #f5c6cb;
}

.error-messages p {
  margin: 0.25rem 0;
}

/* Dashboard */
.dashboard {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.dashboard-header h1 {
  margin: 0;
}

.dashboard-actions {
  display: flex;
  gap: 0.5rem;
}

.dashboard-content {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
}

.map-container {
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#map {
  width: 100%;
  height: 600px;
}

.drivers-sidebar {
  background: var(--white);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  max-height: 600px;
  overflow-y: auto;
}

.drivers-sidebar h3 {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #eee;
}

.driver-card {
  padding: 0.75rem;
  border: 1px solid #eee;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.driver-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.driver-status {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.status-offline {
  background: #6c757d;
  color: white;
}

.status-active {
  background: #28a745;
  color: white;
}

.status-delivering {
  background: #007bff;
  color: white;
}

.driver-coords {
  font-size: 0.8rem;
  color: var(--text-light);
}

.no-drivers {
  color: var(--text-light);
  text-align: center;
  padding: 2rem 0;
}

/* Drivers page */
.drivers-page, .form-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.page-header h1 {
  margin: 0;
}

.page-actions {
  display: flex;
  gap: 0.5rem;
}

.drivers-table {
  width: 100%;
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-collapse: collapse;
  overflow: hidden;
}

.drivers-table th,
.drivers-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.drivers-table th {
  background: #f8f9fa;
  font-weight: 600;
}

.drivers-table .actions {
  display: flex;
  gap: 0.5rem;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

.btn-danger {
  background: #dc3545;
  color: white;
  border: none;
}

.btn-danger:hover {
  background: #c82333;
}

.text-muted {
  color: var(--text-light);
}

.empty-state {
  text-align: center;
  padding: 3rem;
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.api-info {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.api-info h3 {
  margin-bottom: 0.5rem;
}

.api-info code {
  display: inline-block;
  background: #f4f4f4;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  margin: 0.5rem 0;
}

.api-info pre {
  background: #f4f4f4;
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
}

/* Driver form */
.form-page h1 {
  margin-bottom: 1.5rem;
}

.driver-form {
  background: var(--white);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.driver-form .form-group {
  margin-bottom: 1rem;
}

.driver-form label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.driver-form input[type="text"],
.driver-form input[type="number"],
.driver-form select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
}

.driver-form input:focus,
.driver-form select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.driver-form .form-actions {
  margin-top: 1.5rem;
}

.form-link {
  margin-top: 1rem;
  text-align: center;
}

.form-link a {
  color: var(--primary);
}

@media (max-width: 768px) {
  .dashboard-content {
    grid-template-columns: 1fr;
  }

  .drivers-sidebar {
    order: -1;
    max-height: 200px;
  }

  #map {
    height: 400px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}
