/* trace-antigravity/css/components.css */

/* Route Wrapper */
.route-wrapper {
  margin-bottom: 8px;
  transition: opacity 0.3s ease;
}

/* Route Item Button */
.route-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  border: 0.5px solid transparent;
  cursor: pointer;
  background: transparent;
}

.route-wrapper.inactive .route-item:hover,
.route-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.route-wrapper.active .route-item {
  border-color: var(--divider-soft);
}

/* Category Specific Active States */
.route-wrapper.active[data-category="artists-pick"] .route-item { background-color: rgba(13, 122, 130, 0.75); }
.route-wrapper.active[data-category="typography"] .route-item { background-color: rgba(58, 78, 154, 0.75); }
.route-wrapper.active[data-category="architecture"] .route-item { background-color: rgba(157, 55, 46, 0.75); }
.route-wrapper.active[data-category="art-objects"] .route-item { background-color: rgba(37, 122, 72, 0.75); }
.route-wrapper.active[data-category="street-art"] .route-item { background-color: rgba(122, 48, 132, 0.75); }

.route-wrapper.inactive {
  opacity: 1;
}

.route-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.3s ease;
}

/* Default state: icons are light grey/white */
.route-icon img {
  filter: brightness(0) invert(1);
  transition: filter 0.3s ease;
}

/* When active, icon BG becomes yellow */
.route-wrapper.active .route-icon {
  background-color: var(--brand-trace) !important;
}

/* When active, icon glyph color becomes dark */
.route-wrapper.active .route-icon img {
  filter: brightness(0) saturate(100%) invert(18%) sepia(35%) saturate(543%) hue-rotate(152deg) brightness(95%) contrast(92%) !important;
}

.route-info {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.route-name {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: #f5f9f6;
  text-transform: capitalize;
}

.route-wrapper.active .route-name {
  color: var(--brand-trace);
}

.route-meta {
  font-size: 13px;
  display: flex;
  gap: 4px;
}

.route-count { color: #f5f9f6; }
.route-unit { color: #ebf2ee; }

.route-description {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 400;
  font-size: 12px;
  color: #FFFFFF;
  padding: 0 12px 0 46px; /* align text carefully */
  margin: 0;
  transition: all 0.3s ease;
}

.route-wrapper.active .route-description {
  max-height: 40px;
  opacity: 1;
  margin-top: 8px; /* space below button */
}

/* Nearby Grid */
.nearby-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-md);
  padding: var(--space-md);
  border: 1px solid var(--cat-artists-choice);
  border-radius: var(--radius-md);
}

.nearby-item {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--surface-5);
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 0 1px transparent;
}

.nearby-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Hover State */
.nearby-item:hover {
  box-shadow: 0 0 0 1px var(--brand-trace), 0 0 16px rgba(254, 219, 102, 0.25);
  z-index: 1;
}

/* Selected Active Map State */
.nearby-item.active {
  box-shadow: 0 0 0 2px var(--brand-trace), 0 0 16px rgba(254, 219, 102, 0.4);
  z-index: 2;
  transform: scale(1.05);
}

/* Pressed State Outer & Scale */
.nearby-item:active {
  box-shadow: 0 0 0 1.5px #151e1a; /* Dark border resembling trace dark theme */
  transform: scale(0.97);
  transition: all 0.1s ease;
}

/* Pressed State Dark Overlay */
.nearby-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-color: rgba(0, 0, 0, 0.25); /* Darken the image slightly */
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.nearby-item:active::after {
  opacity: 1;
  transition: opacity 0.1s ease;
}
/* Primary CTA Button */
.btn-cta {
  width: 100%;
  height: 44px;
  background-color: var(--cat-artists-choice);
  border: 1px solid transparent; /* Reserve space for pressed state border to prevent layout shift */
  border-radius: 16px; /* Figma spec: rounded-[16px] */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 8px 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  box-shadow: 0 0 0 transparent; /* Base for transition */
}

.btn-cta:hover {
  filter: brightness(1.1); /* Subtle elevation */
}

/* Pressed State */
.btn-cta:active {
  transform: scale(0.98);
  border-color: var(--brand-trace);
}

.btn-cta.btn-active-line {
  border-color: #FFFFFF;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}
.btn-cta.btn-active-line .cta-title {
  color: var(--brand-trace);
}

.btn-cta:focus-visible {
  outline: none;
  border-color: var(--brand-trace);
  box-shadow: 0 0 0 1px var(--brand-trace);
}

.cta-left {
  display: flex;
  align-items: center;
  gap: 12px; /* Sufficient space between icon and text */
}

.cta-icon {
  width: 36px; /* Icon circle dimension relative to capsule */
  height: 36px;
  background-color: var(--brand-trace);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cta-text-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.cta-title {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 500;
  font-size: 13px;
  color: #FFFFFF; /* High contrast white */
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.2s ease;
}

.cta-subtitle {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 11px;
  color: #ebf2ee; /* Soft off-white */
  font-weight: 300;
}

.cta-arrow {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cta-arrow img {
  filter: brightness(0) invert(1); /* Default arrow is white */
  transition: filter 0.2s ease;
  width: 16px;
}

/* Color changes when pressed / focused */
.btn-cta:active .cta-title,
.btn-cta:focus-visible .cta-title {
  color: var(--brand-trace);
}

.btn-cta:active .cta-arrow img,
.btn-cta:focus-visible .cta-arrow img {
  /* Yellow filter approx for #E7E626 */
  filter: brightness(0) saturate(100%) invert(86%) sepia(31%) saturate(1212%) hue-rotate(354deg) brightness(96%) contrast(93%);
}

/* Drawer Overlay */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(18, 32, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Side Drawer (Quick Guide) */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 34, 41, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: -340px; /* Width matching Figma */
  width: 340px;
  height: 100%;
  background-color: #0f2229;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 36px 0;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
}

.drawer.active {
  right: 0;
}

.drawer-header {
  padding: 0 24px 16px;
  border-bottom: 0.5px solid #2d4855;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-header h2 {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 400;
  font-size: 16px;
  color: #cddbd0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.close-drawer {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #cddbd0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* How it Works Steps */
.how-it-works-step {
  background-color: #2d4855;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-header {
  border-bottom: 0.5px solid var(--brand-trace);
  padding-bottom: 8px;
}

.step-label {
  color: var(--brand-trace);
  font-family: 'Josefin Sans', sans-serif;
  font-size: 11px;
  font-weight: 400;
}

.step-heading {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: #edf4f0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.35;
  margin: 0;
}

.brand-yellow {
  color: var(--brand-trace);
}

.step-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
}

.info-label {
  color: var(--brand-trace);
  font-family: 'Josefin Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding-top: 3px;
}

.info-text {
  font-family: 'Roboto Slab', serif;
  font-weight: 300;
  font-size: 15px;
  color: #ebf2ee;
  line-height: 1.35;
}

/* Yellow Action Button */
.btn-yellow-guide {
  width: 100%;
  background-color: var(--brand-trace);
  border: 1px solid var(--brand-trace);
  border-radius: 16px;
  color: #2d4855;
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  margin-top: 4px;
  cursor: pointer;
  transition: filter 0.2s ease;
}

.btn-yellow-guide:hover {
  filter: brightness(1.1);
}

.drawer-footer {
  padding: 12px 24px 0;
}

.copyright {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 400;
  font-size: 11px;
  color: #cddbd0;
}


/* Responsive adjustments for drawer */
@media (max-width: 768px) {
  .drawer {
    width: 100vw;
    right: auto;
    left: -100vw;
  }
  .drawer.active {
    transform: translateX(100%);
  }
}

/* Spot Drawer Styles */
.spot-drawer {
  width: 417px;
  right: -417px;
  background-color: var(--backgrounds-bg-card, #ebf2ee);
  color: var(--text-text-primary, #0f2229);
  padding: 0;
}
@media (max-width: 768px) {
  .spot-drawer {
    width: 100vw;
    /* Cancel the left:-100vw set by .drawer mobile — we use right-based positioning */
    left: auto;
    right: -100vw;
    z-index: 99; /* Sit behind the z-index:100 Top Nav & Search Bar on Mobile */
    background-color: var(--surface-bg-base, #f5f9f6);
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .spot-drawer.active {
    /* Override the transform-based .drawer.active to use right:0 instead */
    transform: none;
    right: 0;
  }
  .spot-drawer .spot-drawer-content {
    /* Push content below mobile Top Nav (64px) + tight gap by default */
    padding-top: 84px; 
    padding-bottom: 32px; 
    transition: padding-top 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  
  body.mobile-search-is-open .spot-drawer .spot-drawer-content {
    /* Push content down to accommodate the active floating search bar */
    padding-top: 154px;
  }
}

.spot-drawer-content {
  display: flex;
  flex-direction: column;
  padding: 24px;
  padding-bottom: 32px;
  gap: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
  min-height: 0; /* Allow flex container to respect its fixed height bound */
}

.spot-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumbs-path {
  display: flex;
  align-items: center;
  gap: 2px;
}

.icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-text-primary, #0f2229);
}

.breadcrumb-root,
.breadcrumb-slash {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: var(--text-text-primary, #0f2229);
  text-transform: capitalize;
  line-height: 1;
}

/* When breadcrumb-root is an <a> tag, strip link defaults */
a.breadcrumb-root {
  text-decoration: none;
  cursor: pointer;
  transition: text-decoration-color 0.2s ease;
}
a.breadcrumb-root:hover {
  text-decoration: underline;
  text-decoration-color: var(--text-text-primary, #0f2229);
}

.breadcrumb-current {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 600;
  font-size: 12px;
  color: var(--backgrounds-bg-card, #ebf2ee);
  text-transform: uppercase;
  padding: 3px 4px 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.bg-typography {
  background-color: var(--route-typography, #3a4e9a);
}

.spot-divider {
  border: none;
  border-top: 1px solid rgba(15, 34, 41, 0.2);
  margin: 0;
  width: 100%;
}

.spot-header {
  border-left: 5px solid var(--route-typography, #3a4e9a);
  padding-left: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spot-title {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 500;
  font-size: 22px;
  color: var(--text-text-primary, #0f2229);
  letter-spacing: 0.1em; /* 2.2px tracking relative to 22px is 10% or 0.1em */
  text-transform: uppercase;
  margin: 0;
  line-height: 1.2;
}

.spot-subtitle {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 400;
  font-size: 12px;
  color: var(--text-text-primary, #0f2229);
  display: flex;
  gap: 6px;
  line-height: 1.2;
}

.spot-location {
  display: flex;
  align-items: center;
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 400;
  font-size: 12px;
  color: var(--text-text-primary, #0f2229);
  gap: 2px;
  line-height: 1.2;
}

.spot-hero {
  border-radius: 16px;
  overflow: hidden;
  height: 211px;
  flex-shrink: 0;
  width: 100%;
}

.spot-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.spot-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.spot-section h3, .spot-designer-note h3 {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--text-text-primary, #0f2229);
  margin: 0;
  line-height: 1.3;
}

.spot-section p, .spot-designer-note p {
  font-family: 'Roboto Slab', serif;
  font-weight: 300;
  font-size: 16px;
  color: var(--text-text-body, #2d4855);
  margin: 0;
  line-height: 1.2;
}

.spot-designer-note {
  background-color: var(--backgrounds-bg-elevated, #cddbd0);
  border-left: 3px solid var(--route-typography, #3a4e9a);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.spot-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  padding-bottom: 24px;
}

.btn-primary {
  background-color: var(--cta-cta-default, #e7e626);
  border: 1px solid var(--cta-cta-focused-ring, #e7e626);
  border-radius: 16px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 600;
  font-size: 12px;
  color: var(--cta-cta-text, #2d4855);
  text-transform: uppercase;
}

.btn-secondary {
  background-color: var(--text-text-primary-glass, rgba(237, 244, 240, 0.25));
  border: 1px solid var(--cta-cta-default, #e7e626);
  border-radius: 16px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 400;
  font-size: 12px;
  color: var(--backgrounds-bg-card, #2d4855);
}

/* User Location Control Stylings */
.mapboxgl-ctrl-bottom-right {
    margin-right: 12px !important;
    margin-bottom: 24px !important;
}

.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl-group {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

.mapboxgl-ctrl-group button.mapboxgl-ctrl-geolocate {
  background-color: rgba(231, 230, 38, 0.75) !important;
  width: 42px !important;
  height: 42px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: none !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  padding: 0 !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

.mapboxgl-ctrl-group button.mapboxgl-ctrl-geolocate:hover {
  background-color: #e7e626 !important;
  box-shadow: 4px 4px 12px 0px rgba(15, 34, 41, 0.33) !important;
}

.mapboxgl-ctrl-group button.mapboxgl-ctrl-geolocate:active {
  background-color: #e7e626 !important;
  box-shadow: inset 2px 2px 2px 0px rgba(0, 0, 0, 0.25) !important;
}

.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon {
    background-image: url('../assets/icons/user-location.svg') !important;
    background-size: 26px 26px !important;
    width: 26px !important;
    height: 26px !important;
    filter: none !important;
}

/* On mobile, position is fully handled by layout.css bottom offset */

/* ── Custom User Location Marker (The Dot) ────────────────────────────────── */
/* Theme-aware: Yellow on Dark Map, Surface-5 on Light/Street Map */

/* 1. Default / Dark Map State (Yellow) */
.map-dark .mapboxgl-user-location-dot,
.mapboxgl-user-location-dot {
    background-color: var(--brand-trace) !important;
}

.map-dark .mapboxgl-user-location-dot::before,
.mapboxgl-user-location-dot::before {
    background-color: var(--brand-trace) !important;
}

.map-dark .mapboxgl-user-location-show-heading .mapboxgl-user-location-heading::after,
.map-dark .mapboxgl-user-location-show-heading .mapboxgl-user-location-heading::before,
.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading::after,
.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading::before {
    border-bottom-color: var(--brand-trace) !important;
}

.map-dark .mapboxgl-user-location-accuracy-circle {
    background-color: rgba(231, 230, 38, 0.1) !important;
}

/* 2. Light Map State (Contrast Surface Color) */
body:not(.map-dark) .mapboxgl-user-location-dot {
    background-color: var(--surface-5) !important;
}

body:not(.map-dark) .mapboxgl-user-location-dot::before {
    background-color: var(--surface-5) !important;
}

body:not(.map-dark) .mapboxgl-user-location-show-heading .mapboxgl-user-location-heading::after,
body:not(.map-dark) .mapboxgl-user-location-show-heading .mapboxgl-user-location-heading::before {
    border-bottom-color: var(--surface-5) !important;
}

body:not(.map-dark) .mapboxgl-user-location-accuracy-circle {
    background-color: rgba(189, 208, 213, 0.2) !important; /* surface-5 tint */
}
