:root {
  --coral: #FF6B6B;
  --coral-light: #FF8E8E;
  --deep-purple: #4A4E69;
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Space Grotesk', system-ui, sans-serif;
}

body {
  overflow: hidden;
  touch-action: manipulation;
}

.app-container {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.map-container {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.map-tiles {
  filter: sepia(8%) saturate(95%) brightness(102%);
}

.floating-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px 16px;
  text-align: center;
  border-bottom: 1px solid var(--glass-border);
}

.header-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: -0.02em;
}

.header-subtitle {
  font-size: 0.75rem;
  color: #666;
  margin-top: 2px;
}

.location-badge {
  position: absolute;
  top: 72px;
  left: 12px;
  z-index: 1000;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 8px 14px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--glass-border);
}

.location-badge:hover {
  transform: scale(1.02);
}

.location-badge.searching .pulse {
  animation: pulse 1.5s ease-in-out infinite;
}

.location-badge.found {
  color: #10b981;
}

.location-badge.error {
  color: #ef4444;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.map-controls {
  position: absolute;
  top: 72px;
  right: 12px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border: 1px solid var(--glass-border);
}

.control-btn:hover, .control-btn.active {
  background: white;
  transform: scale(1.05);
}

.history-panel {
  position: absolute;
  top: 72px;
  right: 64px;
  z-index: 1001;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  padding: 12px;
  min-width: 200px;
  max-width: 280px;
  animation: slideIn 0.2s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.panel-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
}

.panel-header button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: #999;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 0.85rem;
  text-align: left;
  transition: background 0.2s;
}

.history-item:hover {
  background: #eee;
}

.empty-text {
  color: #999;
  font-size: 0.85rem;
  text-align: center;
  padding: 12px;
}

.filter-pills {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  gap: 8px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 6px;
  border-radius: 24px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.1);
  border: 1px solid var(--glass-border);
}

.filter-pill {
  padding: 8px 14px;
  border-radius: 18px;
  border: none;
  background: transparent;
  color: #666;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filter-pill.active {
  background: linear-gradient(135deg, var(--coral), var(--coral-light));
  color: white;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
}

.filter-pill:not(.active):hover {
  background: rgba(0,0,0,0.05);
}

.fab {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: auto;
  min-width: 160px;
  height: 56px;
  border-radius: 28px;
  border: none;
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-light) 100%);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(255, 107, 107, 0.5);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 0 24px;
  overflow: hidden;
}

.fab::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.2) 50%, transparent 60%);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}

.fab:hover:not(:disabled) {
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 8px 32px rgba(255, 107, 107, 0.6);
}

.fab:active:not(:disabled) {
  transform: translateX(-50%) scale(0.95);
}

.fab:disabled {
  cursor: not-allowed;
}

.fab.spinning {
  width: 200px;
  animation: pulse-glow 0.5s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
  0% { box-shadow: 0 6px 24px rgba(255, 107, 107, 0.5); }
  100% { box-shadow: 0 10px 40px rgba(255, 107, 107, 0.7); }
}

.fab-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.dice-icon {
  font-size: 1.4rem;
}

.dice-spin {
  font-size: 1.4rem;
  animation: dice-roll 0.3s ease-in-out infinite;
}

@keyframes dice-roll {
  0%, 100% { transform: rotate(-15deg) scale(1); }
  50% { transform: rotate(15deg) scale(1.1); }
}

.loading-text {
  font-size: 0.75rem;
  font-weight: 500;
  max-width: 140px;
  text-align: center;
}

.easter-egg {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  background: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: #666;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-5px); }
}

.bottom-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1002;
  background: white;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -4px 32px rgba(0,0,0,0.15);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 60vh;
  overflow-y: auto;
}

.bottom-sheet.hidden {
  transform: translateY(100%);
}

.bottom-sheet.half {
  transform: translateY(0);
}

.bottom-sheet.full {
  max-height: 80vh;
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  margin: 12px auto;
  cursor: grab;
}

.sheet-content {
  padding: 0 20px 24px;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.spot-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 4px;
}

.spot-cuisine {
  font-size: 0.9rem;
  color: #666;
}

.fav-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.fav-btn:hover {
  transform: scale(1.2);
}

.spot-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: #555;
  flex-wrap: wrap;
}

.meta-divider {
  color: #ccc;
}

.spot-address {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 16px;
}

.sheet-actions {
  display: flex;
  gap: 12px;
}

.action-btn {
  flex: 1;
  padding: 14px 16px;
  border-radius: 14px;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s ease;
}

.action-btn.primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.action-btn.primary:hover {
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.action-btn.secondary {
  background: #f3f4f6;
  color: #374151;
}

.action-btn.secondary:hover {
  background: #e5e7eb;
}

.close-sheet {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f3f4f6;
  cursor: pointer;
  font-size: 1rem;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
}

.attribution {
  position: absolute;
  bottom: 8px;
  left: 8px;
  z-index: 999;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 0.7rem;
  color: #666;
  border: 1px solid var(--glass-border);
}

.attribution a {
  color: var(--coral);
  text-decoration: none;
  font-weight: 600;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 2000;
  background: rgba(255,255,255,0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #eee;
  border-top-color: var(--coral);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Custom markers */
.user-marker {
  background: none;
  border: none;
}

.user-dot {
  width: 16px;
  height: 16px;
  background: #3b82f6;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.5);
  position: relative;
}

.user-pulse {
  position: absolute;
  inset: -8px;
  border: 2px solid #3b82f6;
  border-radius: 50%;
  animation: user-pulse 2s ease-out infinite;
}

@keyframes user-pulse {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

.place-marker {
  background: none;
  border: none;
}

.marker-icon {
  width: 36px;
  height: 36px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  border: 2px solid var(--coral);
  transition: all 0.2s ease;
}

.marker-icon.marker-selected {
  width: 48px;
  height: 48px;
  font-size: 1.5rem;
  border-color: #10b981;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
  animation: marker-land 0.3s ease;
}

.marker-bounce {
  animation: marker-drop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes marker-drop {
  0% { transform: translateY(-30px); opacity: 0; }
  60% { transform: translateY(5px); }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes marker-land {
  0% { transform: scale(1.3); }
  50% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* Confetti */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.confetti-particle {
  position: absolute;
  top: -10px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Responsive adjustments */
@media (min-width: 768px) {
  .bottom-sheet {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    max-width: 400px;
    border-radius: 24px;
    bottom: 20px;
  }
  
  .bottom-sheet.half {
    transform: translateX(-50%) translateY(0);
  }
  
  .bottom-sheet.hidden {
    transform: translateX(-50%) translateY(calc(100% + 40px));
  }
  
  .filter-pills {
    bottom: 140px;
  }
  
  .fab {
    bottom: 40px;
  }
}

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}