/* =============================================
   rotauygunluk.bisikletrotam.com — app.css
   Mobile-first · Dark/Light mode · PWA
   ============================================= */

/* ---- Design tokens ---- */
:root {
  --brand:        #FF5722;
  --brand-dark:   #E64A19;
  --brand-light:  #FF8A65;

  --bg:           #F5F5F5;
  --surface:      #FFFFFF;
  --surface-2:    #FAFAFA;
  --border:       #E0E0E0;
  --text:         #1A1A1A;
  --text-2:       #5A5A5A;
  --text-3:       #9E9E9E;

  --green:        #2E7D32;
  --green-bg:     #E8F5E9;
  --yellow:       #F57F17;
  --yellow-bg:    #FFF9C4;
  --red:          #C62828;
  --red-bg:       #FFEBEE;

  --radius:       14px;
  --radius-sm:    8px;
  --shadow:       0 2px 12px rgba(0,0,0,.08);
  --shadow-md:    0 4px 24px rgba(0,0,0,.12);
  --transition:   .2s ease;
}

[data-theme="dark"] {
  --bg:       #121212;
  --surface:  #1E1E1E;
  --surface-2:#2A2A2A;
  --border:   #333333;
  --text:     #F0F0F0;
  --text-2:   #AAAAAA;
  --text-3:   #666666;

  --green-bg:  #1B3A1D;
  --yellow-bg: #3A2F00;
  --red-bg:    #3A1010;
  --shadow:    0 2px 12px rgba(0,0,0,.4);
  --shadow-md: 0 4px 24px rgba(0,0,0,.5);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

/* ---- Layout ---- */
.app-shell {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---- Top bar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-logo {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-logo span { color: var(--brand); }

.topbar-actions { display: flex; gap: 8px; align-items: center; }

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.btn-icon:hover { background: var(--border); }
.btn-icon svg { width: 18px; height: 18px; stroke: var(--text-2); fill: none; stroke-width: 1.8; }

/* ---- Page title ---- */
.page-header {
  padding: 24px 0 8px;
}
.page-header h1 {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}
.page-header h1 span { color: var(--brand); }
.page-header p {
  color: var(--text-2);
  font-size: 14px;
  margin-top: 6px;
}

/* ---- Card ---- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-2);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title::before {
  content: '';
  width: 3px;
  height: 14px;
  background: var(--brand);
  border-radius: 2px;
  display: inline-block;
}

/* ---- Upload zone ---- */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.upload-zone.dragover {
  border-color: var(--brand);
  background: rgba(255,87,34,.06);
}
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.upload-zone-icon {
  width: 56px;
  height: 56px;
  background: var(--surface-2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.upload-zone-icon svg { width: 26px; height: 26px; stroke: var(--brand); fill: none; stroke-width: 1.8; }
.upload-zone h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.upload-zone p { font-size: 13px; color: var(--text-2); }
.upload-zone .file-selected {
  display: none;
  align-items: center;
  gap: 10px;
  background: var(--green-bg);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  text-align: left;
  margin-top: 12px;
  font-size: 13px;
  color: var(--green);
  font-weight: 600;
}

/* Platform seçici */
.platform-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.platform-pill {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  color: var(--text-2);
  transition: var(--transition);
}
.platform-pill.active,
.platform-pill:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: rgba(255,87,34,.06);
}

/* ---- Form ---- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-grid.single { grid-template-columns: 1fr; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-2);
}
.form-group input,
.form-group select {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 15px;
  color: var(--text);
  font-family: inherit;
  width: 100%;
  transition: var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255,87,34,.12);
}
.form-hint {
  font-size: 11px;
  color: var(--text-3);
}
.select-wrap {
  position: relative;
}
.select-wrap::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--text-2);
  pointer-events: none;
}

/* ---- Stepper ---- */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 24px;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  position: relative;
}
.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 15px;
  left: 50%;
  right: -50%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.step.done:not(:last-child)::after { background: var(--brand); }
.step-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  position: relative;
  z-index: 1;
  transition: var(--transition);
}
.step.active .step-dot { border-color: var(--brand); color: var(--brand); }
.step.done .step-dot  { border-color: var(--brand); background: var(--brand); color: #fff; }
.step-label { font-size: 10px; font-weight: 600; color: var(--text-3); text-transform: uppercase; }
.step.active .step-label { color: var(--brand); }

/* ---- Butonlar ---- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  border: none;
  transition: var(--transition);
  width: 100%;
}
.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled {
  background: var(--border);
  color: var(--text-3);
  cursor: not-allowed;
}
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--text-2); }

/* ---- Loading ---- */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.loading-overlay.show { display: flex; }
.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255,255,255,.2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: #fff; font-size: 14px; font-weight: 600; }

/* ---- Sonuç sayfası ---- */
.verdict-banner {
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  margin-bottom: 16px;
}
.verdict-banner.uygun      { background: var(--green-bg);  }
.verdict-banner.zorlanirsin{ background: var(--yellow-bg); }
.verdict-banner.henuz_erken{ background: var(--red-bg);   }

.verdict-emoji { font-size: 48px; margin-bottom: 8px; }
.verdict-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}
.verdict-banner.uygun       .verdict-title { color: var(--green); }
.verdict-banner.zorlanirsin .verdict-title { color: var(--yellow); }
.verdict-banner.henuz_erken .verdict-title { color: var(--red); }
.verdict-subtitle { font-size: 14px; color: var(--text-2); }

/* Zorluk göstergesi */
.difficulty-meter {
  margin: 20px 0;
}
.difficulty-meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 6px;
}
.difficulty-bar-track {
  height: 12px;
  background: var(--surface-2);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.difficulty-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 1s cubic-bezier(.4,0,.2,1);
  background: linear-gradient(90deg, #4CAF50 0%, #FFC107 50%, #F44336 100%);
  background-size: 600px 100%;
}

/* Metrik grid */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.metric-card {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 14px;
  border: 1px solid var(--border);
}
.metric-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255,87,34,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.metric-icon svg { width: 16px; height: 16px; stroke: var(--brand); fill: none; stroke-width: 2; }
.metric-value { font-size: 20px; font-weight: 800; }
.metric-label { font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }

/* Segment bar chart */
.segment-chart { display: flex; flex-direction: column; gap: 8px; }
.segment-item { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.segment-label { width: 60px; color: var(--text-2); flex-shrink: 0; font-size: 11px; }
.segment-bar-track { flex: 1; height: 20px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.segment-bar-fill {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding-left: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  transition: width .8s ease;
  min-width: 30px;
}
.seg-flat     { background: #78909C; }
.seg-easy     { background: #66BB6A; }
.seg-moderate { background: #FFA726; }
.seg-hard     { background: #EF5350; }
.seg-extreme  { background: #B71C1C; }

/* Uyarı listesi */
.alert-list { display: flex; flex-direction: column; gap: 10px; }
.alert-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
}
.alert-item.warning { background: var(--yellow-bg); color: var(--yellow); }
.alert-item.success { background: var(--green-bg);  color: var(--green); }
.alert-item.info    { background: rgba(33,150,243,.1); color: #1565C0; }
.alert-item svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 2; }

/* Tahmini süre */
.time-display {
  text-align: center;
  padding: 20px;
}
.time-display .hours { font-size: 48px; font-weight: 800; color: var(--brand); }
.time-display .time-label { font-size: 13px; color: var(--text-2); margin-top: 4px; }

/* Fiets açıklama */
.fiets-explain {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-2);
  border: 1px solid var(--border);
  margin-top: 12px;
}
.fiets-explain strong { color: var(--text); }

/* Paylaşım checkbox */
.share-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  cursor: pointer;
}
.share-toggle input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--brand);
}
.share-toggle-text { font-size: 14px; line-height: 1.4; }
.share-toggle-text small { display: block; color: var(--text-2); font-size: 12px; }

/* Dashboard geçmiş listesi */
.history-list { display: flex; flex-direction: column; gap: 12px; }
.history-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
}
.history-item:hover { border-color: var(--brand); }
.verdict-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.verdict-dot.uygun       { background: var(--green); }
.verdict-dot.zorlanirsin { background: var(--yellow); }
.verdict-dot.henuz_erken { background: var(--red); }
.history-info { flex: 1; min-width: 0; }
.history-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-meta { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.history-score { font-size: 18px; font-weight: 800; color: var(--text-2); }

/* Login / Register */
.auth-wrap {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.auth-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
.auth-logo {
  text-align: center;
  margin-bottom: 24px;
}
.auth-logo h1 { font-size: 20px; font-weight: 800; }
.auth-logo h1 span { color: var(--brand); }
.auth-logo p { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  padding: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}
.auth-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.error-msg {
  background: var(--red-bg);
  color: var(--red);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
  display: none;
}
.error-msg.show { display: block; }

/* ---- Bottom nav ---- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 100;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0 8px;
  gap: 3px;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  text-decoration: none;
  transition: var(--transition);
}
.nav-item.active { color: var(--brand); }
.nav-item svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.main-content { padding-bottom: 80px; }

/* ---- Responsive tweaks ---- */
@media (max-width: 380px) {
  .form-grid { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: 1fr; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:       #121212;
    --surface:  #1E1E1E;
    --surface-2:#2A2A2A;
    --border:   #333333;
    --text:     #F0F0F0;
    --text-2:   #AAAAAA;
    --text-3:   #666666;
    --green-bg:  #1B3A1D;
    --yellow-bg: #3A2F00;
    --red-bg:    #3A1010;
    --shadow:    0 2px 12px rgba(0,0,0,.4);
    --shadow-md: 0 4px 24px rgba(0,0,0,.5);
  }
}

/* ---- Animasyonlar ---- */
.fade-in {
  animation: fadeIn .4s ease forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.slide-up {
  animation: slideUp .3s ease forwards;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============================================
   EK STİLLER — v2 güncellemeleri
   ============================================= */

/* Hero section (misafir) */
.hero-section {
  text-align: center;
  padding: 28px 0 24px;
}
.hero-title {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 10px;
}
.hero-title span { color: var(--brand); }
.hero-sub {
  font-size: 14px;
  color: var(--text-2);
  max-width: 340px;
  margin: 0 auto 20px;
  line-height: 1.6;
}
.hero-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}
.hero-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}
.hero-step-num {
  width: 28px;
  height: 28px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}
.hero-step-arrow {
  color: var(--text-3);
  font-size: 16px;
  margin-bottom: 14px;
}

/* Misafir badge */
.guest-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,87,34,.1);
  color: var(--brand);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
}

/* Misafir limit banner */
.guest-limit-banner {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  margin-top: 20px;
}

/* Ağırlık breakdown */
.weight-breakdown {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.weight-plus {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-3);
  margin: -4px 0;
}

/* Sistem ağırlığı toplam göstergesi */
.system-weight-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,87,34,.08);
  border: 1.5px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 12px;
}
.system-weight-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
}
.system-weight-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--brand);
}

/* Dashboard tab navigasyon */
.dash-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.dash-tabs::-webkit-scrollbar { display: none; }
.dash-tab {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  text-decoration: none;
  transition: var(--transition);
}
.dash-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.dash-tab:hover { color: var(--brand); text-decoration: none; }

/* Geçmiş item silme butonu */
.history-item-wrap {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 12px;
}
.history-item-wrap .history-item {
  flex: 1;
  margin-bottom: 0;
  border-radius: var(--radius) 0 0 var(--radius);
}
.delete-btn {
  width: 42px;
  background: var(--red-bg);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--red);
  transition: var(--transition);
  flex-shrink: 0;
}
.delete-btn:hover { background: var(--red); color: #fff; }
