/* ─── Reset & Variables ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --text:       #050315;
    --background: #fbfbfe;
    --primary:    #274808;
    --secondary:  #dedcff;
    --accent:     #8d6098;

    /* Derived / utility aliases */
    --bg:         var(--background);
    --surface:    #ffffff;
    --surface-2:  var(--secondary);
    --border:     #c8c6e8;
    --border-2:   #dddbe8;
    --ink:        var(--text);
    --ink-2:      #2a2840;
    --ink-3:      #6e6c88;
    --accent-hover: #6b4875;

    --radius:     0px;
    --shadow:     none;
    --shadow-lg:  none;
    --font-display: 'Syne', sans-serif;
    --font-body:    Arial, sans-serif;
    --font-mono:    'DM Mono', monospace;
    --nav-width:    250px;
    --transition:   0.3s;
}

body {
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    min-height: 100vh;
}

/* ─── Dark mode ──────────────────────────────────────────────── */
html[data-theme="dark"] {
    --text:       #eeedf8;
    --background: #0e0e16;
    --primary:    #a8cc72;
    --secondary:  #1e1d35;
    --accent:     #c49ece;

    --bg:         var(--background);
    --surface:    #17161f;
    --surface-2:  var(--secondary);
    --border:     #2e2d44;
    --border-2:   #3a3854;
    --ink:        var(--text);
    --ink-2:      #cbc9e2;
    --ink-3:      #8886aa;
    --accent-hover: #d8b8e0;
}

/* ─── Toggle button ──────────────────────────────────────────── */
#toggle-mode {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 9999 !important;

    padding: 8px 16px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition);
}
#toggle-mode:hover { background: var(--accent); }

/* ─── Main Section ───────────────────────────────────────────── */
.main-section {
    margin-left: 54px;
    padding: 32px 40px 60px;
    transition: margin-left var(--transition);
    max-width: 1400px;
}

/* ─── Page Header ────────────────────────────────────────────── */
.page-header {
    margin-bottom: 36px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: flex-end;
    gap: 32px;
}

.page-title {
    font-family: var(--font-display);
    font-size: clamp(36px, 5vw, 58px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--ink);
}
.page-title span {
    color: var(--accent);
}

.page-subtitle {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--ink-3);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding-bottom: 4px;
}

/* ─── Section Shared ─────────────────────────────────────────── */
section h2 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin-bottom: 4px;
}

.section-desc,
.card-desc {
    font-size: 13px;
    color: var(--ink-3);
    font-family: var(--font-mono);
    margin-bottom: 16px;
}

/* ─── Filter Section ─────────────────────────────────────────── */
.filter-section {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-top: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 0;
    box-shadow: none;
}
.filter-section h2 { margin-bottom: 20px; }

.filter-controls {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-3);
    font-weight: 500;
}

.filter-controls select,
.filter-controls input[type="number"] {
    padding: 8px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0;
    outline: none;
    transition: border-color var(--transition);
    min-width: 140px;
}
.filter-controls select:focus,
.filter-controls input[type="number"]:focus {
    border-color: var(--accent);
    box-shadow: none;
}

.price-range .price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-range input {
    width: 100px !important;
    min-width: unset !important;
}

.range-sep {
    color: var(--ink-3);
    font-family: var(--font-mono);
}

.filter-btn {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: normal;
    letter-spacing: normal;
    cursor: pointer;
    transition: background var(--transition);
    align-self: flex-end;
    white-space: nowrap;
}
.filter-btn:hover  { background: var(--accent); }
.filter-btn:active { transform: none; }

/* ─── Table ──────────────────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
}

.table-status {
    padding: 20px;
    text-align: center;
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: var(--ink-3);
    background: var(--surface-2);
}

.price-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.price-table thead tr {
    background: var(--primary);
    color: #fff;
}

.price-table th {
    padding: 8px;
    text-align: center;
    font-family: Arial, sans-serif;
    font-size: 14px;
    letter-spacing: normal;
    text-transform: none;
    font-weight: bold;
    white-space: nowrap;
    border: 1px solid var(--border);
}

.price-table tbody tr {
    border-bottom: 1px solid var(--border-2);
    transition: background 0.15s;
}
.price-table tbody tr:hover { background: var(--secondary); }
.price-table tbody tr:last-child { border-bottom: none; }

.price-table td {
    padding: 8px;
    color: var(--ink);
    font-family: Arial, sans-serif;
    font-size: 14px;
    text-align: center;
    border: 1px solid var(--border-2);
}

.fare {
    font-weight: normal;
    color: var(--primary) !important;
}

/* Vendor badges */
.vendor-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
}
.vendor-1 { background: var(--primary); color: #fff; }
.vendor-2 { background: var(--accent);  color: #fff; }

/* ─── Comparison Section ─────────────────────────────────────── */
.comparison-section {
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 0;
    box-shadow: none;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

/* ─── Cards ──────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    padding: 20px;
    border: 1px solid var(--border-2);
    border-radius: 0;
    transition: none;
}
.card:hover { box-shadow: none; }

.card h3 {
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
    color: var(--ink);
    margin-bottom: 2px;
}

.chart-wrap {
    position: relative;
    height: 220px;
}
.chart-wrap canvas {
    max-height: 220px;
}

/* Mobile list (small-item) styles */
.mobile-list { display: none; padding: 12px; }
.mobile-list .small-item {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    font-family: Arial, sans-serif;
    color: var(--ink);
}
.mobile-list .si-header { display:flex; align-items:center; gap:12px; margin-bottom:8px; }
.mobile-list .si-header .vendor-badge { padding:4px 8px; border-radius:6px; font-size:13px; }
.mobile-list .si-times { font-family: var(--font-mono); font-size:12px; color: var(--ink-3); }
.mobile-list .si-body .si-row { margin:6px 0; font-size:14px; }
.mobile-list .si-body .si-meta { display:flex; gap:8px; flex-wrap:wrap; font-size:13px; color:var(--ink-3); }
.mobile-list .si-footer { display:flex; gap:12px; align-items:center; margin-top:10px; font-size:14px; }
.mobile-list .si-footer .fare { color: var(--primary); font-weight:600; }

/* Responsive switch: show mobile list on small screens and hide table */
@media screen and (max-width: 760px) {
    .table-wrapper { border: none; }
    .price-table { display: none !important; }
    .mobile-list { display: block; }
    /* reduce padding for main section on phones */
    .main-section { padding: 16px 14px 48px; }
}

/* Slightly larger breakpoint for tablet: show both but stack */
@media screen and (min-width: 761px) and (max-width: 900px) {
    /* show mobile list above table for easier scanning on small tablets */
    .mobile-list { display: block; }
    .price-table { display: table; width:100%; }
    .table-wrapper { display: block; }
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media screen and (max-width: 900px) {
    .comparison-grid { grid-template-columns: 1fr; }
    .main-section    { padding: 24px 20px 48px; }
    .page-header     { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media screen and (max-width: 600px) {
    .filter-controls { gap: 12px; }
    .filter-controls select,
    .filter-controls input { min-width: 120px; }
    .main-section { margin-left: 0; padding-top: 60px; }
}