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

:root {
  --bg: #000000;
  --card: #111111;
  --border: #222222;
  --accent: #F0C850;
  --green: #2ecc71;
  --red: #e74c3c;
  --text-primary: #FFFFFF;
  --text-secondary: #636e72;
  --text-tertiary: #b2bec3;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

html, body {
  height: 100%;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* --- Views --- */
.view {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
}

.hidden {
  display: none !important;
}

/* =============================================
   VY 1: SESSIONSLISTA
   ============================================= */

.app-header {
  padding: 16px 24px 0 24px;
}

.app-title {
  font-family: var(--font-ui);
  font-size: 28px;
  font-weight: 700;
  color: var(--green);
}

/* Session list */
.session-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}

/* Session card (RunHistoryItem) */
.session-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  cursor: pointer;
  transition: transform 0.1s;
}

.session-card:active {
  transform: scale(0.98);
}

.session-card-map {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #1A1A1A;
}

.session-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.session-card-title {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.session-card-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.session-card-stats {
  display: flex;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.session-card-stats .dist {
  color: var(--accent);
  font-weight: 700;
}

.session-card-stats .time,
.session-card-stats .pace {
  color: var(--text-tertiary);
}

.session-card-chevron {
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 8px;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.empty-state-title {
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.empty-state-text {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
}

/* Start button */
.btn-wrapper {
  padding: 12px 16px;
  flex-shrink: 0;
}

.btn-start {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  background: var(--accent);
  color: #000000;
  border: none;
  border-radius: 30px;
  padding: 16px 40px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
}

.btn-start:active {
  filter: brightness(0.9);
}

/* =============================================
   VY 2: AKTIV SPÅRNING
   ============================================= */

.tracking-map-container {
  flex: 1;
  min-height: 0;
  position: relative;
}

.tracking-map {
  width: 100%;
  height: 100%;
}

.map-overlay {
  position: absolute;
  top: 12px;
  left: 24px;
  right: 24px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}

.live-badge {
  background: rgba(46, 204, 113, 0.8);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  pointer-events: auto;
}

.gps-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.93);
  padding: 6px 12px;
  border-radius: 20px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: #2c3e50;
  pointer-events: auto;
}

.gps-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
}

.gps-dot.yellow { background: #f1c40f; }
.gps-dot.red { background: var(--red); }

.signal-lost-banner {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  background: var(--red);
  color: white;
  text-align: center;
  padding: 8px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  z-index: 10;
}

/* Tracking stats */
.tracking-stats {
  display: flex;
  padding: 20px 12px;
  gap: 8px;
}

.tracking-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.tracking-stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.tracking-stat-value {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
}

.tracking-stat-accent {
  color: var(--accent);
}

/* Stop button */
.btn-wrapper-stop {
  padding: 12px 16px 24px 16px;
}

.btn-stop {
  width: 100%;
  background: var(--red);
  color: var(--text-primary);
  border: none;
  border-radius: 16px;
  padding: 18px 24px;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
}

.btn-stop:active {
  filter: brightness(0.85);
}

/* =============================================
   VY 3: SESSIONSDETALJ
   ============================================= */

.detail-header {
  background: var(--card);
  padding: 12px 16px;
}

.btn-back {
  background: none;
  border: none;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  color: var(--green);
  cursor: pointer;
  padding: 4px 0;
}

.detail-map {
  height: 280px;
  flex-shrink: 0;
}

/* Detail stats grid */
.detail-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}

.detail-stats-row {
  display: flex;
  gap: 10px;
}

.detail-stat-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.detail-stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.detail-stat-value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.detail-stat-accent {
  color: var(--accent);
}

/* Delete button */
.btn-wrapper-delete {
  padding: 16px 16px 24px 16px;
}

.btn-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  color: var(--red);
  border: 2px solid var(--red);
  border-radius: 16px;
  padding: 16px 24px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
}

.btn-delete:active {
  background: var(--red);
  color: white;
}

.btn-delete:active svg {
  stroke: white;
}

/* =============================================
   OpenLayers overrides
   ============================================= */

.ol-viewport {
  border-radius: inherit;
}

.session-card-map .ol-zoom,
.session-card-map .ol-attribution,
.session-card-map .ol-rotate {
  display: none;
}

.tracking-map .ol-zoom,
.tracking-map .ol-attribution,
.tracking-map .ol-rotate {
  display: none;
}

.detail-map .ol-attribution {
  font-size: 10px;
}
