/* ==========================================================================
   SEEYOUSOON — SCREEN B1: HEM · KARTA (B-HEM-UI)
   Obsidian Glassmorphism · Stitch 1:1 Implementation
   ========================================================================== */

/* ── 1. Keyframes ── */
@keyframes capsulePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.02); opacity: 0.92; }
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* ── 2. Topbar & Header ── */
.hem-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: calc(var(--safe-top) + 12px) 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: var(--z-topbar);
  pointer-events: none;
}
.hem-topbar > * { pointer-events: auto; }

.hem-topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hem-icon-btn-round {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(20, 26, 41, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.14), 0 4px 12px rgba(0, 0, 0, 0.4);
  color: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s ease;
  position: relative;
}
.hem-icon-btn-round:active { transform: scale(0.9); }

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

.hem-notif-dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #FFB95F;
  box-shadow: 0 0 8px #FFB95F;
}

.hem-avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7C3AED 0%, #4338CA 100%);
  border: 1px solid rgba(208, 188, 255, 0.4);
  color: #FFF;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.18s ease;
}
.hem-avatar-btn:active { transform: scale(0.9); }

/* ── 3. Stacked Dual Live Capsule ── */
.hem-capsule-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}
.hem-capsule-behind {
  margin-bottom: -6px;
  padding: 2px 10px;
  border-radius: 9999px;
  background: rgba(20, 26, 41, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 5px;
  transform: scale(0.94);
  opacity: 0.75;
}
.hem-capsule-behind-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #F97316;
  animation: pulseDot 2s infinite;
}
.hem-capsule-behind-text {
  font-size: 9px;
  font-weight: 600;
  color: #CBC3D7;
  letter-spacing: 0.02em;
}
.hem-capsule-main {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 9999px;
  background: rgba(20, 26, 41, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(139, 92, 246, 0.35);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.14), 0 4px 20px rgba(0, 0, 0, 0.5);
  animation: capsulePulse 3s ease-in-out infinite;
  transition: transform 0.18s ease;
}
.hem-capsule-main:active { transform: scale(0.95); }
.hem-capsule-ring-box {
  position: relative;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hem-capsule-ring-box svg.ring-svg {
  width: 20px;
  height: 20px;
  transform: rotate(-90deg);
}
.hem-capsule-ring-icon {
  position: absolute;
  color: #D0BCFF;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hem-capsule-label {
  font-size: 11px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 4px;
}
.hem-capsule-highlight {
  color: #D0BCFF;
  font-variant-numeric: tabular-nums;
}
.hem-capsule-chevron {
  color: #958EA0;
  display: flex;
  align-items: center;
}

/* ── 4. Floating Greeting Chip on Map ── */
.hem-greeting-chip {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  background: rgba(14, 18, 30, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  font-size: 11px;
  font-weight: 500;
  color: #CBC3D7;
}
.hem-greeting-moon { color: #FFB95F; font-size: 13px; }
.hem-greeting-city { color: #FFFFFF; font-weight: 700; }

/* ── 5. Bottom Sheet Content Layout ── */
.hem-content-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px 0 32px;
}

/* Trust Row (BankID · Fast pris · 0% påslag) */
.hem-trust-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
}
.hem-trust-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #CBC3D7;
}
.hem-trust-item--bankid { color: #D0BCFF; }
.hem-trust-item--fastpris { color: #FFB95F; }
.hem-trust-item--paslag { color: #10B981; }
.hem-trust-dot { color: rgba(255, 255, 255, 0.2); font-size: 10px; }

/* Search Box with Soon AI */
.hem-search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(20, 26, 41, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 5px 6px;
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.12);
  transition: border-color 0.2s ease;
}
.hem-search-box:focus-within { border-color: rgba(139, 92, 246, 0.6); }
.hem-search-icon { color: #958EA0; margin-left: 8px; display: flex; align-items: center; }
.hem-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #FFFFFF;
  font-size: 13px;
  font-family: var(--font-body);
  padding: 6px 8px;
}
.hem-search-input::placeholder { color: #958EA0; }
.hem-btn-mic {
  background: none;
  border: none;
  color: #958EA0;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  transition: color 0.15s ease;
}
.hem-btn-mic:hover { color: #FFF; }
.hem-btn-soon-ai {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.4);
  transition: transform 0.18s ease;
  flex-shrink: 0;
}
.hem-btn-soon-ai:active { transform: scale(0.95); }

/* Section Header */
.hem-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.hem-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.01em;
  margin: 0;
}
.hem-section-badge {
  font-size: 10px;
  font-weight: 700;
  color: #D0BCFF;
}

/* Services Grid (5 columns, 2 rows) */
.hem-services-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.hem-service-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
  transition: transform 0.18s ease;
}
.hem-service-tile:active { transform: scale(0.93); }
.hem-service-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.hem-service-icon-box svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  display: block;
}

/* 10 Service Hue Themes */
.hem-service-tile[data-service="taxi"] .hem-service-icon-box { background: rgba(139, 92, 246, 0.18); border: 1px solid rgba(139, 92, 246, 0.45); color: #A855F7; }
.hem-service-tile[data-service="mat"] .hem-service-icon-box { background: rgba(249, 115, 22, 0.18); border: 1px solid rgba(249, 115, 22, 0.45); color: #F97316; }
.hem-service-tile[data-service="skonhet"] .hem-service-icon-box { background: rgba(236, 72, 153, 0.18); border: 1px solid rgba(236, 72, 153, 0.45); color: #EC4899; }
.hem-service-tile[data-service="stad"] .hem-service-icon-box { background: rgba(20, 184, 166, 0.18); border: 1px solid rgba(20, 184, 166, 0.45); color: #14B8A6; }
.hem-service-tile[data-service="flytt"] .hem-service-icon-box { background: rgba(99, 102, 241, 0.18); border: 1px solid rgba(99, 102, 241, 0.45); color: #818CF8; }
.hem-service-tile[data-service="biltvatt"] .hem-service-icon-box { background: rgba(6, 182, 212, 0.18); border: 1px solid rgba(6, 182, 212, 0.45); color: #22D3EE; }
.hem-service-tile[data-service="hantverk"] .hem-service-icon-box { background: rgba(234, 179, 8, 0.18); border: 1px solid rgba(234, 179, 8, 0.45); color: #FACC15; }
.hem-service-tile[data-service="shopping"] .hem-service-icon-box { background: rgba(132, 204, 22, 0.18); border: 1px solid rgba(132, 204, 22, 0.45); color: #A3E635; }
.hem-service-tile[data-service="resor"] .hem-service-icon-box { background: rgba(56, 189, 248, 0.18); border: 1px solid rgba(56, 189, 248, 0.45); color: #38BDF8; }
.hem-service-tile[data-service="mer"] .hem-service-icon-box { background: rgba(20, 26, 41, 0.9); border: 1px solid rgba(255, 255, 255, 0.12); color: #94A3B8; }
.hem-service-label { font-size: 11px; font-weight: 600; color: #FFFFFF; }

/* Min dag · Timeline Scroll */
.hem-mindag-header-left { display: flex; align-items: center; gap: 6px; }
.hem-mindag-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8B5CF6;
  box-shadow: 0 0 8px #8B5CF6;
}
.hem-btn-planera {
  padding: 3px 9px;
  border-radius: 9999px;
  background: rgba(20, 26, 41, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #D0BCFF;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease;
}
.hem-btn-planera:active { transform: scale(0.95); }

.hem-mindag-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.hem-mindag-scroll::-webkit-scrollbar { display: none; }

.hem-mindag-card {
  min-width: 145px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(20, 26, 41, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: transform 0.18s ease;
}
.hem-mindag-card:active { transform: scale(0.96); }
.hem-mindag-top { display: flex; align-items: center; justify-content: space-between; }
.hem-mindag-time {
  font-size: 11px;
  font-weight: 700;
  color: #FFFFFF;
  font-variant-numeric: tabular-nums;
}
.hem-mindag-dot { width: 6px; height: 6px; border-radius: 50%; }
.hem-dot--taxi { background: #8B5CF6; box-shadow: 0 0 6px #8B5CF6; }
.hem-dot--mat { background: #F97316; box-shadow: 0 0 6px #F97316; }
.hem-dot--stad { background: #14B8A6; box-shadow: 0 0 6px #14B8A6; }

.hem-mindag-title { font-size: 12px; font-weight: 600; color: #FFFFFF; margin-top: 4px; }
.hem-mindag-sub { font-size: 10px; font-weight: 500; margin-top: 2px; }
.hem-sub--taxi { color: #A855F7; }
.hem-sub--mat { color: #F97316; }
.hem-sub--stad { color: #14B8A6; }

/* Smart Routine Suggestion Card */
.hem-suggestion-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(20, 26, 41, 0.8);
  border: 1px solid rgba(139, 92, 246, 0.25);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.12);
  position: relative;
  overflow: hidden;
}
.hem-suggestion-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #D0BCFF;
  font-size: 10px;
  font-weight: 700;
  margin-bottom: 6px;
}
.hem-suggestion-title {
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0;
}
.hem-suggestion-desc {
  font-size: 11px;
  color: #CBC3D7;
  margin: 3px 0 0;
}
.hem-suggestion-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.hem-suggestion-price-label {
  font-size: 9px;
  text-transform: uppercase;
  color: #958EA0;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.hem-suggestion-price-val {
  font-size: 15px;
  font-weight: 800;
  color: #FFFFFF;
  font-variant-numeric: tabular-nums;
}
.hem-btn-book {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
  transition: transform 0.18s ease;
}
.hem-btn-book:active { transform: scale(0.95); }

@media (prefers-reduced-motion: reduce) {
  .hem-capsule-main {
    animation: none !important;
  }
}
