@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;600;700;900&family=Barlow:wght@300;400;500&display=swap');

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

:root {
  --paper:       #f5f0e8;
  --paper2:      #ede7d8;
  --ink:         #1a1612;
  --ink-mid:     #4a4540;
  --ink-faint:   #9a9590;
  --red:         #d42b2b;
  --red-pale:    rgba(212,43,43,0.06);
  --rule:        rgba(26,22,18,0.12);
  --rule-heavy:  rgba(26,22,18,0.28);
}

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Barlow', sans-serif;
  min-height: 100vh;
  position: relative;
}


/* -- Page layout -- */
.page-wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* -- Sidebar -- */
.sidebar {
  background: var(--ink);
  color: var(--paper);
  padding: 48px 32px 48px 40px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  animation: slideInLeft 0.5s ease both;

  background-repeat: repeat;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 1.0) 0%, rgba(0, 0, 0, 0.99) 30%, rgba(0, 0, 0, 0.3) 100%), url("../images/zime.jpg") repeat;
}

@keyframes slideInLeft {
  from { transform: translateX(-24px); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

.system-tag {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 44px;
}

.sidebar-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 66px;
  font-weight: 900;
  line-height: 0.88;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.sidebar-title em {
  font-style: normal;
  color: var(--red);
  display: block;
}

.sidebar-rule {
  width: 40px;
  height: 3px;
  background: var(--red);
  margin: 28px 0;
}

.sidebar-desc {
  font-size: 12px;
  font-weight: 300;
  line-height: 1.7;
  color: rgba(245,240,232,0.45);
  letter-spacing: 0.02em;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 40px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.18);
}

/* -- Main -- */
.main {
  padding: 48px 52px 80px;
  animation: fadeUp 0.5s 0.1s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* -- Section label -- */
.section-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* -- Search form -- */
.search-form {
  border: 2px solid var(--ink);
  margin-bottom: 48px;
}

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

.form-field {
  padding: 22px 28px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  position: relative;
}

.form-field:last-of-type {
  border-right: none;
}

.form-field label {
  display: block;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 8px;
}

.form-field input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  caret-color: var(--red);
}

.form-field input::placeholder {
  color: var(--ink-faint);
  font-weight: 400;
}

.form-arrow {
  position: absolute;
  top: 50%;
  right: -18px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: var(--red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.form-arrow svg { color: #fff; }

.search-btn {
  width: 100%;
  padding: 18px 28px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.18s;
  position: relative;
  overflow: hidden;
}

.search-btn .btn-arrow {
  font-size: 20px;
  transition: transform 0.2s;
}

.search-btn:hover { background: var(--red); }
.search-btn:hover .btn-arrow { transform: translateX(5px); }

.search-btn.loading {
  pointer-events: none;
  background: var(--ink-mid);
}

.search-btn.loading::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  background: var(--red);
  opacity: 0.6;
  animation: loadbar 1.2s ease-in-out infinite;
}

@keyframes loadbar {
  0%   { width: 0%;   opacity: 1; }
  80%  { width: 90%;  opacity: 1; }
  100% { width: 100%; opacity: 0; }
}

/* -- Results area -- */
#tabs { animation: fadeUp 0.4s ease both; }

.results-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 20px;
}

.found-count {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 52px;
  font-weight: 900;
  line-height: 1;
  color: var(--red);
}

.found-label {
  font-size: 11px;
  color: var(--ink-mid);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* -- Day tabs -- */
.tabDayNameShort { display: none; }

.tab-buttons {
  display: flex;
  border-top: 2px solid var(--rule-heavy);
  border-left: 2px solid var(--rule-heavy);
}

.tab-buttons button {
  flex: 1;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 13px 4px;
  background: var(--paper2);
  border: none;
  border-right: 2px solid var(--rule-heavy);
  border-bottom: 2px solid var(--rule-heavy);
  color: var(--ink-mid);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.tab-buttons button:hover {
  background: var(--paper);
  color: var(--ink);
}

.tab-buttons button.active {
  background: var(--paper);
  color: var(--red);
  border-bottom-color: var(--paper);
  position: relative;
  z-index: 1;
  font-size: 20px;
}

/* -- Tab panels -- */
.tab-content {
  display: none;
  border: 2px solid var(--rule-heavy);
  border-top: none;
}

.tab-content.active {
  display: block;
  animation: fadeUp 0.25s ease both;
}

/* -- Empty -- */
.empty-state {
  padding: 36px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.empty-num {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 72px;
  font-weight: 900;
  line-height: 1;
  color: var(--ink);
  opacity: 0.08;
}

.empty-text {
  font-size: 13px;
  color: var(--ink-faint);
  letter-spacing: 0.03em;
  line-height: 1.6;
}

/* -- Table -- */
table {
  width: 100%;
  border-collapse: collapse;
}

thead tr {
  border-bottom: 2px solid var(--rule-heavy);
  background: var(--paper2);
}

thead th {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 12px 16px;
  text-align: left;
}

thead th:first-child { padding-left: 28px; width: 36px; color: transparent; }
thead th:nth-child(2){ padding-left: 12px; }

tbody tr {
  border-bottom: 1px solid var(--rule);
  transition: background 0.1s;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--red-pale); }

tbody td {
  padding: 15px 16px;
  font-size: 14px;
  color: var(--ink);
  vertical-align: middle;
}

td.row-num {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  width: 36px;
  user-select: none;
}

td.route-name {
  font-size: 18px;
  font-weight: 500;
}

.time-tag {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.dep-tag { color: var(--red); }

/* -- Error -- */
.error-msg {
  border-left: 4px solid var(--red);
  background: var(--red-pale);
  padding: 14px 20px;
  font-size: 13px;
  color: var(--red);
  margin-top: 16px;
}

/* -- Responsive -- */
@media (max-width: 800px) {
  .page-wrap { grid-template-columns: 1fr; }
  .sidebar { position: static; height: fit-content; padding: 36px 16px 32px; background: linear-gradient(to right, rgba(0, 0, 0, 1.0) 0%, rgba(0, 0, 0, 0.99) 150px, rgba(0, 0, 0, 0.3) 100%), url("../images/zime.jpg") repeat; }
  .sidebar-title { font-size: 50px; }
  .main { padding: 32px 20px 60px; min-width: 240px}
  .form-fields { grid-template-columns: 1fr; }
  .form-field { border-right: none; }
  /* .form-arrow {  } */
  .tabDayNameLong { display: none; }
  .tabDayNameShort { display: inline; }
}

/* -- Suggestions -- */
.suggestions-dropdown {
  display: none;
  position: absolute;
  top: 100%;         /* appears just below the input */
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 220px;
  overflow-y: auto;
}

.suggestion-item {
  display: flex;
  min-height: 7vh;
}

.suggestion-button {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  background-color: var(--paper);
  border-color: var(--ink);
  border-radius: 0;
  border-bottom: none;
  padding-left: 1vw;
  padding-top: 1vh;
  padding-bottom: 0.5vh;
}

.suggestion-item:last-child > button {
  border-bottom: var(--ink);
  border-bottom-style: solid;
}

.suggestion-item:hover > button {
  background-color: var(--paper2);
}

.suggestion-button-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: bold;
  font-size: 1.5em;
}

.suggestion-button-desc {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: normal;
  font-size: 1.4em;
}



.unfinished-input {
  background: lightgray;
}

.finished-input {
  background: var(--paper2);
}

