/* ===================================
   DIGITAL TIME CAPSULE MAP - STYLES
   =================================== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* ===================================
   CSS VARIABLES - DESIGN SYSTEM
   =================================== */
/* Intro Animation Overlay */
.intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    overflow: hidden;
    transition: opacity 0.8s ease;
}

.tear-container {
    position: relative;
    width: 90%;
    max-width: 700px;
    height: auto;
    perspective: 1000px;
}

.tear-image {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 20px 80px rgba(255, 255, 255, 0.5)) brightness(1.2);
    animation: dramaticPulse 2s ease-in-out infinite;
    transform-origin: center;
}

@keyframes dramaticPulse {
    0%, 100% { 
        transform: scale(1) rotateZ(0deg);
        filter: drop-shadow(0 20px 80px rgba(255, 255, 255, 0.5)) brightness(1.2);
    }
    50% { 
        transform: scale(1.08) rotateZ(2deg);
        filter: drop-shadow(0 30px 100px rgba(255, 255, 255, 0.7)) brightness(1.3);
    }
}

.tear-image.tear-active {
    animation: epicShatter 3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes epicShatter {
    0% {
        transform: scale(1) rotate(0deg) translateZ(0);
        opacity: 1;
        filter: drop-shadow(0 20px 80px rgba(255, 255, 255, 0.5)) brightness(1.2) blur(0px);
    }
    15% {
        transform: scale(1.15) rotate(5deg) translateZ(50px);
        filter: drop-shadow(0 40px 120px rgba(255, 255, 255, 0.8)) brightness(1.5) blur(0px);
    }
    30% {
        transform: scale(1.2) rotate(-3deg) translateZ(80px);
        filter: drop-shadow(0 50px 150px rgba(255, 255, 255, 0.9)) brightness(1.6) blur(1px);
    }
    50% {
        transform: scale(0.8) rotate(15deg) translateZ(100px);
        opacity: 0.9;
        filter: drop-shadow(0 60px 180px rgba(255, 255, 255, 1)) brightness(1.8) blur(3px);
    }
    70% {
        transform: scale(0.4) rotate(180deg) translateY(-50vh) translateZ(200px);
        opacity: 0.6;
        filter: drop-shadow(0 80px 200px rgba(255, 255, 255, 0.6)) brightness(2) blur(8px);
    }
    100% {
        transform: scale(0.1) rotate(720deg) translateY(-200vh) translateZ(500px);
        opacity: 0;
        filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0)) brightness(3) blur(20px);
    }
}

/* Particle explosion effect */
.intro-overlay::before,
.intro-overlay::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    opacity: 0;
    pointer-events: none;
}

.intro-overlay.exploding::before {
    animation: particleExplosion1 2s ease-out forwards;
}

.intro-overlay.exploding::after {
    animation: particleExplosion2 2s ease-out 0.1s forwards;
}

@keyframes particleExplosion1 {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(8);
        opacity: 0;
    }
}

@keyframes particleExplosion2 {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(10) rotate(180deg);
        opacity: 0;
    }
}

.landing-page {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.landing-page.visible {
    opacity: 1;
    transform: scale(1);
}

/* Existing styles */
:root {
  /* Colors - Black & White Theme */
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-tertiary: #1a1a1a;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #ffffff 0%, #cccccc 100%);
  --gradient-secondary: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
  --gradient-accent: linear-gradient(135deg, #333333 0%, #000000 100%);
  
  /* Accent Colors - Minimal */
  --color-accent: #ffffff;
  --color-accent-hover: #e0e0e0;
  --color-border: #333333;
  
  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --text-muted: #888888;
  
  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6);
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 30px;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  /* Typography */
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
}

/* ===================================
   GLOBAL RESET & BASE STYLES
   =================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===================================
   TYPOGRAPHY
   =================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: 1.25rem; }

p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ===================================
   GLASSMORPHIC COMPONENTS
   =================================== */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  padding: var(--spacing-lg);
  transition: transform var(--transition-normal);
}

.glass-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
}

/* ===================================
   BUTTONS
   =================================== */
.btn {
  padding: 0.875rem 2rem;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
  background: #e0e0e0;
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--glass-bg);
  border-color: var(--text-primary);
}

.btn-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
  border-color: var(--text-primary);
}

/* ===================================
   FORMS
   =================================== */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-label {
  display: block;
  margin-bottom: var(--spacing-xs);
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.9rem;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

/* ===================================
   LANDING PAGE
   =================================== */
.landing-page {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

/* Animated Background */
.landing-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: var(--bg-primary);
}

.landing-bg::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
  top: -250px;
  right: -250px;
  animation: float 20s ease-in-out infinite;
}

.landing-bg::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
  bottom: -200px;
  left: -200px;
  animation: float 15s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(50px, 50px); }
}

/* Navigation */
.navbar {
  padding: var(--spacing-md) var(--spacing-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 100;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
}

.nav-buttons {
  display: flex;
  gap: var(--spacing-sm);
}

/* Hero Section */
.hero {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-md);
  max-width: 900px;
  margin: 0 auto;
  margin-top: 5vh;
}

.hero h1 {
  margin-bottom: var(--spacing-md);
  color: #ffffff;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: var(--spacing-xl);
  color: var(--text-secondary);
}

.hero-buttons {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* Features Section */
.features {
  padding: var(--spacing-xl) var(--spacing-md);
  max-width: 1200px;
  margin: 0 auto;
}

.features h2 {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-lg);
}

.feature-card {
  text-align: center;
  padding: var(--spacing-lg);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: var(--spacing-md);
  display: inline-block;
  animation: bounce 2s ease-in-out infinite;
}

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

.feature-card h3 {
  margin-bottom: var(--spacing-sm);
}

/* Removed category pills - no longer using categories */

/* ===================================
   MODAL
   =================================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: fadeIn var(--transition-normal);
}

.modal.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  max-width: 450px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp var(--transition-normal);
}

@keyframes slideUp {
  from { transform: translateY(50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal h2 {
  margin-bottom: var(--spacing-lg);
  font-size: 1.75rem;
}

.modal-footer {
  margin-top: var(--spacing-lg);
  text-align: center;
}

.modal-footer a {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
}

.modal-footer a:hover {
  text-decoration: underline;
}

/* ===================================
   MAP PAGE
   =================================== */
.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 350px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 500;
}

.sidebar-header {
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-content {
  padding: var(--spacing-md);
  flex: 1;
}

.filter-section {
  margin-bottom: var(--spacing-lg);
}

.filter-section h3 {
  font-size: 1rem;
  margin-bottom: var(--spacing-sm);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.category-filters {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.filter-btn {
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.filter-btn:hover {
  background: var(--glass-bg);
  transform: translateX(5px);
  border-color: var(--text-primary);
}

.filter-btn.active {
  border-color: var(--text-primary);
  background: var(--glass-bg);
}

/* History Sidebar */
.history-sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: var(--bg-primary);
  border-left: 1px solid var(--glass-border);
  z-index: 1001;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
}

.history-sidebar.active {
  right: 0;
}

.history-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-secondary);
}

.history-header h3 {
  margin: 0;
  font-size: 1.3rem;
  color: var(--text-primary);
}

.history-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-md);
}

.history-item {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--text-primary);
  transform: translateX(-4px);
}

.history-item-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--spacing-xs);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.history-item-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
}

.history-item-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xs);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
}

.history-item-location {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.history-empty {
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--text-muted);
}

/* Map Container */
.map-container {
  flex: 1;
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
}

/* Map Controls */
.map-controls {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  z-index: 400;
}

/* Memory Card in Popup */
.memory-popup {
  min-width: 250px;
}

.memory-popup h4 {
  margin-bottom: var(--spacing-xs);
  color: var(--text-primary);
}

.memory-popup p {
  margin-bottom: var(--spacing-xs);
  font-size: 0.9rem;
}

.memory-popup .badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: var(--spacing-xs);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.memory-popup .username {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: var(--spacing-xs);
}

/* ===================================
   IMAGE GALLERY STYLES
   =================================== */

/* Image Preview Grid (in form) */
.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--spacing-sm);
  margin-top: var(--spacing-sm);
}

.image-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--glass-border);
  background: var(--bg-tertiary);
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.image-preview-remove:hover {
  background: #f5576c;
  transform: scale(1.1);
}

/* Image Gallery (in popup) */
.memory-image-gallery {
  margin: var(--spacing-md) 0;
}

.gallery-main-image {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-sm);
  cursor: pointer;
  transition: transform 0.2s;
}

.gallery-main-image:hover {
  transform: scale(1.02);
}

.gallery-thumbnails {
  display: flex;
  gap: var(--spacing-xs);
  overflow-x: auto;
  padding: var(--spacing-xs) 0;
}

.gallery-thumbnail {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  flex-shrink: 0;
}

.gallery-thumbnail:hover {
  border-color: var(--text-primary);
}

.gallery-thumbnail.active {
  border-color: var(--text-primary);
  opacity: 1;
}

/* Gallery Navigation */
.gallery-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--spacing-sm);
}

.gallery-nav-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.gallery-nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.gallery-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Delete Memory Button */
.delete-memory-btn {
  background: rgba(245, 87, 108, 0.1);
  border: 1px solid #f5576c;
  color: #f5576c;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
  margin-top: var(--spacing-sm);
  width: 100%;
}

.delete-memory-btn:hover {
  background: rgba(245, 87, 108, 0.2);
  transform: translateY(-2px);
}

/* ===================================
   UTILITY CLASSES
   =================================== */
.text-center { text-align: center; }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.hidden { display: none !important; }

/* Error Messages */
.error-message {
  background: rgba(245, 87, 108, 0.1);
  border: 1px solid #f5576c;
  color: #f5576c;
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  margin-bottom: var(--spacing-md);
  font-size: 0.9rem;
}

.success-message {
  background: rgba(67, 233, 123, 0.1);
  border: 1px solid #43e97b;
  color: #43e97b;
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  margin-bottom: var(--spacing-md);
  font-size: 0.9rem;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

/* Tablet and below */
@media (max-width: 1024px) {
  .sidebar {
    width: 300px;
  }
  
  .history-sidebar {
    width: 350px;
    right: -350px;
  }
}

/* Mobile devices */
@media (max-width: 768px) {
  /* Sidebar - Hidden by default, slides in from left */
  .sidebar {
    position: fixed;
    left: -100%;
    width: 85%;
    max-width: 320px;
    transition: left var(--transition-normal);
    height: 100vh;
    z-index: 1000;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
  }
  
  .sidebar.active {
    left: 0;
  }
  
  /* History sidebar - Full width on mobile */
  .history-sidebar {
    width: 90%;
    max-width: 350px;
    right: -100%;
  }
  
  .history-sidebar.active {
    right: 0;
  }
  
  /* Map controls - Larger touch targets */
  .map-controls {
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    gap: var(--spacing-xs);
  }
  
  .btn-icon {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }
  
  /* Landing page */
  .hero {
    padding: var(--spacing-lg) var(--spacing-md);
    margin-top: 2vh;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .hero-buttons {
    flex-direction: column;
    width: 100%;
  }
  
  .hero-buttons .btn {
    width: 100%;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
  
  .navbar {
    padding: var(--spacing-sm) var(--spacing-md);
  }
  
  .nav-buttons {
    gap: var(--spacing-xs);
  }
  
  .nav-buttons .btn {
    padding: 0.625rem 1rem;
    font-size: 0.9rem;
  }
  
  /* Modal - Full screen on mobile */
  .modal-content {
    width: 95%;
    max-width: none;
    padding: var(--spacing-lg);
    max-height: 85vh;
  }
  
  .modal h2 {
    font-size: 1.5rem;
  }
  
  /* Forms - Larger touch targets */
  .form-input,
  .form-textarea,
  .form-select {
    padding: 1rem;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .btn {
    padding: 1rem 1.5rem;
    font-size: 1rem;
  }
  
  /* History items - More padding for touch */
  .history-item {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
  }
  
  .history-item-title {
    font-size: 1rem;
  }
  
  .history-item-description {
    font-size: 0.85rem;
  }
  
  /* Sidebar content - Better spacing */
  .sidebar-content {
    padding: var(--spacing-sm);
  }
  
  .filter-section {
    margin-bottom: var(--spacing-md);
  }
  
  .filter-btn {
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .sidebar {
    width: 90%;
  }
  
  .history-sidebar {
    width: 95%;
  }
  
  .btn-icon {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
  
  .modal-content {
    width: 98%;
    padding: var(--spacing-md);
  }
  
  .hero h1 {
    font-size: 1.75rem;
  }
  
  .logo {
    font-size: 1.2rem;
  }
  
  .nav-buttons .btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.85rem;
  }
}

/* Landscape mode on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .sidebar {
    width: 60%;
    max-width: 280px;
  }
  
  .history-sidebar {
    width: 70%;
    max-width: 320px;
  }
  
  .modal-content {
    max-height: 90vh;
    width: 90%;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Larger tap targets for touch devices */
  .btn-icon {
    min-width: 44px;
    min-height: 44px;
  }
  
  .filter-btn {
    min-height: 44px;
  }
  
  .history-item {
    min-height: 80px;
  }
  
  /* Remove hover effects on touch devices */
  .btn-icon:hover {
    transform: none;
  }
  
  .filter-btn:hover {
    transform: none;
  }
  
  .history-item:hover {
    transform: none;
  }
  
  /* Active states for touch feedback */
  .btn-icon:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.15);
  }
  
  .filter-btn:active {
    background: rgba(255, 255, 255, 0.1);
  }
  
  .history-item:active {
    background: rgba(255, 255, 255, 0.1);
  }
}

/* ===================================
   LEAFLET MAP CUSTOMIZATION
   =================================== */
.leaflet-popup-content-wrapper {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

.leaflet-popup-tip {
  background: var(--bg-secondary);
}

.leaflet-container {
  background: var(--bg-primary);
}

/* Custom Marker Styles */
.custom-marker {
  background: none;
  border: none;
}

.marker-pin {
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: markerDrop 0.5s ease;
  background: #ffffff;
  border: 2px solid #000000;
}

@keyframes markerDrop {
  0% { transform: translateY(-200px) rotate(-45deg); opacity: 0; }
  60% { transform: translateY(10px) rotate(-45deg); }
  100% { transform: translateY(0) rotate(-45deg); opacity: 1; }
}

/* GPS Marker with Pulsing Animation */
.gps-marker {
  background: none;
  border: none;
}

.gps-pulse {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #000000;
  position: relative;
  animation: pulse 2s ease-in-out infinite;
}

.gps-pulse::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  animation: ripple 2s ease-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

@keyframes ripple {
  0% {
    width: 100%;
    height: 100%;
    opacity: 0.6;
  }
  100% {
    width: 300%;
    height: 300%;
    opacity: 0;
  }
}


/* Loading Spinner */
.spinner {
  border: 3px solid var(--glass-border);
  border-top: 3px solid #667eea;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
