/* ============================================================
   style.css — Yol Bilgisayarı PWA
   ============================================================ */

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

/* ── Değişkenler ──────────────────────────────────────────── */
:root {
  --bg:           #080A0C;
  --bg2:          #0E1217;
  --bg3:          #161B22;
  --border:       #1E2530;
  --accent:       #E8FF00;
  --accent2:      #B8CC00;
  --text-primary: #F0F4F8;
  --text-secondary: #5A6473;
  --text-dim:     #2E3845;
  --red:          #FF3B3B;
  --green:        #00E676;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: 'Barlow Condensed', sans-serif;
  color: var(--text-primary);
  user-select: none;
  -webkit-user-select: none;
}

/* ── Layout ───────────────────────────────────────────────── */
#app {
  height: 100dvh;   /* dynamic viewport height — güvenli alan */
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hidden { display: none !important; }

/* ── Status Bar ───────────────────────────────────────────── */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.status-left  { display: flex; align-items: center; gap: 10px; }
.status-right { display: flex; align-items: center; gap: 8px; }

.gps-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'Barlow', sans-serif;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.gps-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: gps-pulse 2s infinite;
}
.gps-dot.searching {
  background: #FFA500;
  box-shadow: 0 0 8px #FFA500;
}
.gps-dot.off {
  background: var(--text-secondary);
  box-shadow: none;
  animation: none;
}

@keyframes gps-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}

.gps-label { color: var(--text-secondary); }

.clock {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .08em;
  color: var(--text-secondary);
}

.battery {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: var(--text-secondary);
}

.battery-icon {
  width: 18px; height: 10px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  padding: 1.5px;
  display: flex;
  align-items: center;
  position: relative;
}
.battery-icon::after {
  content: '';
  position: absolute;
  right: -4px; top: 50%;
  transform: translateY(-50%);
  width: 2px; height: 5px;
  background: currentColor;
  border-radius: 0 1px 1px 0;
}
.battery-fill {
  height: 100%;
  width: 75%;
  background: var(--green);
  border-radius: 1px;
  transition: width .5s, background .5s;
}

/* ── Idle Screen ──────────────────────────────────────────── */
.idle-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.idle-logo {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.idle-distance-label {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.idle-zeros {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(90px, 24vw, 120px);
  font-weight: 700;
  line-height: 1;
  color: var(--text-dim);
  letter-spacing: -.02em;
  margin-bottom: 4px;
}

.idle-unit {
  font-size: 20px;
  font-weight: 300;
  letter-spacing: .2em;
  color: var(--text-dim);
  margin-bottom: 56px;
}

.start-btn {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform .15s, opacity .15s;
}
.start-btn::before {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px solid var(--text-dim);
}
.start-btn:active { transform: scale(.93); opacity: .8; }
.start-btn svg    { width: 26px; height: 26px; fill: var(--accent); margin-left: 4px; }

.start-label {
  margin-top: 14px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ── Active Screen ────────────────────────────────────────── */
.active-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Hero */
.hero-distance {
  padding: 16px 20px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.hero-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.hero-value {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(82px, 21vw, 104px);
  font-weight: 700;
  line-height: .9;
  letter-spacing: -.03em;
}

.hero-value .accent { color: var(--accent); }

.hero-unit {
  font-size: 17px;
  font-weight: 300;
  letter-spacing: .2em;
  color: var(--text-secondary);
  margin-top: 3px;
  margin-left: 2px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
}

.stat-cell {
  padding: 14px 18px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 88px;
}
.stat-cell:nth-child(even) { border-right: none; }
.stat-cell.highlight       { background: var(--bg2); }

.stat-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.stat-value {
  font-family: 'Rajdhani', sans-serif;
  font-size: 62px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.02em;
}

.stat-value.time-val  { font-size: 62px; }
.stat-value.speed-val { transition: color .3s; }

.stat-unit {
  font-size: 11px;
  font-weight: 300;
  letter-spacing: .15em;
  color: var(--text-secondary);
  margin-top: 1px;
}

/* Elevation row */
.elev-cell {
  grid-column: 1 / -1;
  border-right: none;
  min-height: 72px;
  padding: 12px 18px;
}

.elev-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.elev-gain-val {
  color: var(--text-primary) !important;
  font-size: 10px;
}

.elev-bar-track {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}
.elev-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  border-radius: 2px;
  transition: width 1s ease;
}

.elev-values {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}
.elev-val {
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: .05em;
}

/* Pause banner */
.pause-banner {
  position: absolute;
  top: 44px;
  left: 0; right: 0;
  background: rgba(8, 10, 12, .92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  z-index: 20;
}
.pause-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .5em;
  text-transform: uppercase;
  color: var(--accent);
  animation: blink 1.2s infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: .15; }
}

/* ── Bottom Bar ───────────────────────────────────────────── */
.bottom-bar {
  padding: 12px 18px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.ctrl-btn {
  height: 52px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg2);
  cursor: pointer;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform .12s, opacity .12s;
}
.ctrl-btn:active { transform: scale(.95); opacity: .7; }

.stop-btn  { flex: 0 0 82px; border-color: rgba(255,59,59,.25); color: var(--red); }
.pause-btn { flex: 1; color: var(--text-primary); }

.ctrl-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #080A0C;
  font-weight: 600;
}

/* ── Summary Screen ───────────────────────────────────────── */
.summary-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 22px 20px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.summary-screen::-webkit-scrollbar { display: none; }

.summary-title {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .4em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.summary-date {
  font-family: 'Rajdhani', sans-serif;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: .02em;
  margin-bottom: 24px;
}

.summary-hero { margin-bottom: 24px; }

.summary-hero-val {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(68px, 19vw, 88px);
  font-weight: 700;
  line-height: .9;
  letter-spacing: -.03em;
}
.sum-unit {
  font-size: .3em;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: .1em;
  vertical-align: middle;
  margin-left: 4px;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 18px;
}

.summary-cell {
  background: var(--bg2);
  padding: 13px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.summary-cell.span2 { grid-column: 1 / 3; }

.summary-cell-label {
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.summary-cell-val {
  font-family: 'Rajdhani', sans-serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1;
}
.summary-cell-val.small { font-size: 20px; }

.summary-cell-unit {
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--text-secondary);
}

.sync-status {
  font-size: 11px;
  letter-spacing: .05em;
  color: var(--text-secondary);
  margin-bottom: 12px;
  min-height: 16px;
}

.new-ride-btn {
  width: 100%;
  height: 52px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  cursor: pointer;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: #080A0C;
  margin-top: auto;
  transition: transform .12s;
}
.new-ride-btn:active { transform: scale(.98); }

/* ============================================================
   v2 EKLEMELERİ
   ============================================================ */

/* ── Login Screen ─────────────────────────────────────────── */
.login-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}

.login-logo {
  text-align: center;
  margin-bottom: 44px;
}

.login-logo-mark {
  font-family: 'Rajdhani', sans-serif;
  font-size: 56px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}

.login-logo-name {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .4em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.auth-card {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: .02em;
  margin-bottom: 4px;
}

.auth-field { display: flex; flex-direction: column; gap: 5px; }

.auth-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.auth-input {
  height: 48px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  padding: 0 14px;
  outline: none;
  transition: border-color .15s;
}
.auth-input:focus { border-color: var(--accent); }
.auth-input::placeholder { color: var(--text-dim); }

.auth-error {
  font-size: 12px;
  color: var(--red);
  letter-spacing: .03em;
  padding: 8px 12px;
  background: rgba(255,59,59,.08);
  border: 1px solid rgba(255,59,59,.2);
  border-radius: 6px;
}

.auth-submit {
  height: 52px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #080A0C;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .3em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 4px;
  transition: transform .12s, opacity .12s;
}
.auth-submit:active   { transform: scale(.97); }
.auth-submit:disabled { opacity: .5; }

.auth-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  letter-spacing: .05em;
  cursor: pointer;
  text-align: center;
  padding: 4px;
  transition: color .15s;
}
.auth-toggle:hover { color: var(--text-primary); }

/* ── GPS Error ────────────────────────────────────────────── */
.gps-error {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--red);
  background: rgba(255,59,59,.08);
  border: 1px solid rgba(255,59,59,.2);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 32px;
  max-width: 280px;
  text-align: left;
}

/* ── User Name ────────────────────────────────────────────── */
.user-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .08em;
  color: var(--text-secondary);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Bottom Nav ───────────────────────────────────────────── */
.bottom-nav {
  display: flex;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 4px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color .15s;
}

.nav-btn svg  { width: 20px; height: 20px; }
.nav-btn span { font-size: 10px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.nav-btn.active { color: var(--accent); }
.nav-btn:active { opacity: .6; }

/* ── Section screens (History, Stats) ────────────────────── */
.section-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px 12px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .03em;
}

.logout-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  padding: 5px 12px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.logout-btn:hover { color: var(--red); border-color: rgba(255,59,59,.3); }

/* ── Ride List (History) ──────────────────────────────────── */
.ride-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ride-list::-webkit-scrollbar { display: none; }

.empty-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  letter-spacing: .1em;
  color: var(--text-secondary);
  padding: 40px 0;
}

.ride-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ride-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.ride-card-date {
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .03em;
}

.ride-card-time {
  font-size: 10px;
  color: var(--text-secondary);
  letter-spacing: .08em;
  margin-top: 2px;
}

.ride-card-km {
  font-family: 'Rajdhani', sans-serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--accent);
}

.ride-card-unit {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 300;
  letter-spacing: .1em;
  color: var(--text-secondary);
}

.ride-card-bottom {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11px;
  letter-spacing: .05em;
  color: var(--text-secondary);
}

/* ── Sürüş geçmişi — sil butonu ─────────────────────────────────
   css/style.css içindeki .ride-card bloğunun altına ekleyin       */

.btn-delete-ride {
  display:         flex;
  align-items:     center;
  gap:             5px;
  margin-top:      10px;
  padding:         6px 12px;
  border:          1px solid var(--red, #e53e3e);
  border-radius:   6px;
  background:      transparent;
  color:           var(--red, #e53e3e);
  font-size:       0.78rem;
  cursor:          pointer;
  transition:      background 0.15s, color 0.15s;
  align-self:      flex-end;   /* karta sağa yasla */
}

.btn-delete-ride:hover,
.btn-delete-ride:active {
  background: var(--red, #e53e3e);
  color:      #fff;
}

/* ── Odometer (Stats) ─────────────────────────────────────── */
.odometer-block {
  padding: 22px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.odo-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.odo-value {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(64px, 18vw, 86px);
  font-weight: 700;
  line-height: .9;
  letter-spacing: -.02em;
}

.odo-unit {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: .25em;
  font-weight: 300;
  letter-spacing: .2em;
  color: var(--accent);
  vertical-align: middle;
  margin-left: 6px;
}

/* ── Lifetime Grid ────────────────────────────────────────── */
.lifetime-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  overflow-y: auto;
}
.lifetime-grid::-webkit-scrollbar { display: none; }

.lifetime-cell {
  padding: 16px 18px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lifetime-cell:nth-child(even) { border-right: none; }
.lifetime-cell.span2 { grid-column: 1 / -1; border-right: none; }

.lifetime-cell-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.lifetime-cell-val {
  font-family: 'Rajdhani', sans-serif;
  font-size: 38px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.02em;
}

.lifetime-cell-unit {
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--text-secondary);
}
