:root {
  /* Futuristic Dark Theme (Default) */
  --bg: #030305;
  --bg-secondary: #0a0a12;
  --fg: #e0e6ed;
  --fg-soft: #94a3b8;
  --line: rgba(0, 243, 255, 0.2); /* Cyan tint */
  --card-bg: rgba(10, 10, 16, 0.65);
  
  /* Neon Palette */
  --primary: #00f3ff;       /* Cyber Cyan */
  --primary-light: #bc13fe; /* Cyber Purple */
  --primary-glow: rgba(0, 243, 255, 0.5);
  
  --success: #0aff0a;       /* Matrix Green */
  --warning: #f0ff00;       /* Cyber Yellow */
  --error: #ff003c;         /* Cyber Red */
  
  --glass-border: 1px solid rgba(255, 255, 255, 0.1);
  --neon-shadow: 0 0 10px var(--primary-glow), 0 0 20px rgba(0, 243, 255, 0.2);
  
  font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", Consolas, monospace;
}

/* Light theme (Retained but modernized) */
[data-theme="light"] {
  --bg: #f0f2f5;
  --bg-secondary: #ffffff;
  --fg: #1a1a1a;
  --fg-soft: #4a4a4a;
  --line: rgba(0, 0, 0, 0.1);
  --card-bg: rgba(255, 255, 255, 0.8);
  --primary: #00bcd4; /* Cyan for light mode */
  --primary-light: #9c27b0; /* Purple for light mode */
  --primary-glow: rgba(0, 188, 212, 0.3);
  --success: #00c853;
  --warning: #ffab00;
  --error: #d50000;
  --neon-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

body {
  background-color: var(--bg);
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(188, 19, 254, 0.05), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(0, 243, 255, 0.05), transparent 25%);
  color: var(--fg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* Futuristic Grid Background Overlay */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 50px 50px;
  background-position: center top;
  opacity: 0.15;
  z-index: -1;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 80%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 80%);
}

[data-theme="light"] body::before {
  opacity: 0.05;
  -webkit-mask-image: none;
  mask-image: none;
}

.hero {
  padding: 3rem 1.5rem 2rem;
  display: flex;
  justify-content: center;
}

.top-nav {
  width: 100%;
  max-width: 70rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(10, 10, 16, 0.7);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.05);
  margin-bottom: 1rem;
}

[data-theme="light"] .top-nav {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.brand {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--primary);
  text-decoration: none;
  font-family: var(--font-mono);
  text-transform: uppercase;
  text-shadow: 0 0 10px var(--primary-glow);
  transition: all 0.3s ease;
}

[data-theme="light"] .brand {
  color: #00838f;
  text-shadow: none;
}

.brand:hover {
  text-shadow: 0 0 20px var(--primary), 0 0 40px var(--primary);
}

[data-theme="light"] .brand:hover {
  text-shadow: none;
  color: #006064;
}

.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

#dashboard-link,
#admin-link,
#logout-link {
  display: none;
}

/* Theme Toggle Button */
.theme-toggle {
  background: var(--card-bg);
  border: 2px solid var(--line);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.4rem;
  color: var(--fg);
}

[data-theme="light"] .theme-toggle {
  background: #fff;
  border-color: var(--line);
  color: var(--primary);
}

.theme-toggle:hover {
  transform: scale(1.1) rotate(15deg);
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-icon {
  transition: transform 0.3s ease;
  display: inline-block;
}

.theme-toggle:hover .theme-icon {
  transform: rotate(-15deg);
}

.nav-link {
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.3s ease;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

[data-theme="light"] .nav-link {
  color: var(--fg-soft);
}

.nav-link:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(0, 243, 255, 0.05);
  box-shadow: 0 0 15px var(--primary-glow);
  text-shadow: 0 0 5px var(--primary-glow);
}

[data-theme="light"] .nav-link:hover {
  color: #00838f;
  border-color: #00bcd4;
  background: rgba(0, 188, 212, 0.05);
  box-shadow: none;
  text-shadow: none;
}

.logout-btn {
  background: rgba(255, 0, 60, 0.05);
  border: 1px solid var(--error);
  color: var(--error);
}

.logout-btn:hover {
  background: var(--error);
  color: #fff;
  box-shadow: 0 0 20px rgba(255, 0, 60, 0.4);
  text-shadow: none;
}

[data-theme="light"] .logout-btn {
  background: #fff;
  border-color: #ef5350;
  color: #d32f2f;
}

[data-theme="light"] .logout-btn:hover {
  background: #d32f2f;
  color: #fff;
  box-shadow: 0 4px 12px rgba(211, 47, 47, 0.2);
}

[data-theme="light"] .logout-btn {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #dc2626;
  font-weight: 600;
}

.logout-btn:hover {
  background: rgba(255, 99, 132, 0.2);
  border-color: rgba(255, 99, 132, 0.5);
  color: #fff;
}

[data-theme="light"] .logout-btn:hover {
  background: #ef4444;
  color: white;
  border-color: #dc2626;
}

/* Hero Banner Section - Futuristic Overhaul */
.hero-banner {
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--line);
  padding: 6rem 2rem 4rem;
  margin: 0 auto 4rem;
  max-width: 100%;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
}

[data-theme="light"] .hero-banner {
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.1);
}

.hero-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 60%);
  opacity: 0.1;
  animation: rotateBg 20s linear infinite;
  pointer-events: none;
}

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

.hero-content {
  max-width: 80rem;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-family: var(--font-mono);
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 900;
  color: transparent;
  -webkit-text-stroke: 2px var(--fg);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: -0.05em;
  position: relative;
  display: inline-block;
  text-shadow: 0 0 20px var(--primary-glow);
}

[data-theme="light"] .hero-title {
  color: var(--fg);
  -webkit-text-stroke: 0;
  text-shadow: none;
}

.hero-title::after {
  content: attr(data-text); /* Requires JS to set data-text, or just duplicate content in HTML if static */
  position: absolute;
  left: 0;
  top: 0;
  color: var(--primary);
  opacity: 0.7;
  filter: blur(8px);
  z-index: -1;
}

/* Fallback if data-text isn't set */
.hero-title {
  color: var(--fg);
  -webkit-text-stroke: 0;
}

.hero-subtitle {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  color: var(--primary);
  margin-bottom: 3rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-shadow: 0 0 10px var(--primary-glow);
}

[data-theme="light"] .hero-subtitle {
  text-shadow: none;
}

.hero-features {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 4rem;
}

.feature-badge {
  background: rgba(0, 243, 255, 0.05);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  padding: 1rem 2rem;
  border-radius: 4px; /* Cyberpunk sharp edges */
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--primary);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid var(--primary);
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

[data-theme="light"] .feature-badge {
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.feature-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 243, 255, 0.4), transparent);
  transition: 0.5s;
}

.feature-badge:hover {
  background: rgba(0, 243, 255, 0.15);
  transform: translateY(-5px);
  box-shadow: 0 0 30px var(--primary-glow);
  text-shadow: 0 0 8px var(--primary);
}

.feature-badge:hover::before {
  left: 100%;
}

.badge-icon {
  font-size: 1.4rem;
  filter: drop-shadow(0 0 5px var(--primary));
}

.hero-images {
  margin-top: 2rem;
  animation: fadeInUp 0.6s ease-out 0.6s both;
}

.issue-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  max-width: 70rem;
  margin: 0 auto;
}

.issue-card {
  background: var(--card-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 243, 255, 0.2);
  border-radius: 4px;
  padding: 0;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.05);
}

[data-theme="light"] .issue-card {
  border-color: var(--line);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.issue-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--primary) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.issue-card:hover {
  background: rgba(0, 243, 255, 0.1);
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 0 30px var(--primary-glow), inset 0 0 20px rgba(0, 243, 255, 0.1);
  border-color: var(--primary);
}

[data-theme="light"] .issue-card:hover {
  background: rgba(0, 188, 212, 0.1);
  box-shadow: 0 10px 30px rgba(0, 188, 212, 0.2);
}

.issue-card:hover::before {
  opacity: 0.1;
}

.issue-image-placeholder {
  padding: 1.5rem 1rem 1rem;
  position: relative;
  z-index: 1;
}

.issue-icon-large {
  font-size: 3.5rem;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 0 10px var(--primary));
  transition: transform 0.3s ease;
}

.issue-card:hover .issue-icon-large {
  transform: scale(1.1) rotate(5deg);
  filter: drop-shadow(0 0 20px var(--primary));
}

.issue-description {
  color: rgba(255, 255, 255, 0.9);
  font-family: 'Fira Code', monospace;
  font-size: 0.8rem;
  line-height: 1.4;
  padding: 0 0.5rem;
  min-height: 35px;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 1;
}

[data-theme="light"] .issue-description {
  color: var(--fg-soft);
  text-shadow: none;
}

.issue-label {
  background: rgba(0, 0, 0, 0.6);
  color: var(--primary);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.75rem;
  border-top: 1px solid rgba(0, 243, 255, 0.2);
  position: relative;
  z-index: 1;
  letter-spacing: 1px;
  text-transform: uppercase;
}

[data-theme="light"] .issue-label {
  background: rgba(0, 0, 0, 0.05);
  border-top-color: var(--line);
}

.issue-card:hover .issue-label {
  background: var(--primary);
  color: #000;
  border-top-color: var(--primary);
  box-shadow: 0 -5px 20px var(--primary-glow);
}

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

.hero h1 {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(2.5rem, 7vw, 4rem);
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  text-transform: uppercase;
  text-shadow: 0 0 20px var(--primary-glow);
}

.hero p {
  font-family: 'Fira Code', monospace;
  font-size: 1.2rem;
  color: var(--fg-soft);
  max-width: 48rem;
  margin: 0 auto 2rem;
  border-left: 2px solid var(--primary);
  padding-left: 1rem;
}

main {
  flex: 1;
  padding: 2rem 1.5rem 5rem;
  max-width: 70rem;
  width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.upload-card {
  background: var(--card-bg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--primary);
  border-radius: 8px;
  padding: 2.5rem;
  margin-bottom: 3rem;
  box-shadow: 0 0 40px rgba(0, 243, 255, 0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

[data-theme="light"] .upload-card {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border-color: var(--line);
  background: #ffffff;
}

.upload-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: scanline 3s linear infinite;
}

[data-theme="light"] .upload-card::before {
  opacity: 0.5;
}

@keyframes scanline {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.upload-card:hover {
  box-shadow: 0 0 60px rgba(0, 243, 255, 0.2);
  border-color: var(--secondary);
}

.upload-card h2 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2rem;
  margin-bottom: 0.75rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px var(--primary-glow);
}

[data-theme="light"] .upload-card h2 {
  text-shadow: none;
}

.upload-card h2::before {
  content: '>';
  color: var(--secondary);
  font-weight: bold;
}

.category-note {
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--secondary);
  margin-left: 0.75rem;
  padding: 0.25rem 0.75rem;
  background: rgba(188, 19, 254, 0.1);
  border: 1px solid var(--secondary);
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(188, 19, 254, 0.2);
}

.upload-card p {
  color: var(--fg-soft);
  margin-bottom: 1.5rem;
  font-family: 'Fira Code', monospace;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.file-area {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 2rem;
  border: 2px dashed var(--primary);
  border-radius: 8px;
  background: rgba(0, 243, 255, 0.02);
  color: var(--fg);
  cursor: pointer;
  transition: all 0.3s ease;
}

[data-theme="light"] .file-area {
  background: rgba(0, 0, 0, 0.02);
  border-color: var(--line);
}

.file-area:hover {
  border-color: var(--secondary);
  background: rgba(188, 19, 254, 0.05);
  box-shadow: 0 0 30px rgba(0, 243, 255, 0.15);
  transform: scale(1.01);
}

[data-theme="light"] .file-area:hover {
  border-color: var(--primary);
  background: rgba(0, 188, 212, 0.05);
  box-shadow: 0 0 15px rgba(0, 188, 212, 0.1);
}

.file-area svg {
  flex-shrink: 0;
  filter: drop-shadow(0 0 5px var(--primary));
}

.file-area span {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 1rem;
  font-family: 'JetBrains Mono', monospace;
}

.file-area span em {
  font-style: normal;
  color: var(--secondary);
  font-size: 0.9rem;
}

.file-area input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.file-status {
  color: var(--secondary);
  font-family: 'Fira Code', monospace;
  font-size: 0.95rem;
  text-shadow: 0 0 5px var(--secondary);
}

.file-preview {
  border: 1px solid var(--primary);
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.1);
  margin-bottom: 1.5rem;
  position: relative;
}

.file-preview::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  background-size: 100% 2px, 3px 100%;
  pointer-events: none;
}

.file-preview img {
  width: 100%;
  height: 100%;
  max-height: 350px;
  object-fit: cover;
  display: block;
  filter: contrast(1.2) saturate(1.2);
}

.analysis-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.upload-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.analysis-button {
  padding: 0.85rem 2rem;
  border-radius: 4px;
  border: 1px solid var(--primary);
  background: rgba(0, 243, 255, 0.1);
  color: var(--primary);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
}

.analysis-button--dashed {
  border-style: dashed;
}

.analysis-button:hover:not(:disabled) {
  transform: translateY(-2px);
  background: var(--primary);
  color: #000;
  box-shadow: 0 0 20px var(--primary-glow);
}

.analysis-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  background: rgba(75, 85, 99, 0.2);
  border-color: #4b5563;
  color: #6b7280;
}

.analysis-status {
  margin: 0;
  color: var(--secondary);
  font-family: 'Fira Code', monospace;
  font-size: 0.95rem;
  text-shadow: 0 0 5px var(--secondary);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-field select,
.form-field textarea {
  padding: 0.85rem 1rem;
  border-radius: 4px;
  border: 1px solid var(--primary);
  background: rgba(0, 0, 0, 0.6);
  color: var(--primary);
  font-family: 'Fira Code', monospace;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

[data-theme="light"] .form-field select,
[data-theme="light"] .form-field textarea {
  background: #fff;
  border-color: var(--line);
  color: var(--fg);
}

.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 15px rgba(188, 19, 254, 0.3);
  background: rgba(0, 0, 0, 0.8);
}

[data-theme="light"] .form-field select:focus,
[data-theme="light"] .form-field textarea:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(0, 188, 212, 0.2);
}

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

.label {
  font-size: 0.95rem;
  letter-spacing: 1px;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  text-shadow: 0 0 5px var(--primary-glow);
}

[data-theme="light"] .label {
  text-shadow: none;
}

.label::before {
  content: '>';
  color: var(--secondary);
  font-size: 1.2rem;
  font-weight: bold;
}

.location-actions {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
  border: 1px solid var(--primary);
  border-radius: 4px;
  padding: 1.5rem 1.75rem;
  background: rgba(0, 243, 255, 0.05);
  transition: all 0.3s ease;
  position: relative;
}

[data-theme="light"] .location-actions {
  background: rgba(0, 0, 0, 0.02);
  border-color: var(--line);
}

.location-actions::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 10px;
  height: 10px;
  border-top: 2px solid var(--secondary);
  border-left: 2px solid var(--secondary);
}

.location-actions::after {
  content: '';
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-bottom: 2px solid var(--secondary);
  border-right: 2px solid var(--secondary);
}

.location-actions:hover {
  border-color: var(--secondary);
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.1);
}

[data-theme="light"] .location-actions:hover {
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(0, 188, 212, 0.1);
}

.location-button {
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--primary);
  border-radius: 4px;
  background: rgba(0, 243, 255, 0.1);
  color: var(--primary);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
}

[data-theme="light"] .location-button {
  background: rgba(0, 188, 212, 0.1);
}

.location-button:hover {
  transform: translateY(-2px);
  background: var(--primary);
  color: #000;
  box-shadow: 0 0 20px var(--primary-glow);
}

[data-theme="light"] .location-button:hover {
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 188, 212, 0.3);
}

.location-button:active {
  transform: translateY(0);
}

.location-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
  background: rgba(75, 85, 99, 0.2);
  border-color: #4b5563;
  color: #6b7280;
}

.location-status {
  flex: 1;
  min-width: 200px;
}

.location-status p {
  margin: 0;
  color: var(--secondary);
  font-family: 'Fira Code', monospace;
  font-size: 0.95rem;
  text-shadow: 0 0 5px var(--secondary);
}

.complaint-button {
  align-self: flex-start;
  padding: 1rem 2.5rem;
  border-radius: 4px;
  border: 1px solid var(--secondary);
  background: rgba(188, 19, 254, 0.1);
  color: var(--secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 0.5rem;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  box-shadow: 0 0 15px rgba(188, 19, 254, 0.2);
}

.complaint-button:hover:not(:disabled) {
  transform: translateY(-2px);
  background: var(--secondary);
  color: #fff;
  box-shadow: 0 0 40px rgba(188, 19, 254, 0.6);
}

.complaint-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
  background: rgba(75, 85, 99, 0.2);
  border-color: #4b5563;
  color: #6b7280;
}

.button-hint {
  color: var(--fg-soft);
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.confirmation {
  margin-top: 0.5rem;
  padding: 0.9rem 1.1rem;
  border-radius: 4px;
  background: rgba(0, 255, 0, 0.1);
  color: #0aff0a;
  font-family: 'Fira Code', monospace;
  font-size: 0.95rem;
  border: 1px solid #0aff0a;
  text-shadow: 0 0 5px #0aff0a;
}

.grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.grid article {
  background: var(--card-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--primary);
  border-radius: 4px;
  padding: 2rem;
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.1);
  transition: transform 0.2s ease, border-color 0.2s ease;
  position: relative;
}

[data-theme="light"] .grid article {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: var(--line);
}

.grid article::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.grid article:hover::before {
  transform: scaleX(1);
}

.grid article:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.25);
}

[data-theme="light"] .grid article:hover {
  border-color: var(--primary);
}

.grid h2 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
}

.grid p {
  color: var(--fg-soft);
}

.about {
  margin-top: 4rem;
  text-align: center;
}

.about h2 {
  font-size: 2rem;
  margin-bottom: 1.2rem;
}

.about p {
  color: var(--fg-soft);
  max-width: 40rem;
  margin: 0 auto;
}

/* Impact Section */
.impact-section {
  margin-top: 4rem;
  padding: 3rem 2rem;
  background: var(--card-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  border: 1px solid var(--primary);
  box-shadow: 0 0 30px rgba(0, 243, 255, 0.05);
  position: relative;
  overflow: hidden;
}

[data-theme="light"] .impact-section {
  border-color: var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.impact-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, transparent 48%, var(--primary) 50%, transparent 52%);
  background-size: 20px 20px;
  opacity: 0.05;
  pointer-events: none;
}

.section-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--primary);
  text-transform: uppercase;
  text-shadow: 0 0 10px var(--primary-glow);
}

.section-subtitle {
  text-align: center;
  color: var(--fg-soft);
  font-family: 'Fira Code', monospace;
  font-size: 1.1rem;
  margin-bottom: 3rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: rgba(0, 243, 255, 0.05);
  padding: 2rem;
  border-radius: 4px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--primary);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 30px var(--primary-glow);
  background: rgba(0, 243, 255, 0.1);
}

.stat-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 10px var(--primary));
}

.stat-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 10px var(--primary);
}

[data-theme="light"] .stat-number {
  color: var(--primary);
  text-shadow: none;
}

.stat-label {
  color: var(--primary);
  font-family: 'Fira Code', monospace;
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.success-stories {
  margin-top: 3rem;
}

.stories-title {
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.8rem;
  margin-bottom: 2rem;
  color: var(--secondary);
  text-transform: uppercase;
  text-shadow: 0 0 10px var(--secondary);
}

.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.story-card {
  background: rgba(188, 19, 254, 0.05);
  border: 1px solid var(--secondary);
  border-radius: 4px;
  padding: 1.5rem;
  position: relative;
  transition: all 0.3s ease;
}

.story-card:hover {
  transform: translateY(-3px);
  background: rgba(188, 19, 254, 0.1);
  box-shadow: 0 0 30px rgba(188, 19, 254, 0.3);
}

.story-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--success);
  color: #000;
  padding: 0.25rem 0.75rem;
  border-radius: 2px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  box-shadow: 0 0 10px var(--success);
}

.story-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 0 5px var(--secondary));
}

.story-card h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--secondary);
  text-transform: uppercase;
}

.story-card p {
  color: var(--fg-soft);
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.story-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(188, 19, 254, 0.3);
}

.resolution-time {
  background: rgba(10, 255, 10, 0.1);
  color: var(--success);
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--success);
  border-radius: 2px;
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  text-shadow: 0 0 5px var(--success);
}

footer {
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--fg-soft);
  border-top: 1px solid var(--primary);
  margin-top: 3rem;
  font-family: 'Fira Code', monospace;
  background: rgba(0, 243, 255, 0.02);
}

/* ===== MAP LOCATION PICKER ===== */
.location-button.secondary {
  background: rgba(10, 255, 10, 0.1);
  border-color: var(--success);
  color: var(--success);
  margin-top: 0.5rem;
}

.location-button.secondary:hover {
  background: var(--success);
  color: #000;
  box-shadow: 0 0 30px var(--success);
}

.map-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.map-modal.is-open {
  display: flex;
}

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

.map-modal-content {
  background: var(--card-bg);
  border-radius: 8px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 50px rgba(0, 243, 255, 0.2);
  border: 1px solid var(--primary);
  position: relative;
}

[data-theme="light"] .map-modal-content {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.map-modal-content::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--primary), transparent, var(--secondary));
  z-index: -1;
  border-radius: 10px;
  opacity: 0.5;
}

.map-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--primary);
  background: rgba(0, 243, 255, 0.05);
}

.map-modal-header h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  color: var(--primary);
  margin: 0;
  text-transform: uppercase;
  text-shadow: 0 0 10px var(--primary-glow);
}

.close-map-btn {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  font-size: 1.5rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.close-map-btn:hover {
  background: var(--primary);
  color: #000;
  box-shadow: 0 0 15px var(--primary-glow);
}

.map-search {
  padding: 16px 24px;
  display: flex;
  gap: 12px;
  background: rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid var(--line);
}

[data-theme="light"] .map-search {
  background: rgba(255, 255, 255, 0.9);
}

.location-search-input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--primary);
  border-radius: 4px;
  color: var(--primary);
  font-family: 'Fira Code', monospace;
  font-size: 1rem;
}

[data-theme="light"] .location-search-input {
  background: #fff;
  color: var(--fg);
  border-color: var(--line);
}

.location-search-input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 15px rgba(188, 19, 254, 0.3);
}

.search-btn {
  padding: 12px 24px;
  background: rgba(188, 19, 254, 0.1);
  border: 1px solid var(--secondary);
  border-radius: 4px;
  color: var(--secondary);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}

.search-btn--success {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: #10b981;
  color: #fff;
}

.search-btn--success:hover {
  background: #059669;
  border-color: #059669;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.search-btn:hover {
  transform: translateY(-2px);
  background: var(--secondary);
  color: #fff;
  box-shadow: 0 0 20px rgba(188, 19, 254, 0.5);
}

.location-map {
  width: 100%;
  height: 450px;
  background: #000;
  position: relative;
  border-bottom: 1px solid var(--primary);
}

.map-instructions {
  padding: 16px 24px;
  background: rgba(0, 243, 255, 0.05);
  border-top: 1px solid var(--primary);
}

.map-instructions p {
  margin: 4px 0;
  font-size: 0.95rem;
  color: var(--fg-soft);
  font-family: 'Fira Code', monospace;
}

.map-instructions p:first-child {
  color: var(--success);
  font-weight: 600;
  text-shadow: 0 0 5px var(--success);
}

#selected-address {
  color: var(--secondary);
  font-weight: 500;
  margin-top: 8px;
  font-family: 'Fira Code', monospace;
}

.confirm-location-btn {
  margin: 16px 24px 20px;
  padding: 14px 24px;
  background: rgba(10, 255, 10, 0.1);
  border: 1px solid var(--success);
  border-radius: 4px;
  color: var(--success);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.confirm-location-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  background: var(--success);
  color: #000;
  box-shadow: 0 0 30px var(--success);
}

.confirm-location-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(75, 85, 99, 0.2);
  border-color: #4b5563;
  color: #6b7280;
}

@media (max-width: 768px) {
  .hero-banner {
    padding: 2.5rem 1.5rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  /* Map Modal Mobile Improvements */
  .map-modal-content {
    max-width: 95%;
    max-height: 95vh;
    margin: 1rem;
  }

  .map-modal-header {
    padding: 1rem 1.25rem;
  }

  .map-modal-header h3 {
    font-size: 1.2rem;
  }

  .close-map-btn {
    width: 36px;
    height: 36px;
    font-size: 1.75rem;
  }

  .map-search {
    padding: 1rem;
    flex-direction: column;
    gap: 0.75rem;
  }

  .location-search-input {
    width: 100%;
    font-size: 16px; /* Prevents iOS zoom */
    padding: 0.85rem 1rem;
  }

  .search-btn {
    width: 100%;
    padding: 0.85rem 1.5rem;
  }

  .location-map {
    height: 300px !important;
  }

  .map-instructions {
    padding: 1rem;
  }

  .map-instructions p {
    font-size: 0.9rem;
  }

  .confirm-location-btn {
    margin: 1rem;
    padding: 0.85rem 1.5rem;
    width: calc(100% - 2rem);
  }

  .issue-showcase {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .issue-card {
    padding: 1rem;
  }

  .issue-icon {
    font-size: 2rem;
  }

  .feature-badge {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .stat-card {
    padding: 1.5rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  .stories-grid {
    grid-template-columns: 1fr;
  }

  .location-map {
    height: 350px;
  }
  
  .map-search {
    flex-direction: column;
  }
  
  .search-btn {
    width: 100%;
  }

  .upload-card {
    padding: 1.5rem;
  }

  .location-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .analysis-row {
    flex-direction: column;
    align-items: stretch;
  }

  .location-button,
  .analysis-button,
  .complaint-button {
    width: 100%;
  }

  .section-title {
    font-size: 2rem;
  }

  .impact-section {
    padding: 2rem 1rem;
  }
}

/* Small Mobile Phones (480px and below) */
@media (max-width: 480px) {
  .hero {
    padding: 1rem 0.75rem 0.75rem;
  }

  .hero-banner {
    padding: 2rem 1rem;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .top-nav {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .brand {
    font-size: 0.95rem;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .nav-link {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  /* Smaller map modal for very small screens */
  .map-modal-content {
    max-width: 100%;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
  }

  .map-modal-header h3 {
    font-size: 1.1rem;
  }

  .location-map {
    height: 250px !important;
  }

  .hero-features {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .feature-badge {
    width: 100%;
    justify-content: center;
    padding: 0.65rem 0.85rem;
  }

  .issue-showcase {
    gap: 0.5rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1.25rem;
  }

  .file-area {
    padding: 1.5rem 1rem;
    min-height: 180px;
  }

  .upload-card {
    padding: 1rem;
  }

  .card-header h2 {
    font-size: 1.25rem;
  }

  .location-map {
    height: 250px;
  }

  .map-instructions p {
    font-size: 0.85rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .stories-title {
    font-size: 1.4rem;
  }

  main {
    padding: 0 0.75rem 1.5rem;
  }
}

/* Touch-Friendly Improvements for All Mobile Devices */
@media (hover: none) and (pointer: coarse) {
  /* Increase touch targets */
  .nav-link,
  .theme-toggle,
  button,
  a,
  .location-button,
  .analysis-button,
  .complaint-button {
    min-height: 44px; /* Apple's recommended touch target size */
    min-width: 44px;
  }

  /* Remove hover effects on touch devices */
  .theme-toggle:hover {
    transform: none;
  }

  /* Better active states for touch */
  .complaint-button:active:not(:disabled),
  .location-button:active:not(:disabled),
  .analysis-button:active:not(:disabled) {
    transform: scale(0.98);
  }
}
