/* -------------------------------------------------------
   Fuel Price Comparison Calculator - Styles
   ------------------------------------------------------- */

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-2: #242836;
  --border: #2e3345;
  --text: #e8eaed;
  --text-muted: #9aa0b0;
  --accent: #6c63ff;
  --accent-hover: #7b73ff;
  --green: #34d399;
  --yellow: #fbbf24;
  --orange: #fb923c;
  --red: #f87171;
  --blue: #60a5fa;
  --radius: 8px;
  --radius-lg: 12px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* -------------------------------------------------------
   Layout
   ------------------------------------------------------- */

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1rem;
}

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
}

header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav .container {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  padding: 0.5rem 1rem;
}

nav a {
  white-space: nowrap;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}
nav a:hover,
nav a:focus {
  background: var(--border);
  color: var(--text);
  text-decoration: none;
}

section {
  padding: 2.5rem 0;
}

section#units {
  padding: 1.5rem 0 0 0;
}

section h2 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  padding-bottom: 0.25rem;
}

section h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}

footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* -------------------------------------------------------
   Ad Slots
   ------------------------------------------------------- */

.ad-slot {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 2rem 0;
}

/* -------------------------------------------------------
   Controls & Forms
   ------------------------------------------------------- */

select,
input[type="number"],
input[type="text"] {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%239aa0b0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

select:focus,
input:focus {
  outline: none;
  border-color: var(--accent);
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.controls-row label {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* -------------------------------------------------------
   Cards
   ------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

/* -------------------------------------------------------
   Form Grid
   ------------------------------------------------------- */

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

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

.form-label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.form-label span {
  font-weight: 500;
}

/* -------------------------------------------------------
   Button
   ------------------------------------------------------- */

.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.6rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn:hover {
  background: var(--accent-hover);
}

/* -------------------------------------------------------
   Summary Box
   ------------------------------------------------------- */

.summary-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

.summary-box .highlight {
  color: var(--text);
  font-weight: 600;
}

/* -------------------------------------------------------
   Data Tables
   ------------------------------------------------------- */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th,
.data-table td {
  padding: 0.55rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table thead th {
  background: var(--surface);
  color: var(--text-muted);
  font-weight: 600;
  position: sticky;
  top: 0;
}

.data-table tbody tr:hover {
  background: rgba(108, 99, 255, 0.05);
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 1rem;
}

/* -------------------------------------------------------
   Result Cards
   ------------------------------------------------------- */

.result-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  text-align: center;
}

.result-card.cheapest {
  border-color: var(--green);
}

.result-card.expensive {
  border-color: var(--red);
}

.result-card .station-name {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.result-card .price-display {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.result-card .price-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.result-card .stat {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.result-card .stat strong {
  color: var(--text);
}

.cheapest-tag {
  display: inline-block;
  background: rgba(52, 211, 153, 0.15);
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  margin-bottom: 0.5rem;
}

.expensive-tag {
  display: inline-block;
  background: rgba(248, 113, 113, 0.15);
  color: var(--red);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  margin-bottom: 0.5rem;
}

/* -------------------------------------------------------
   Savings Section
   ------------------------------------------------------- */

.savings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1rem;
}

.savings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.savings-row:last-child {
  border-bottom: none;
}

.savings-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.savings-value {
  font-size: 1.1rem;
  font-weight: 700;
}

.savings-value.positive {
  color: var(--green);
}

.savings-value.neutral {
  color: var(--text-muted);
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
}

/* -------------------------------------------------------
   SEO Content Section
   ------------------------------------------------------- */

.seo-content {
  color: var(--text-muted);
  line-height: 1.8;
}

.seo-content h2 {
  color: var(--text);
}

.seo-content h3 {
  color: var(--text);
  margin-top: 1.25rem;
}

.seo-content p {
  margin-bottom: 0.75rem;
}

.seo-content ul {
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.seo-content li {
  margin-bottom: 0.35rem;
}

/* -------------------------------------------------------
   Responsive
   ------------------------------------------------------- */

@media (max-width: 700px) {
  header h1 {
    font-size: 1.25rem;
  }

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

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

  .form-grid-3 > div:empty {
    display: none;
  }

  .result-cards {
    grid-template-columns: 1fr;
  }

  .controls-row {
    flex-direction: column;
    align-items: stretch;
  }

  .controls-row label {
    flex-direction: column;
    align-items: flex-start;
  }

  .controls-row select,
  .controls-row input {
    width: 100%;
  }

  .data-table th,
  .data-table td {
    padding: 0.4rem 0.45rem;
    font-size: 0.78rem;
  }

  .savings-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}
