/**
 * WeinPerPedes - Modern Mobile-First Styles
 */

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
  /* Colors - refined wine palette */
  --color-primary: #722F37;
  --color-primary-dark: #5A1E25;
  --color-primary-light: #8B4049;
  --color-accent: #C4956A;
  --color-accent-light: #D4AD85;
  --color-accent-dark: #A67B52;
  --color-blue: #66b5fe;
  --color-blue-light: #94ccff;
  --color-wine-cream: #FDF5EC;
  --color-wine-blush: #F5E6E0;

  /* Neutrals */
  --color-white: #ffffff;
  --color-gray-50: #FAFAF9;
  --color-gray-100: #F5F5F4;
  --color-gray-200: #E7E5E4;
  --color-gray-300: #D6D3D1;
  --color-gray-400: #A8A29E;
  --color-gray-500: #78716C;
  --color-gray-700: #44403C;
  --color-gray-900: #1C1917;

  /* Typography */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;

  /* Layout */
  --header-height: 60px;
  --footer-height: 40px;
  --panel-max-height: 70vh;
  --button-size: 52px;
  --border-radius: 16px;
  --border-radius-sm: 10px;
  --border-radius-xs: 6px;
  --border-radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.06);
  --shadow: 0 1px 3px rgba(28, 25, 23, 0.1), 0 1px 2px rgba(28, 25, 23, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(28, 25, 23, 0.08), 0 2px 4px -2px rgba(28, 25, 23, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(28, 25, 23, 0.08), 0 4px 6px -4px rgba(28, 25, 23, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(28, 25, 23, 0.1), 0 8px 10px -6px rgba(28, 25, 23, 0.06);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Safe areas for mobile */
  --safe-area-top: env(safe-area-inset-top, 0);
  --safe-area-bottom: env(safe-area-inset-bottom, 0);
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.5;
  color: var(--color-gray-900);
  background-color: var(--color-gray-100);
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Header
   ============================================ */
.header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: var(--header-height);
  padding: 0 var(--space-4);
  padding-top: var(--safe-area-top);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-white);
  box-shadow: 0 2px 12px rgba(114, 47, 55, 0.3);
  position: relative;
  z-index: 100;
  flex-shrink: 0;
}

.header-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--border-radius-sm);
  background: rgba(255, 255, 255, 0.15);
  padding: 3px;
  flex-shrink: 0;
  transition: transform var(--transition-base);
}

.header-logo:hover {
  transform: scale(1.05);
}

.header-content {
  min-width: 0;
  flex: 1;
}

.header-title {
  font-family: var(--font-display);
  font-size: var(--font-size-xl);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.header-subtitle {
  font-size: var(--font-size-xs);
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.header-btn {
  width: 38px;
  height: 38px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--border-radius-sm);
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-white);
  font-size: var(--font-size-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.header-btn:active {
  transform: scale(0.95);
}

/* ============================================
   About Modal
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(28, 25, 23, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--color-white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - var(--space-8));
  display: flex;
  flex-direction: column;
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition-slow);
  overflow: hidden;
}

.modal-overlay.visible .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--color-gray-200);
  flex-shrink: 0;
}

.modal-title {
  font-family: var(--font-display);
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-primary);
}

.modal-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--border-radius-sm);
  background: var(--color-gray-100);
  color: var(--color-gray-500);
  font-size: var(--font-size-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--color-gray-200);
  color: var(--color-primary);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
  -webkit-overflow-scrolling: touch;
}

/* About Content */
.about-hero {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: linear-gradient(135deg, var(--color-wine-cream) 0%, var(--color-wine-blush) 100%);
  border-radius: var(--border-radius-sm);
  margin-bottom: var(--space-5);
}

.about-logo {
  width: 64px;
  height: 64px;
  border-radius: var(--border-radius-sm);
  flex-shrink: 0;
}

.about-tagline {
  font-family: var(--font-display);
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--space-1);
}

.about-date {
  font-size: var(--font-size-sm);
  color: var(--color-gray-500);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.about-date i {
  color: var(--color-accent);
}

.about-section {
  margin-bottom: var(--space-5);
}

.about-section h3 {
  font-family: var(--font-display);
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.about-section h3 i {
  color: var(--color-accent);
  font-size: var(--font-size-sm);
}

.about-section p {
  font-size: var(--font-size-sm);
  color: var(--color-gray-700);
  line-height: 1.7;
}

.about-section strong {
  color: var(--color-primary);
  font-weight: 600;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-gray-200);
}

.about-stat {
  text-align: center;
  padding: var(--space-3);
  background: var(--color-gray-50);
  border-radius: var(--border-radius-sm);
}

.about-stat-number {
  display: block;
  font-family: var(--font-display);
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
}

.about-stat-label {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--color-gray-500);
  margin-top: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* ============================================
   Main Content
   ============================================ */
.main {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* ============================================
   Locate Button
   ============================================ */
.locate-btn {
  position: absolute;
  bottom: var(--space-4);
  right: var(--space-4);
  z-index: 500;
  width: var(--button-size);
  height: var(--button-size);
  border: none;
  border-radius: var(--border-radius-sm);
  background: var(--color-white);
  color: var(--color-gray-700);
  font-size: var(--font-size-xl);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.locate-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.locate-btn:active {
  transform: translateY(0);
}

.locate-btn.active {
  background: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 4px 12px rgba(114, 47, 55, 0.35);
}

.locate-btn.active:hover {
  background: var(--color-primary-dark);
}

/* ============================================
   Station Panel
   ============================================ */
.station-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 600;
  background: var(--color-white);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  box-shadow: 0 -4px 24px rgba(28, 25, 23, 0.12);
  transform: translateY(100%);
  transition: transform var(--transition-slow);
  max-height: var(--panel-max-height);
  display: flex;
  flex-direction: column;
  padding-bottom: var(--safe-area-bottom);
}

.station-panel.visible {
  transform: translateY(0);
}

.station-panel.collapsed {
  transform: translateY(calc(100% - 60px));
}

/* Panel Header */
.panel-header {
  display: flex;
  align-items: center;
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-gray-200);
  cursor: grab;
  flex-shrink: 0;
  position: relative;
}

.panel-header::before {
  content: '';
  position: absolute;
  top: var(--space-2);
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  background: var(--color-gray-300);
  border-radius: var(--border-radius-full);
}

.panel-toggle {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--border-radius-sm);
  background: var(--color-gray-100);
  color: var(--color-gray-500);
  font-size: var(--font-size-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.panel-toggle:hover {
  background: var(--color-gray-200);
  color: var(--color-gray-700);
}

.panel-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-primary);
  margin: 0 var(--space-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--border-radius-sm);
  background: var(--color-gray-100);
  color: var(--color-gray-500);
  font-size: var(--font-size-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.panel-close:hover {
  background: var(--color-gray-200);
  color: var(--color-primary);
}

/* Panel Content */
.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
  -webkit-overflow-scrolling: touch;
}

/* Station Description */
.station-description {
  font-size: var(--font-size-sm);
  color: var(--color-gray-700);
  line-height: 1.7;
  padding: var(--space-3) var(--space-4);
  background: var(--color-wine-cream);
  border-left: 3px solid var(--color-accent);
  border-radius: 0 var(--border-radius-xs) var(--border-radius-xs) 0;
  margin-bottom: var(--space-5);
}

/* Offerings Section */
.offerings-header {
  font-family: var(--font-display);
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-gray-900);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.offerings-header::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 16px;
  background: var(--color-primary);
  border-radius: 2px;
}

.offerings-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Offering Card */
.offering-card {
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--border-radius-sm);
  padding: var(--space-3) var(--space-4);
  transition: all var(--transition-fast);
}

.offering-card:hover {
  border-color: var(--color-accent-light);
  box-shadow: var(--shadow-sm);
  background: var(--color-gray-50);
}

.offering-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.offering-name {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-gray-900);
  margin: 0;
  flex: 1;
}

.offering-price {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
  background: var(--color-wine-cream);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--border-radius-xs);
}

.offering-description {
  font-size: var(--font-size-xs);
  color: var(--color-gray-500);
  margin: 0;
  line-height: 1.5;
}

/* ============================================
   User Location Marker
   ============================================ */
.user-marker {
  background: transparent !important;
  border: none !important;
}

.user-marker-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  background: var(--color-blue);
  border: 3px solid var(--color-white);
  border-radius: var(--border-radius-full);
  box-shadow: var(--shadow-md);
}

.user-marker-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  background: var(--color-blue);
  border-radius: var(--border-radius-full);
  opacity: 0.4;
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0.6;
  }
  100% {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
  }
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast {
  position: fixed;
  bottom: calc(var(--space-8) + var(--safe-area-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 1000;
  background: var(--color-gray-900);
  color: var(--color-white);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-sm);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: all var(--transition-slow);
  max-width: calc(100vw - var(--space-8));
  text-align: center;
}

.toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ============================================
   Footer
   ============================================ */
.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--footer-height);
  padding: 0 var(--space-4);
  padding-bottom: var(--safe-area-bottom);
  background: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--font-size-xs);
  flex-shrink: 0;
}

.footer a {
  color: var(--color-accent-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer a:hover {
  color: var(--color-white);
}

/* ============================================
   Leaflet Overrides
   ============================================ */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: var(--shadow-md) !important;
  border-radius: var(--border-radius-sm) !important;
  overflow: hidden;
}

.leaflet-control-zoom a {
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  font-size: 18px !important;
  border: none !important;
  color: var(--color-gray-700) !important;
}

.leaflet-control-zoom a:hover {
  background: var(--color-gray-100) !important;
  color: var(--color-primary) !important;
}

.leaflet-control-attribution {
  font-size: 10px !important;
  background: rgba(255, 255, 255, 0.9) !important;
  padding: 2px 8px !important;
  border-radius: var(--border-radius-xs) 0 0 0 !important;
}

.leaflet-tooltip {
  background: var(--color-white) !important;
  border: none !important;
  box-shadow: var(--shadow-md) !important;
  padding: var(--space-2) var(--space-3) !important;
  font-family: var(--font-family) !important;
  font-size: var(--font-size-sm) !important;
  font-weight: 500 !important;
  border-radius: var(--border-radius-xs) !important;
  color: var(--color-gray-900) !important;
}

.leaflet-tooltip-top:before {
  border-top-color: var(--color-white) !important;
}

/* Custom station marker */
.station-marker-icon {
  background: none !important;
  border: none !important;
}

.station-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.station-marker-pin {
  width: 32px;
  height: 32px;
  background: var(--color-primary);
  border: 3px solid var(--color-white);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 2px 8px rgba(114, 47, 55, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.station-marker-pin i {
  transform: rotate(45deg);
  color: var(--color-white);
  font-size: 12px;
}

.station-marker:hover .station-marker-pin {
  box-shadow: 0 4px 12px rgba(114, 47, 55, 0.5);
}

.station-marker-number {
  margin-top: 2px;
  background: var(--color-white);
  color: var(--color-primary);
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: var(--border-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  font-family: var(--font-family);
}

/* ============================================
   Responsive - Tablets
   ============================================ */
@media (min-width: 640px) {
  :root {
    --header-height: 64px;
    --button-size: 48px;
    --panel-max-height: 50vh;
  }

  .header {
    gap: var(--space-4);
  }

  .header-title {
    font-size: var(--font-size-2xl);
  }

  .header-subtitle {
    font-size: var(--font-size-sm);
  }

  .station-panel {
    left: var(--space-4);
    right: auto;
    width: 380px;
    bottom: var(--space-4);
    border-radius: var(--border-radius);
    max-height: calc(100vh - var(--header-height) - var(--footer-height) - var(--space-8));
  }

  .station-panel.collapsed {
    transform: translateY(calc(100% - 52px));
  }

  .locate-btn {
    bottom: var(--space-6);
    right: var(--space-6);
  }
}

/* ============================================
   Responsive - Desktop
   ============================================ */
@media (min-width: 1024px) {
  :root {
    --header-height: 72px;
  }

  .header {
    padding: 0 var(--space-8);
  }

  .header-logo {
    width: 44px;
    height: 44px;
  }

  .header-title {
    font-size: var(--font-size-3xl);
  }

  .header-btn {
    width: 42px;
    height: 42px;
    font-size: var(--font-size-xl);
  }

  .station-panel {
    width: 420px;
  }

  .modal {
    max-width: 560px;
  }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  .locate-btn,
  .station-panel,
  .footer,
  .header-btn,
  .modal-overlay {
    display: none;
  }

  .main {
    height: auto;
  }
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
