/* Sürüş grafikleri, yatış kartı ve hız haritası — iOS Theme renkleriyle (açık / koyu).
   Sürüş sayfasında ve Hesabım sürüş penceresinde ortak kullanılır. */
:root {
  --rc-chart1: #B3211D; --rc-chart3: #1F6F9B; --rc-chart4: #5A48D6; --rc-primary: #B3211D;
  --rc-fg: #211f1e; --rc-muted: #746b65; --rc-border: #d9d1ca; --rc-card: #ffffff;
}
html[data-theme="dark"], html:not([data-theme]) .ride-detail {
  --rc-chart1: #C41E1A; --rc-chart3: #4FA8D8; --rc-chart4: #8B7CFA; --rc-primary: #C41E1A;
  --rc-fg: #f5f0ef; --rc-muted: #a69a97; --rc-border: #332b2d; --rc-card: #171314;
}

/* ---------- Senkron grafikler ---------- */
.rc-analysis { margin-top: 16px; min-width: 0; }
.rc-profile { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; min-width: 0; }
.rc-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
.rc-position { font-family: var(--font-body, Manrope, system-ui, sans-serif); font-size: 11px; font-weight: 600; color: var(--rc-muted); font-variant-numeric: tabular-nums; }
.rc-magnet,
.member-page .rc-magnet {
  width: 110px; height: 32px; min-height: 32px; padding: 0; flex: none;
  font: 600 10px/1 var(--font-body, Manrope, system-ui, sans-serif);
  color: var(--rc-muted); background: var(--rc-card);
  border: 1px solid var(--rc-border); border-radius: 999px; cursor: pointer;
}
.rc-magnet.is-on { color: var(--rc-fg); border-color: color-mix(in srgb, var(--rc-chart3) 65%, transparent); }
.rc-graph { margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rc-caption { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 20px; }
.rc-label { display: inline-flex; align-items: center; gap: 6px; font: 700 11px/1 var(--font-body, Manrope, system-ui, sans-serif); letter-spacing: 1.4px; color: var(--rc-muted); }
.rc-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.rc-readout { font: 400 11px/20px var(--font-body, Manrope, system-ui, sans-serif); color: var(--rc-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rc-readout.has-value { font: 700 14px/20px var(--font-heading, "Space Grotesk", system-ui, sans-serif); color: var(--rc-fg); }
.rc-plot { position: relative; height: 90px; touch-action: pan-y; cursor: crosshair; border-radius: 4px; outline-offset: 3px; }
.rc-plot svg { display: block; overflow: visible; }
.rc-grid { stroke: var(--rc-border); stroke-width: 0.5; }
.rc-axis { font: 9px var(--font-body, Manrope, system-ui, sans-serif); fill: var(--rc-muted); font-variant-numeric: tabular-nums; }
.rc-line { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.rc-zero { stroke: var(--rc-border); stroke-width: 1; }
.rc-cursor { stroke: var(--rc-muted); stroke-opacity: 0.7; stroke-width: 1; stroke-dasharray: 3 3; }
.rc-peak-icon { overflow: visible; }
.rc-empty { margin: 0; font: 13px/1.5 var(--font-body, Manrope, system-ui, sans-serif); color: var(--rc-muted); }

/* ---------- Yatış kartı ---------- */
.rc-lean-card {
  display: flex; align-items: center; gap: 8px; height: 140px; box-sizing: content-box;
  padding: 16px 20px; margin-bottom: 8px;
  background: var(--rc-card); border: 1px solid var(--rc-border); border-radius: 16px;
}
.rc-lean-side { flex: 1 1 0; min-width: 0; height: 100%; display: flex; padding: 0; margin: 0; border: 0; background: none; color: inherit; font: inherit; text-align: inherit; }
button.rc-lean-side { cursor: pointer; border-radius: 10px; }
.member-page button.rc-lean-side { min-height: 0; padding: 0; border: 0; background: none; }
.rc-lean-side.is-left { align-items: flex-start; justify-content: flex-start; }
.rc-lean-side.is-right { align-items: flex-end; justify-content: flex-end; text-align: right; }
.rc-lean-value { display: flex; flex-direction: column; gap: 2px; }
.rc-lean-side.is-right .rc-lean-value { align-items: flex-end; }
.rc-lean-label { font: 700 11px/1.2 var(--font-body, Manrope, system-ui, sans-serif); letter-spacing: 1.6px; color: var(--rc-muted); }
.rc-lean-value strong { font: 700 30px/1.15 var(--font-heading, "Space Grotesk", system-ui, sans-serif); color: var(--rc-fg); font-variant-numeric: tabular-nums; }
.rc-lean-value strong.is-missing { color: var(--rc-muted); }
.rc-lean-km { font: 700 10px/1.3 var(--font-body, Manrope, system-ui, sans-serif); color: var(--rc-primary); }
.rc-lean-indicator { flex: none; align-self: center; }
.rc-lean-track { fill: none; stroke: var(--rc-border); stroke-width: 1.5; stroke-linecap: round; }
.rc-lean-arc { fill: none; stroke: var(--rc-primary); stroke-width: 2.5; stroke-linecap: round; }
.rc-lean-axis { fill: var(--rc-border); }
@media (max-width: 380px) { .rc-lean-card { padding: 14px 12px; } .rc-lean-indicator { width: 112px; } }

/* ---------- Hız haritası ---------- */
.rc-analysis .member-speed-map { height: 180px; position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--rc-border); background: #e6e4df; }
.rc-analysis .speed-legend { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 8px 0 0; font: 700 9px/1.4 var(--font-body, Manrope, system-ui, sans-serif); color: var(--rc-muted); font-variant-numeric: tabular-nums; }
.speed-legend-bands { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, max-content)); gap: 4px 6px; min-width: 0; flex: 1; }
.speed-legend-bands span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.speed-legend-bands i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.speed-legend-bands i.is-walk { background: color-mix(in srgb, var(--rc-muted) 80%, transparent); }
.speed-legend-side { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.speed-legend-unit { font-weight: 400; opacity: 0.7; }
.speed-legend-lean { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; }
.speed-legend-lean b { font: 700 11px var(--font-heading, "Space Grotesk", system-ui, sans-serif); color: var(--rc-fg); }
.speed-legend-lean em { font: 700 11px var(--font-heading, "Space Grotesk", system-ui, sans-serif); font-style: normal; color: var(--rc-chart4); }
.rc-analysis .rc-map-status { margin: 8px 0 0; font-size: 12px; color: var(--rc-muted); }
.rc-map-peak { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.rc-retry { margin-top: 8px; }

/* ---------- Sürüş haritasında mola ve fotoğraf işaretleri (iOS) ---------- */
.ride-stop-pin, .ride-photo-pin, .member-page .ride-stop-pin, .member-page .ride-photo-pin { position: relative; min-height: 0; border-radius: 9px; padding: 0; margin: 0; border: 0; cursor: pointer; background: none; min-height: 0; }
.ride-stop-pin, .member-page .ride-stop-pin { width: 22px; height: 22px; border-radius: 50%; background: #5856D6; box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0,0,0,.35); display: grid; place-items: center; }
.ride-pin-pause { display: block; width: 6px; height: 8px; border-left: 2px solid #fff; border-right: 2px solid #fff; box-sizing: border-box; }
.ride-photo-pin, .member-page .ride-photo-pin { width: 35px; height: 35px; border-radius: 9px; background: #8e8e93; box-shadow: 0 0 0 3px #fff, 0 2px 6px rgba(0,0,0,.35); }
.ride-photo-pin img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 9px; }
.ride-photo-pin.is-loading img { visibility: hidden; }
.ride-photo-pin.is-stop, .member-page .ride-photo-pin.is-stop { width: 31px; height: 31px; border-radius: 8px; box-shadow: 0 0 0 2.5px #fff, 0 2px 6px rgba(0,0,0,.35); }
.ride-photo-pin.is-stop img { border-radius: 8px; }
.ride-photo-pin.is-stop .ride-pin-pause { position: absolute; right: -6px; bottom: -6px; width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid #fff; background: #5856D6; box-sizing: border-box; }
.ride-photo-pin.is-stop .ride-pin-pause::before { content: ""; position: absolute; left: 3px; top: 3px; width: 4px; height: 4px; border-left: 1.25px solid #fff; border-right: 1.25px solid #fff; box-sizing: border-box; }
.ride-pin-count { position: absolute; right: -8px; bottom: -6px; min-width: 23px; height: 18px; padding: 0 4px; box-sizing: border-box; border-radius: 9px; background: #FF3B30; color: #fff; font: 700 9px/18px system-ui, sans-serif; font-style: normal; text-align: center; }
.ride-point-popup { font: 12px/1.4 var(--font-body, Manrope, system-ui, sans-serif); color: #211f1e; }
.ride-point-popup strong { display: block; margin-bottom: 6px; }
.ride-point-photos { display: flex; gap: 6px; overflow-x: auto; }
.ride-point-photos img { display: block; width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
.rc-analysis .analysis-hint { font-size: 12px; color: var(--rc-muted); line-height: 1.55; margin: 8px 0 0; }
/* Hesabım koyu teması genel düğme rengini değiştirir; grafik ve harita düğmeleri kendi rengini korur. */
html[data-theme] .member-page button.rc-lean-side, html[data-theme] button.rc-lean-side { background: none; border: 0; color: inherit; }
html[data-theme] .member-page .rc-magnet { background: var(--rc-card); color: var(--rc-muted); border: 1px solid var(--rc-border); }
html[data-theme] .member-page .rc-magnet.is-on { color: var(--rc-fg); border-color: color-mix(in srgb, var(--rc-chart3) 65%, transparent); }
html[data-theme] .member-page .ride-stop-pin, html[data-theme] .ride-stop-pin { background: #5856D6; border: 0; }
html[data-theme] .member-page .ride-photo-pin, html[data-theme] .ride-photo-pin { background: #8e8e93; border: 0; }

/* ---------- Üye olmayanlar için sürüş verisi önizlemesi ---------- */
.ride-data-preview {
  position: relative; isolation: isolate;
  display: grid; grid-template-areas: "preview"; grid-template-columns: minmax(0, 1fr);
  overflow: hidden; border-radius: 16px;
}
.ride-data-preview > #ride-more-sections {
  grid-area: preview; min-width: 0; max-height: 176px; overflow: hidden;
  filter: blur(6px); opacity: .8;
  mask-image: linear-gradient(
    to bottom,
    #000 0%,
    rgb(0 0 0 / 75%) 25%,
    rgb(0 0 0 / 25%) 75%,
    transparent 100%
  );
}
.ride-data-preview > .ride-data-gate-card {
  grid-area: preview; z-index: 1; justify-self: center; align-self: end;
  width: min(calc(100% - 24px), 390px); margin: 96px 0 12px; padding: 16px;
  text-align: center; border-radius: 16px; background: var(--rc-card); border: 1px solid var(--rc-border);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--rc-fg) 8%, transparent);
}
.ride-data-gate-card h3 { margin: 0; font: 700 18px/1.3 var(--font-heading, "Space Grotesk", system-ui, sans-serif); color: var(--rc-fg); }
.ride-data-gate-card p { margin: 6px 0 12px; font: 13px/1.5 var(--font-body, Manrope, system-ui, sans-serif); color: var(--rc-muted); }
.ride-data-gate-card .btn { width: 100%; min-height: 44px; justify-content: center; }

/* ---------- "Sürüşe bir bakış" kartı, masaüstü ---------- */
@media (min-width: 1001px) {
  .ride-overview { grid-template-columns: minmax(0, 1fr) 360px; gap: 36px; }
  .ride-summary { position: sticky; top: 88px; padding: 24px 24px 18px; }
  .ride-summary-label { font-size: 12px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted-fg); margin-bottom: 18px; }
  .ride-facts { gap: 18px 20px; }
  .ride-facts dd { font-size: clamp(24px, 1.9vw, 30px); white-space: nowrap; }
  .ride-facts .ride-secondary-fact dd { font-size: 20px; }
  .ride-time-note { margin: 14px 0 20px; }
}
