/* =========================================================
   Base Variables (site colors, easily changeable)
   ========================================================= */
:root {
  --color-green: #215732;     /* Header & Footer */
  --color-purple: #512d6d;    /* Titles & Primary Buttons */
  --color-purple-dark: #3f1f55;
  --white: #ffffff;
  --gray-light: #f5f5f5;
  --gray-border: #ddd;
}

/* =========================================================
   Reset & Base
   ========================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: var(--gray-light);
  color: #333;
  line-height: 1.4;
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
  background-color: var(--color-green);
  color: var(--white);
  padding: 10px 15px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.page-header {
  background-color: var(--color-white);
  color: #666666;
  padding: 10px 15px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}


.site-header a {
  color: var(--white);
  text-decoration: none;
}

.site-header a:hover {
  text-decoration: underline;
}

/* Accent bar (purple stripe under header) */
.site-header-accent {
  height: 6px;
  background-color: var(--color-purple);
}

/* Header layout */
.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.header-title {
  font-size: 1.4rem;
  font-weight: bold;
  flex: 1 1 100%;
}

.header-welcome {
  font-size: 1rem;
  margin: 5px 0;
  flex: 1 1 auto;
}

.header-buttons {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  background-color: var(--color-green);
  color: var(--white);
  text-align: right;
  padding: 12px;
}

.site-footer a {
  color: var(--white);
}
/* Accent bar above footer */
.site-footer-accent {
  height: 6px;
  background-color: var(--color-purple);
}

.hr-green{
	height: 4px;
	background-color: var(--color-green);
}

.hr-purple{
	height: 4px;
	background-color: var(--color-purple);
}

/* =========================================================
   Content & Containers
   ========================================================= */
.container {
  max-width: 1200px;
  margin: 0px auto 10px;
  padding: 0 15px;
}

.content h1,
.content h2,
.content h3 {
  color: var(--color-purple);
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

/* =========================================================
   Tables
   ========================================================= */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 10px 10px;
  margin-bottom: 20px;
  background-color: var(--white);
}

.table th,
.table td {
  padding: 10px;
  text-align: left;
  border: 1px solid var(--gray-border);
  font-size: 0.9rem;
}

.table th {
  background-color: #f2f2f2;
  font-weight: bold;
}

.table tr:nth-child(even) {
  background-color: #fafafa;
}

/* =========================================================
   Cards (e.g., Driver Run History)
   ========================================================= */
.run-card {
  border: 1px solid var(--gray-border);
  padding: 12px;
  margin-bottom: 15px;
  background: var(--white);
  border-radius: 6px;
}

.run-card h3 {
  margin-top: 0;
}

/* Run stops table inside cards */
.run-stops {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.run-stops th,
.run-stops td {
  border: 1px solid var(--gray-border);
  padding: 6px 8px;
  text-align: left;
  font-size: 14px;
}

.run-stops th {
  background: #f0f0f0;
  font-weight: bold;
}

/* =========================================================
   Forms (Filters, Login)
   ========================================================= */
.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
  align-items: center;
}

.filter-form label {
  display: flex;
  flex-direction: column;
  font-size: 14px;
}

.filter-form input[type="text"],
.filter-form input[type="date"] {
  padding: 6px 8px;
  font-size: 14px;
  border: 1px solid var(--gray-border);
  border-radius: 4px;
}

.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.login-form {
  width: 100%;
  max-width: 400px;
  background: var(--white);
  padding: 20px;
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.login-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
}

.login-form input {
  width: 100%;
  padding: 8px;
  margin-bottom: 12px;
  border: 1px solid var(--gray-border);
  border-radius: 4px;
}

/* =========================================================
   Buttons (override Bootstrap primary)
   ========================================================= */
.btn-primary {
  background-color: var(--color-purple) !important;
  border-color: var(--color-purple) !important;
  color: var(--white) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: var(--color-purple-dark) !important;
  border-color: var(--color-purple-dark) !important;
}

.btn-outline-primary {
  color: var(--color-purple);
  border-color: var(--color-purple);
}

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

/* Smaller button option */
.btn.small {
  padding: 6px 10px;
  font-size: 0.75rem;
}

/*
header, footer, .navbar {
    background-color: #198754 !important; // Bootstrap green
    color: #fff !important;
  }
*/
  footer {
    padding: 1rem;
    text-align: center;
  }
  h1.btn-primary, h2.btn-primary, h3.btn-primary {
    color: #6f42c1 !important; /* Bootstrap purple */
  }
  .btn-primary {
    background-color: #6f42c1 !important;
    border-color: #6f42c1 !important;
  }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 768px) {
  .header-title {
    flex: 1 1 100%;
    margin-bottom: 5px;
  }
  .header-welcome {
    flex: 1 1 100%;
    margin-bottom: 5px;
  }
  .header-buttons {
    flex: 1 1 100%;
    justify-content: flex-end;
  }
}

@media (min-width: 769px) {
  .header-title {
    flex: 1 1 100%;
    text-align: center;
    margin-bottom: 0;
  }
  .header-welcome {
    flex: 1 1 50%;
    text-align: left;
  }
  .header-buttons {
    flex: 1 1 50%;
    justify-content: flex-end;
  }
}

/* routes specific */
.table-section-title { font-weight: 600; margin-top: 1rem; margin-bottom: .5rem; }
.stop-archived { opacity: 0.6; color: #666; }
.stop-current { font-weight: 700; }
.stop-late { background-color: #fff3cd; } /* light warning */
.stop-past { opacity: 0.7; }
.stop-future { color: inherit; } /* normal */

/* drivers overview specific tweaks */
#driver-overview h1 {
  font-weight: 600;
}

#driver-overview .figure-caption {
  font-size: .9rem;
  color: #6c757d; /* bootstrap text-muted equivalent */
}

#driver-overview .accordion-button {
  font-size: 1rem;
}

#driver-overview .figure-img {
  /* leave size/behavior to bootstrap .img-fluid; this ensures consistent border radius
     and subtle shadow (we add a shadow class in markup). */
  border-radius: .5rem;
}

/* Improve keyboard focus visibility for custom elements */
#driver-overview a:focus,
#driver-overview button:focus {
  outline: 3px solid rgba(0,123,255,0.25);
  outline-offset: 2px;
}

/* Small screens: stack CTA area */
@media (max-width: 575.98px) {
  #driver-overview .d-flex.justify-content-between {
    flex-direction: column;
    gap: .5rem;
    align-items: stretch;
  }
}
