/* css/style.css — Tamamen yeni v4, geniş ve ferah */

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

:root {
  --bg: #faf8f5;
  --bg2: #ffffff;
  --bg3: #f3efe9;
  --text: #1c1108;
  --text2: #8a7968;
  --text3: #b5a898;
  --primary: #8b4513;
  --primary-l: #a0622d;
  --primary-xl: #c4884e;
  --success: #1b9e4b;
  --warning: #d97706;
  --danger: #dc2626;
  --border: #e8e0d6;
  --shadow-sm: 0 1px 3px rgba(30,10,0,0.04);
  --shadow: 0 4px 20px rgba(30,10,0,0.06);
  --shadow-lg: 0 16px 48px rgba(30,10,0,0.10);
  --radius: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.4,0,0.2,1);
}

[data-theme="dark"] {
  --bg: #12100d;
  --bg2: #1c1914;
  --bg3: #252118;
  --text: #f2ebe2;
  --text2: #9e9080;
  --text3: #6a5e52;
  --border: #332c22;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
  --shadow: 0 4px 20px rgba(0,0,0,0.25);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.35);
}

html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ═══ TOPBAR ═══ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  transition: background 0.4s var(--ease), box-shadow 0.3s;
}

[data-theme="dark"] .topbar { background: rgba(28,25,20,0.92); }
.topbar.scrolled { box-shadow: 0 2px 16px rgba(0,0,0,0.06); }

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 68px;
}

.tb-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}

.tb-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-l));
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.15rem;
  box-shadow: 0 3px 10px rgba(139,69,19,0.25);
}

.tb-title { display: block; font-weight: 800; font-size: 1.05rem; line-height: 1.2; }
.tb-sub { display: block; font-size: 0.68rem; color: var(--text2); font-weight: 600; }

.tb-right { display: flex; align-items: center; gap: 0.6rem; }

.tb-clock {
  font-size: 0.88rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  background: var(--bg3);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.tb-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  cursor: pointer;
  font-size: 0.95rem;
  display: grid;
  place-items: center;
  transition: all 0.25s var(--ease);
}

.tb-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ═══ HERO ═══ */
.hero {
  position: relative;
  background: linear-gradient(160deg, #4a2106 0%, #7a3a10 30%, #a0622d 65%, #c4884e 100%);
  color: #fff;
  padding: 3.5rem 0 4.5rem;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(255,255,255,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.05) 0%, transparent 50%);
}

.hero-body {
  position: relative;
  z-index: 2;
  max-width: 640px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  font-size: 0.74rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.chip-weekend {
  background: rgba(220,38,38,0.2);
  border: 1px solid rgba(220,38,38,0.35);
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
}

.hero-emoji { display: inline-block; animation: busMove 3s ease-in-out infinite; }

@keyframes busMove {
  0%,100% { transform: translateX(0); }
  50% { transform: translateX(6px); }
}

.hero p {
  font-size: 1rem;
  opacity: 0.8;
  line-height: 1.6;
}

.hero-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 50px;
  z-index: 1;
}

.hero-wave path { fill: var(--bg); }

/* ═══ GLOBAL SEARCH ═══ */
.gsearch {
  position: relative;
  margin-top: 1.5rem;
  max-width: 520px;
}

.gsearch-box {
  position: relative;
  display: flex;
  align-items: center;
}

.gsearch-box > i {
  position: absolute;
  left: 1.15rem;
  color: var(--primary);
  font-size: 1rem;
  z-index: 2;
}

#search-input {
  width: 100%;
  padding: 1rem 2.8rem 1rem 3rem;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-family: var(--font);
  background: rgba(255,255,255,0.95);
  color: var(--text);
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
  transition: box-shadow 0.3s var(--ease);
}

[data-theme="dark"] #search-input {
  background: rgba(28,25,20,0.95);
  color: var(--text);
}

#search-input:focus {
  outline: none;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18), 0 0 0 3px rgba(139,69,19,0.2);
}

#search-input::placeholder { color: var(--text3); }

.gsearch-clear {
  position: absolute;
  right: 0.8rem;
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.3rem;
  z-index: 2;
}

.gsearch-clear:hover { color: var(--text); }

.gsearch-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg2);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  max-height: 340px;
  overflow-y: auto;
  display: none;
  z-index: 50;
}

.gsearch-dropdown.open { display: block; }

.gs-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1.15rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.gs-item:last-child { border-bottom: none; }
.gs-item:hover { background: var(--bg3); }

.gs-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  color: #fff;
  flex-shrink: 0;
}

.gs-info { flex: 1; min-width: 0; }
.gs-name { font-weight: 600; font-size: 0.9rem; }
.gs-meta { font-size: 0.74rem; color: var(--text2); margin-top: 0.1rem; }

.gs-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--text3);
  font-size: 0.9rem;
}

/* ═══ ANNOUNCEMENTS ═══ */
.ann-wrap { margin-top: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }

.ann {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 1.15rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.ann > i { flex-shrink: 0; }
.ann-info > i { color: #2471a3; }
.ann-warning > i { color: #d97706; }
.ann-text { flex: 1; color: var(--text2); }
.ann-text strong { color: var(--text); margin-right: 0.3rem; }

.ann > button {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 0.82rem;
}

.ann > button:hover { color: var(--text); }

/* ═══ SECTION HEAD ═══ */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2rem 0 1rem;
}

.section-head h2 {
  font-size: 1.05rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-head h2 i { color: var(--primary-l); font-size: 0.9rem; }

.section-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text3);
  background: var(--bg3);
  padding: 0.28rem 0.7rem;
  border-radius: 20px;
}

/* ═══ ROUTE CHIPS — 2 sütun grid ═══ */
.route-chips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.rchip {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.75rem;
  align-items: center;
  padding: 1rem 1.15rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  cursor: pointer;
  transition: all 0.25s var(--ease);
  text-align: left;
  font-family: var(--font);
  border-left: 5px solid var(--c);
}

.rchip:hover {
  border-color: var(--c);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.rchip:active { transform: scale(0.99); }

.rchip.active {
  border-color: var(--c);
  background: color-mix(in srgb, var(--c) 5%, var(--bg2));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 12%, transparent);
}

.rchip-code {
  grid-row: 1 / 3;
  font-size: 0.82rem;
  font-weight: 900;
  color: #fff;
  background: var(--c);
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  line-height: 1;
}

.rchip-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rchip-info {
  grid-column: 2;
  font-size: 0.72rem;
  color: var(--text3);
}

/* ═══ DIRECTION BAR ═══ */
.dir-bar {
  display: flex;
  gap: 0.45rem;
  margin: 1.5rem 0 0.75rem;
  background: var(--bg2);
  padding: 0.45rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.dir-tab {
  flex: 1;
  padding: 0.6rem 0.75rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.25s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.dir-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(139,69,19,0.25);
}

.dir-tab:hover:not(.active) { background: var(--bg3); }

.fav-toggle {
  width: 44px;
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text3);
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.25s var(--ease);
  display: grid;
  place-items: center;
}

.fav-toggle:hover { color: var(--danger); }
.fav-toggle.liked { color: var(--danger); }
.fav-toggle.liked i { font-weight: 900; }

/* ═══ SCHEDULE ═══ */
.schedule {
  background: var(--bg2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border);
}

.sch-header {
  padding: 1.15rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}

.sch-badge {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 0.9rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}

.sch-title { font-size: 1.05rem; font-weight: 700; }
.sch-subtitle { font-size: 0.78rem; color: var(--text2); margin-top: 0.15rem; }

/* ═══ TIMELINE ═══ */
.tl-row {
  display: flex;
  transition: background 0.15s;
}

.tl-row:hover { background: var(--bg3); }

.tl-track {
  width: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.tl-line { flex: 1; width: 2.5px; background: var(--border); }
.tl-row:last-child .tl-line:last-child { background: transparent; }

.tl-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid var(--primary-l);
  background: var(--bg2);
  flex-shrink: 0;
  z-index: 2;
}

.tl-row:first-child .tl-dot,
.tl-row:last-child .tl-dot {
  width: 18px;
  height: 18px;
  background: var(--primary);
  border-color: var(--primary);
}

.tl-body {
  flex: 1;
  padding: 1rem 1.5rem 1rem 0.5rem;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}

.tl-row:last-child .tl-body { border-bottom: none; }

.tl-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tl-num {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text3);
  background: var(--bg);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.tl-name { font-weight: 700; font-size: 0.92rem; }

.tl-offset {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--text3);
  font-weight: 600;
}

.tl-times {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.t {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--bg3);
  color: var(--text3);
  transition: all 0.2s;
}

.t.passed { opacity: 0.25; }

.t.next {
  background: var(--success);
  color: #fff;
  box-shadow: 0 2px 8px rgba(27,158,75,0.3);
  animation: tPulse 2s infinite;
}

.t.soon {
  background: color-mix(in srgb, var(--primary-l) 12%, var(--bg3));
  color: var(--primary-l);
}

@keyframes tPulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* Stop search result */
.stop-card {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.stop-card:last-child { border-bottom: none; }

.stop-card-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.5rem;
}

.stop-card-badge {
  padding: 0.22rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
}

.stop-card-label { font-size: 0.85rem; color: var(--text2); }

/* ═══ FAVORITES ═══ */
.fav-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.fav-empty {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.15rem;
  background: var(--bg2);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  font-size: 0.82rem;
  color: var(--text3);
}

.fav-empty i { font-size: 1.1rem; opacity: 0.35; }

.fav-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 1rem;
  background: var(--bg2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

.fav-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.fav-card-badge {
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 900;
  color: #fff;
}

.fav-card-info { flex: 1; min-width: 0; }
.fav-card-name { font-weight: 700; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-card-sub { font-size: 0.7rem; color: var(--text3); }

.fav-card-del {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.78rem;
  opacity: 0.35;
  padding: 0.25rem;
  transition: opacity 0.2s;
}

.fav-card-del:hover { opacity: 1; }

/* ═══ INFO GRID ═══ */
.info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 2.5rem;
}

.info-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  background: var(--bg2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s var(--ease);
}

.info-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.info-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1rem;
  flex-shrink: 0;
}

.info-card strong { display: block; font-size: 0.85rem; font-weight: 700; }
.info-card span { font-size: 0.72rem; color: var(--text2); }

/* ═══ FOOTER ═══ */
footer {
  margin-top: auto;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text3);
}

.footer-inner a {
  color: var(--text3);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  transition: color 0.2s;
}

.footer-inner a:hover { color: var(--primary-l); }

/* ═══ UTILITY ═══ */
.hidden { display: none !important; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 900px) {
  .wrap { padding: 0 1.5rem; }
  .route-chips { grid-template-columns: repeat(2, 1fr); }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .fav-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 1rem; }

  .topbar-inner { height: 56px; }
  .tb-logo { width: 38px; height: 38px; font-size: 1rem; }
  .tb-title { font-size: 0.92rem; }
  .tb-sub { display: none; }
  .tb-clock { font-size: 0.78rem; padding: 0.3rem 0.6rem; }
  .tb-btn { width: 36px; height: 36px; font-size: 0.85rem; }

  .hero { padding: 2rem 0 3.5rem; }
  .hero h1 { font-size: 1.5rem; }
  .hero h1 br { display: none; }
  .hero p { font-size: 0.85rem; }

  #search-input { padding: 0.85rem 2.5rem 0.85rem 2.5rem; font-size: 0.92rem; }

  .route-chips { grid-template-columns: 1fr; }

  .rchip { padding: 0.75rem 0.9rem; }
  .rchip-name { font-size: 0.85rem; }

  .dir-tab { font-size: 0.82rem; padding: 0.5rem; }

  .tl-track { width: 44px; }
  .tl-body { padding: 0.75rem 0.85rem 0.75rem 0.35rem; }
  .tl-name { font-size: 0.85rem; }
  .t { font-size: 0.68rem; padding: 0.18rem 0.42rem; }

  .info-grid { grid-template-columns: 1fr; }

  .footer-inner { flex-direction: column; gap: 0.5rem; text-align: center; }
}

@media (max-width: 380px) {
  .hero h1 { font-size: 1.25rem; }
  .rchip-code { font-size: 0.72rem; padding: 0.25rem 0.45rem; }
  .info-card { padding: 0.8rem; }
  .info-icon { width: 36px; height: 36px; font-size: 0.88rem; }
}