/* ======================================================================================
// Main Stylesheet for BIG Route Draft
//
// This file contains the base styles for the application's layout and components.
// It does NOT contain animation-specific styles, which are in animations.css.
// ====================================================================================== */

/* --- Reset / Base --- */
/* A simple reset to ensure consistent box-sizing and remove default margins/paddings. */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  /* Sets a modern, clean default font stack for the entire application. */
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Base styles for the body element. */
body {
  background: #f5f7fa; /* A light grey background for a soft look. */
  color: #222; /* Dark grey for text for better readability than pure black. */
  line-height: 1.5; /* Default spacing between lines of text. */
}

/* Default styling for links. */
a {
  text-decoration: none; /* Removes the default underline. */
  color: inherit; /* Makes links inherit the color of their parent element. */
}

/* --- Layout Containers --- */
/* A centered container with a maximum width to keep content from becoming too wide on large screens. */
.container {
  max-width: 1400px;
  margin: auto; /* Centers the container horizontally. */
  padding: 20px;
}

/* A simple CSS Grid layout for arranging cards vertically with consistent spacing. */
.grid {
  display: grid;
  grid-template-columns: 1fr; /* A single column grid. */
  gap: 20px; /* The space between grid items (cards). */
}

/* --- Components --- */

/* Card styling for all main content blocks. */
.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1); /* Subtle shadow for depth. */
  overflow: hidden; /* Ensures content respects the border-radius. */
}

/* Header style for each card. */
.card-header {
  background: #003366; /* Dark blue brand color. */
  color: #fff;
  padding: 12px 16px;
  display: flex; /* Flexbox for easy alignment of title and other elements (like buttons). */
  align-items: center;
  justify-content: space-between; /* Pushes title to the left and other items to the right. */
}

.card-header h2 {
  font-size: 18px;
  margin: 0;
}

/* Main content area of a card. */
.card-body {
  padding: 16px;
}

/* --- Tables --- */
/* A wrapper for tables to allow horizontal and vertical scrolling on smaller screens. */
.table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 60vh;    /* vertical scroll */
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 800px;   /* Forces a horizontal scrollbar on screens narrower than 800px. */
  table-layout: auto;  /* Allows columns to adjust their width based on content. */
}

table th, table td {
  border: 1px solid #ddd;
  padding: 6px 8px;
  text-align: center; /* Default text alignment for all table cells. */
}

table th {
  background: #e8eef7; /* Light blue background for table headers. */
  font-weight: bold;
}

/* Alternating row color ("zebra striping") for generic tables. */
/* This is overridden by more specific rules for the ranking and carrier tables. */
table tr:nth-child(even) {
  background: #f9f9f9;
}

/* --- Buttons --- */
/* Base button styling. */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s; /* Smooth background color transition on hover. */
}

/* Primary button style (solid color). */
.btn-primary {
  background: #003366;
  color: #fff;
  border: none;
}

.btn-primary:hover {
  background: #002244; /* Darker shade on hover. */
}

/* Outline button style (white with colored border). */
.btn-outline {
  background: #fff;
  color: #003366;
  border: 1px solid #003366;
}

.btn-outline:hover {
  background: #f0f3f7; /* Light grey background on hover. */
}

/* --- Miscellaneous --- */
.logo {
  /* This class is used on an <img> tag, but the background is set as a fallback. */
  background-image: url("/static/img/rlx-logo.png");
}

.live-clock {
  font-weight: 600;
  font-size: 14px;
  opacity: 0.85;
}

/* --- Mobile Responsive Styles --- */
/* These styles apply only when the screen width is 768px or less. */
@media (max-width: 768px) {
  .grid {
    /* Stays as 1 column, but could be changed for different mobile layouts. */
    grid-template-columns: 1fr;
  }

  table {
    font-size: 12px; /* Smaller font on mobile to fit more data. */
  }

  .btn {
    font-size: 12px; /* Smaller buttons on mobile. */
    padding: 6px 12px;
  }
}