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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fafafa;
}

.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
  z-index: 10;
  padding: 18px 28px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  backdrop-filter: blur(10px);
}

.header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  white-space: nowrap;
  margin: 0;
}

.header input[type="date"] {
  padding: 10px 16px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.95);
  color: #2d3748;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.header input[type="date"]:hover {
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.header input[type="date"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.route-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.route-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
}

.route-toggle input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: white;
}

.itinerary-toggle {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  font-weight: 500;
  display: none;
  transition: all 0.2s ease;
}

.itinerary-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
}

.header button#authButton {
  padding: 10px 20px;
  background: white;
  color: #667eea;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header button#authButton:hover {
  background: #f7fafc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.header button#authButton:active {
  transform: translateY(0);
}

#status {
  margin-left: auto;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0.95;
}

.main-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.itinerary-panel {
  width: 420px;
  background: white;
  border-right: 1px solid #e2e8f0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.itinerary-panel::-webkit-scrollbar {
  width: 8px;
}

.itinerary-panel::-webkit-scrollbar-track {
  background: transparent;
}

.itinerary-panel::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 4px;
}

.itinerary-panel::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

.itinerary-header {
  padding: 28px 24px;
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
  border-bottom: 1px solid #e2e8f0;
}

.itinerary-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.itinerary-header p {
  font-size: 14px;
  color: #718096;
  font-weight: 500;
}

.itinerary-content {
  padding: 20px;
}

.itinerary-item {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.itinerary-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.itinerary-item:hover,
.itinerary-item.highlighted {
  border-color: rgba(234, 67, 53, 0.4);
  box-shadow: 0 2px 8px rgba(234, 67, 53, 0.1);
}

.itinerary-item:hover::before,
.itinerary-item.highlighted::before {
  background: #ea4335;
  opacity: 1;
}

.itinerary-item-header {
  display: flex;
  align-items: start;
  gap: 14px;
  margin-bottom: 10px;
}

.pin-number {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.event-info {
  flex: 1;
  min-width: 0;
}

.event-title {
  font-weight: 700;
  font-size: 16px;
  color: #1a202c;
  margin-bottom: 6px;
  word-wrap: break-word;
  letter-spacing: -0.2px;
  line-height: 1.4;
}

.event-time {
  font-size: 13px;
  color: #718096;
  margin-bottom: 8px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.event-time::before {
  content: "🕐";
  font-size: 14px;
}

.event-address {
  font-size: 13px;
  color: #718096;
  display: flex;
  align-items: start;
  gap: 6px;
  line-height: 1.5;
  font-weight: 500;
}

.event-address::before {
  content: "📍";
  flex-shrink: 0;
  font-size: 14px;
}

.travel-time {
  background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
  border-left: 3px solid #667eea;
  padding: 12px 16px;
  margin: 10px 0 14px 18px;
  border-radius: 12px;
  font-size: 13px;
  color: #4c51bf;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.travel-time:hover {
  background: linear-gradient(135deg, #e8f0fe 0%, #dce7fd 100%);
  border-left-color: #5a67d8;
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.travel-time::before {
  content: "🚗 ";
  font-size: 14px;
}

.no-events {
  text-align: center;
  padding: 60px 20px;
  color: #718096;
  font-size: 15px;
  font-weight: 500;
}

#map {
  flex: 1;
  width: 100%;
  background: #f7fafc;
}

.duration-label {
  background: white;
  padding: 6px 12px;
  border-radius: 10px;
  border: 2px solid #667eea;
  font-weight: 700;
  font-size: 12px;
  color: #667eea;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

.duration-label.highlighted {
  border-color: #ea4335;
  color: #ea4335;
}

.event-label {
  background: white;
  padding: 8px 14px;
  border-radius: 12px;
  border: 2px solid #48bb78;
  font-size: 13px;
  color: #1a202c;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(72, 187, 120, 0.2);
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  position: absolute;
  pointer-events: auto;
  z-index: 10;
  cursor: pointer;
  transition: all 0.2s ease;
}

.event-label:hover,
.event-label.highlighted {
  border-color: #ea4335;
  color: #ea4335;
  box-shadow: 0 6px 20px rgba(234, 67, 53, 0.3);
  transform: scale(1.05);
}

.event-label-time {
  color: #718096;
  font-size: 11px;
  font-weight: 600;
  display: block;
  margin-top: 3px;
}

.custom-marker {
  background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 4px 16px rgba(245, 101, 101, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
}

.custom-marker:hover {
  transform: rotate(-45deg) scale(1.1);
  box-shadow: 0 6px 20px rgba(245, 101, 101, 0.5);
}

.custom-marker span {
  transform: rotate(45deg);
  display: block;
}

/* Mobile styles */
@media (max-width: 768px) {
  .header {
    padding: 12px 16px;
    gap: 10px;
    position: relative;
    z-index: 1000;
    flex-wrap: wrap;
  }

  .header h1 {
    font-size: 18px;
    width: 100%;
    text-align: center;
  }

  .itinerary-toggle {
    display: inline-block;
    padding: 8px 12px;
    font-size: 18px;
  }

  .header input[type="date"] {
    padding: 8px 12px;
    font-size: 13px;
  }

  .route-toggle {
    font-size: 13px;
    gap: 6px;
    padding: 6px 10px;
  }

  .route-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
  }

  .header button#authButton {
    padding: 8px 14px;
    font-size: 13px;
  }

  #status {
    display: none;
  }

  .main-container {
    position: relative;
  }

  .itinerary-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
  }

  .itinerary-panel.open {
    transform: translateX(0);
  }

  .itinerary-header {
    padding: 20px 16px;
  }

  .itinerary-content {
    padding: 16px;
  }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .itinerary-panel {
    width: 360px;
  }

  .header {
    padding: 16px 20px;
    gap: 12px;
  }
}

/* Paywall styles */
.paywall-container {
  padding: 40px 20px;
  text-align: center;
}

.paywall-title {
  color: #202124;
  margin-bottom: 16px;
  font-size: 20px;
  font-weight: 700;
}

.paywall-message {
  color: #5f6368;
  margin-bottom: 24px;
  font-size: 15px;
  line-height: 1.6;
}

.paywall-button {
  display: inline-block;
  background: #1a73e8;
  color: white;
  padding: 12px 24px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s ease;
}

.paywall-button:hover {
  background: #1557b0;
}

/* Status indicators */
.status-warning {
  color: #f9ab00 !important;
}

.status-critical {
  color: #ea4335 !important;
}

/* Info window styles */
.info-window {
  max-width: 300px;
}

.info-window-title {
  font-size: 16px;
  display: block;
  margin-bottom: 8px;
}

.info-window-details {
  margin: 8px 0;
  color: #5f6368;
  font-size: 14px;
  line-height: 1.6;
}

/* Positioned overlays */
.positioned {
  position: absolute;
}

.positioned-center {
  position: absolute;
  transform: translate(-50%, -50%);
}

/* Labels */
.label-container {
  position: absolute;
  pointer-events: none;
}

.label-line {
  position: absolute;
  height: 2px;
  background: rgba(72, 187, 120, 0.5);
  transform-origin: 0 0;
  pointer-events: none;
  transition: all 0.2s ease;
}

.label-line.highlighted {
  background: rgba(234, 67, 53, 0.8);
  height: 3px;
}
