/* ===========================================
   MapSmith — Arnis SaaS Frontend
   Design inspired by arnismc.com
   =========================================== */

/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* CSS Variables — Arnis Dark Theme (Default) */
:root {
  /* Primary colors */
  --primary: #FECC44;
  --primary-dark: #E5B835;
  --primary-light: #fff2cc;
  
  /* Background */
  --bg-darker: #0d0d0d;
  --bg-dark: #1a1a1a;
  --bg-card: #2C2C2C;
  --bg-card-hover: #363636;
  
  /* Text */
  --text-light: #FFFFFF;
  --text-gray: #B0B0B0;
  --text-muted: #6b7280;
  
  /* Accents */
  --success: #7bd864;
  --error: #ef4444;
  --info: #3b82f6;
  --border: rgba(254, 204, 68, 0.2);
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  
  /* Radius */
  --radius: 12px;
  --radius-sm: 8px;
}

/* Light mode overrides */
body.light {
  --bg-darker: #f6f7fb;
  --bg-dark: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f0f0;
  --text-light: #1a1a1a;
  --text-gray: #4a4a4a;
  --text-muted: #6b7280;
  --border: rgba(0, 0, 0, 0.1);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-darker);
  color: var(--text-light);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary-dark);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===========================================
   Navigation
   =========================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(13, 13, 13, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  padding: 1rem 0;
}

body.light .site-header {
  background: rgba(255, 255, 255, 0.95);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand:hover {
  color: var(--primary-dark);
}

.brand-logo {
  height: 40px;
  width: auto;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

nav {
  display: flex;
  gap: 1.5rem;
}

nav a {
  color: var(--text-gray);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

nav a:hover, nav a.active {
  color: var(--text-light);
}

/* Theme Toggle */
.theme-toggle button {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-light);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle button svg {
  width: 20px;
  height: 20px;
}

.theme-toggle button .icon-sun {
  display: none;
}

.theme-toggle button:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
}

/* ===========================================
   Hero Section (Landing Page)
   =========================================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  background: url('../assets/background.jpg') center / cover no-repeat;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(13, 13, 13, 0.15);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 1;
  background: rgba(0, 0, 0, 0.55);
  padding: 2rem 2.5rem;
  border-radius: var(--radius);
}

.hero-copy h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: #fff;
}

.hero-copy .highlight {
  color: var(--primary);
}

.hero-copy p {
  font-size: 1.15rem;
  color: var(--text-gray);
  margin-bottom: 2rem;
  line-height: 1.8;
}

.hero-image img {
  width: 100%;
  max-width: 500px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ===========================================
   Buttons
   =========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: #1a1a1a;
  box-shadow: 0 4px 20px rgba(254, 204, 68, 0.4);
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: #1a1a1a;
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(254, 204, 68, 0.5);
}

.btn-secondary {
  background: transparent;
  color: var(--text-light);
  border: 2px solid var(--text-gray);
}

.btn-secondary:hover {
  border-color: var(--text-light);
  transform: translateY(-2px);
}

.hero .btn-secondary {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

.hero .btn-secondary:hover {
  border-color: #fff;
  transform: translateY(-2px);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-block {
  width: 100%;
}

/* ===========================================
   Features Section
   =========================================== */
.features {
  padding: 5rem 0;
  background: var(--bg-dark);
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
}

.section-subtitle {
  color: var(--text-gray);
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem;
}

.feature-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.feature-list li {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.feature-list li:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
}

.feature-list strong {
  color: var(--primary);
  font-size: 1.5rem;
  margin-right: 0.5rem;
}

/* Inline Pricing Text */
.pricing-text {
  margin-top: 2.5rem;
  padding: 0 1rem;
  text-align: center;
  color: var(--text-gray);
  font-size: 1rem;
  line-height: 1.7;
}

.pricing-text strong {
  color: var(--text-light);
}

.pricing-text em {
  color: var(--text-muted);
  font-style: italic;
}

.price-example {
  color: var(--primary);
  font-weight: 600;
  background: rgba(254, 204, 68, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

/* Benefits Grid */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .benefits-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .benefits-grid {
    grid-template-columns: 1fr;
  }
}

.benefit-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-align: center;
  transition: all 0.3s ease;
}

.benefit-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
}

.benefit-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  background: rgba(254, 204, 68, 0.1);
  border-radius: 50%;
  color: var(--primary);
}

.benefit-icon svg {
  width: 32px;
  height: 32px;
}

.benefit-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-light);
}

.benefit-card p {
  font-size: 0.875rem;
  color: var(--text-gray);
  line-height: 1.6;
}

/* ===========================================
   Generator Page
   =========================================== */
.generator-page {
  padding-top: 100px;
  padding-bottom: 2rem;
  min-height: 100vh;
  background: var(--bg-darker);
}

.generator-page h2 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}

.generator-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 1.5rem;
  margin-top: 1rem;
  align-items: stretch;
}

/* Map */
.map-wrapper {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

#map {
  flex: 1;
  min-height: 500px;
  width: 100%;
  background: var(--bg-dark);
}

/* Sidebar Controls */
.controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card h3 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card h4 {
  font-size: 0.8rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
  color: var(--text-gray);
}

/* Presets */
.presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.preset {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.3s ease;
}

.preset:hover, .preset.active {
  background: var(--primary);
  color: #1a1a1a;
  border-color: var(--primary);
}

/* Price display */
.price-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg-dark);
  border-radius: var(--radius-sm);
  margin-top: 0.75rem;
}

.price-display .label {
  color: var(--text-gray);
  font-size: 0.875rem;
}

.price-display .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

/* Format Toggle (Java/Bedrock) */
.format-toggle {
  display: flex;
  gap: 0.5rem;
}

.format-btn {
  flex: 1;
  padding: 0.75rem;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-gray);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.format-btn.active, .format-btn:hover {
  background: var(--primary);
  color: #1a1a1a;
  border-color: var(--primary);
}

/* Settings/Options */
.settings-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

body.light .setting-row {
  border-bottom-color: rgba(0,0,0,0.05);
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-row label {
  color: var(--text-gray);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* Tooltip icon */
.tooltip {
  display: inline-flex;
  align-items: center;
  cursor: help;
  color: var(--text-muted);
  position: relative;
}

.tooltip:hover {
  color: var(--primary);
}

.tooltip svg {
  opacity: 0.6;
}

.tooltip:hover svg {
  opacity: 1;
}

/* Native title tooltip styling via CSS - works in most browsers */
.tooltip[title] {
  position: relative;
}

.setting-row select,
.setting-row input[type="text"],
.setting-row input[type="number"] {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  color: var(--text-light);
  font-size: 0.875rem;
  min-width: 140px;
}

.setting-row select:focus,
.setting-row input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Checkbox Toggle Switch */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
  margin: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 24px;
  transition: 0.3s;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background: var(--text-gray);
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
  border-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: #1a1a1a;
}

/* Spawn Point Controls */
.spawn-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.spawn-status {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 100px;
}

.spawn-status.spawn-set {
  color: var(--primary);
  font-weight: 500;
}

.btn-small {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 6px;
}

/* Slider (World Scale) */
.slider-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.slider-row .slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-row .slider-header label {
  color: var(--text-gray);
  font-size: 0.875rem;
}

.slider-row input[type="range"] {
  width: 100%;
  height: 6px;
  background: var(--bg-dark);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  border: 1px solid var(--border);
}

.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
}

.slider-value {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.875rem;
}

/* Form inputs */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  color: var(--text-gray);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.form-group input {
  width: 100%;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  color: var(--text-light);
  font-size: 0.875rem;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.form-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Input Groups - Connected input + button */
.input-group {
  display: flex;
  gap: 0;
}

.input-group input {
  flex: 1;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  padding: 0.75rem;
  color: var(--text-light);
  font-size: 0.875rem;
  border-right: none;
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.input-group .btn {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  white-space: nowrap;
  padding: 0.75rem 1rem;
}

/* Status indicator */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge.pending {
  background: rgba(254, 204, 68, 0.2);
  color: var(--primary);
}

.status-badge.verified {
  background: rgba(123, 216, 100, 0.2);
  color: var(--success);
}

.status-badge.error {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}

/* Checkbox groups */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1rem 0;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--text-gray);
  font-size: 0.875rem;
  cursor: pointer;
  line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 0;
}

.checkbox-label span {
  flex: 1;
}

.checkbox-label a {
  color: var(--primary);
  text-decoration: none;
}

.checkbox-label a:hover {
  text-decoration: underline;
}

.checkbox-group label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--text-gray);
  font-size: 0.875rem;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Job Status Card */
.job-card {
  background: var(--bg-dark);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-top: 0.5rem;
  border: 1px solid var(--border);
}

.job-card .job-id {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.job-card .job-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.job-card .job-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.job-card .job-status .dot.pending_payment { background: var(--warning, #f59e0b); }
.job-card .job-status .dot.queued { background: var(--primary); }
.job-card .job-status .dot.running { background: var(--info); }
.job-card .job-status .dot.done { background: var(--success); animation: none; }
.job-card .job-status .dot.failed { background: var(--error); animation: none; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.job-card .job-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-gray);
}

.job-card .download-btns {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Jobs List */
.jobs-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
}

.jobs-list li {
  background: var(--bg-dark);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  border: 1px solid var(--border);
}

.jobs-list li a {
  color: var(--primary);
  text-decoration: none;
  font-family: monospace;
}

.jobs-list li a:hover {
  text-decoration: underline;
}

.no-jobs {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-align: center;
  padding: 1rem;
}

/* ===========================================
   Toast Notifications
   =========================================== */
.toast-notification {
  position: fixed;
  top: 90px;
  right: 20px;
  max-width: 320px;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  z-index: 10000;
  opacity: 0;
  transform: translateX(100%);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-notification.toast-visible {
  opacity: 1;
  transform: translateX(0);
}

.toast-notification.toast-hiding {
  opacity: 0;
  transform: translateX(100%);
}

.toast-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-message {
  flex: 1;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text);
}

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  margin-left: 0.5rem;
  line-height: 1;
  transition: color 0.2s;
}

.toast-close:hover {
  color: var(--text);
}

.toast-error {
  border-color: var(--error);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), var(--bg-card));
}

.toast-error .toast-icon {
  color: var(--error);
}

.toast-warning {
  border-color: var(--warning, #f59e0b);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), var(--bg-card));
}

.toast-warning .toast-icon {
  color: var(--warning, #f59e0b);
}

.toast-success {
  border-color: var(--success);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), var(--bg-card));
}

.toast-success .toast-icon {
  color: var(--success);
}

.toast-info {
  border-color: var(--info);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), var(--bg-card));
}

.toast-info .toast-icon {
  color: var(--info);
}

@media (max-width: 480px) {
  .toast-notification {
    top: auto;
    bottom: 20px;
    right: 10px;
    left: 10px;
    max-width: none;
    transform: translateY(100%);
  }
  
  .toast-notification.toast-visible {
    transform: translateY(0);
  }
  
  .toast-notification.toast-hiding {
    transform: translateY(100%);
  }
}

/* ===========================================
   Status Page
   =========================================== */
.status-page {
  padding-top: 100px;
  padding-bottom: 2rem;
  min-height: calc(100vh - 180px);
  display: flex;
  flex-direction: column;
}

.status-page .container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.status-page .card {
  max-width: 600px;
  margin: 1.5rem auto;
  width: 100%;
}

.status-page .card h3 {
  margin-bottom: 0.5rem;
}

.status-page .job-card:last-child {
  margin-bottom: 0;
}

.status-actions {
  text-align: center;
  margin-top: 1rem;
  margin-bottom: 2rem;
}

.status-empty {
  text-align: center;
  padding: 2rem 1rem;
}

.status-empty h3 {
  margin-bottom: 0.5rem;
  color: var(--text);
}

.status-empty .text-muted {
  margin: 0;
}

/* Spinning icon animation */
.spin-icon {
  animation: spin 2s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===========================================
   Footer
   =========================================== */
.site-footer {
  background: var(--bg-dark);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: auto;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-footer small {
  color: var(--text-muted);
}

.site-footer a {
  color: var(--text-gray);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--primary);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

/* ===========================================
   Responsive
   =========================================== */
@media (max-width: 1024px) {
  .generator-grid {
    grid-template-columns: 1fr;
  }
  
  #map {
    height: 450px;
  }
  
  .controls {
    max-height: none;
  }
}

@media (max-width: 768px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
  
  .hero-copy h1 {
    font-size: 2rem;
  }
  
  .hero-image {
    display: none;
  }
  
  .hero-buttons {
    justify-content: center;
  }
  
  nav {
    display: none;
  }
  
  .presets {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .format-toggle {
    flex-direction: column;
  }
  
  .site-footer .container {
    flex-direction: column;
    text-align: center;
  }
}

/* ===========================================
   Utility Classes
   =========================================== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-primary { color: var(--primary); }
.text-small { font-size: 0.85rem; }
.mt-half { margin-top: 0.35rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* Leaflet overrides for dark/light theme */
.leaflet-container {
  background: var(--bg-dark);
}

/* Map controls z-index - must be below header (z-index 1000) */
.leaflet-control-container,
.leaflet-top,
.leaflet-bottom,
.leaflet-control {
  z-index: 500 !important;
}

/* Leaflet zoom controls */
.leaflet-control-zoom a {
  background-color: var(--bg-card) !important;
  color: var(--text-light) !important;
  border-color: var(--border) !important;
}

.leaflet-control-zoom a:hover {
  background-color: var(--bg-card-hover) !important;
}

/* Leaflet draw toolbar - base styles */
.leaflet-draw-section {
  background-color: var(--bg-card) !important;
}

.leaflet-draw-toolbar a {
  background-color: var(--bg-card) !important;
  border-color: var(--border) !important;
}

.leaflet-draw-toolbar a:hover {
  background-color: var(--bg-card-hover) !important;
}

/*
 * Dark Mode: Invert sprite icons to white on dark background
 * Filter affects entire element, so we compensate background colors:
 *   - filter: invert(100%) brightness(200%)
 *   - To get #2C2C2C after filter: 44/2=22, inverted=233 = #E9E9E9
 *   - To get #363636 after filter: 54/2=27, inverted=228 = #E4E4E4
 */
body:not(.light) .leaflet-draw-toolbar a {
  filter: invert(100%) brightness(200%);
  background-color: #E9E9E9 !important;
  border-color: #EDEDED !important;
}

body:not(.light) .leaflet-draw-toolbar a:hover {
  background-color: #E4E4E4 !important;
}

/*
 * Light Mode: Reset to normal (dark icons on light background)
 * Must explicitly override dark mode styles
 */
body.light .leaflet-draw-toolbar a {
  filter: none !important;
  background-color: var(--bg-card) !important;
  border-color: var(--border) !important;
}

body.light .leaflet-draw-toolbar a:hover {
  background-color: var(--bg-card-hover) !important;
}

/* Leaflet draw actions */
.leaflet-draw-actions {
  background-color: var(--bg-card) !important;
}

.leaflet-draw-actions a {
  background-color: var(--bg-card) !important;
  color: var(--text-light) !important;
  border-color: var(--border) !important;
}

.leaflet-draw-actions a:hover {
  background-color: var(--bg-card-hover) !important;
}

.leaflet-bar {
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-sm) !important;
}

.leaflet-bar a {
  background-color: var(--bg-card) !important;
  color: var(--text-light) !important;
  border-bottom-color: var(--border) !important;
}

.leaflet-bar a:hover {
  background-color: var(--bg-card-hover) !important;
}

.leaflet-control-layers,
.leaflet-control-attribution {
  background-color: var(--bg-card) !important;
  color: var(--text-muted) !important;
}

.leaflet-control-attribution a {
  color: var(--primary) !important;
}

/* Email notice styling */
.email-notice {
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(254, 204, 68, 0.1);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  color: var(--text-gray);
  text-align: center;
}

.leaflet-draw-actions li:first-child a {
  border-radius: 4px 0 0 4px;
}

.leaflet-draw-actions li:last-child a {
  border-radius: 0 4px 4px 0;
}

/* Generator bottom section (Email, Checkout, Jobs) - Connected boxes */
.generator-bottom {
  display: flex;
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.generator-bottom > .card {
  flex: 1;
  border: none;
  border-radius: 0;
  border-right: 1px solid var(--border);
}

.generator-bottom > .card:last-child {
  border-right: none;
}

@media (max-width: 1024px) {
  .generator-bottom {
    flex-direction: column;
  }
  
  .generator-bottom > .card {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  
  .generator-bottom > .card:last-child {
    border-bottom: none;
  }
}

@media (max-width: 768px) {
  .generator-bottom {
    flex-direction: column;
  }
}

/* Enhanced Job List Styling */
.jobs-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.jobs-list .job-item {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.875rem;
  margin-bottom: 0.75rem;
  transition: all 0.2s ease;
}

.jobs-list .job-item:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
}

.jobs-list .job-item.done {
  border-left: 3px solid var(--success);
}

.jobs-list .job-item.running {
  border-left: 3px solid var(--info);
}

.jobs-list .job-item.queued {
  border-left: 3px solid var(--primary);
}

.jobs-list .job-item.failed {
  border-left: 3px solid var(--error);
}

.job-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.job-id-short {
  font-family: monospace;
  color: var(--text-light);
  font-size: 0.875rem;
}

.job-price {
  color: var(--primary);
  font-weight: 600;
}

.job-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.job-status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.job-status-row .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.job-status-row .dot.pending_payment { 
  background: var(--warning, #f59e0b); 
  animation: pulse 2s infinite; 
}

.job-status-row .dot.queued { 
  background: var(--primary); 
  animation: pulse 2s infinite; 
}

.job-status-row .dot.running { 
  background: var(--info); 
  animation: pulse 1s infinite; 
}

.job-status-row .dot.done { 
  background: var(--success); 
}

.job-status-row .dot.failed { 
  background: var(--error); 
}

.status-text {
  font-size: 0.875rem;
  color: var(--text-gray);
}

.job-status-row .download-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.4rem 0.75rem;
  background-color: var(--primary) !important;
  color: #1a1a1a !important;
  font-weight: 600;
  font-size: 0.8125rem;
  border-radius: 6px;
  text-decoration: none !important;
  transition: background-color 0.2s ease, transform 0.2s ease;
  line-height: 1;
}

.job-status-row .download-link:hover {
  background-color: var(--primary-dark) !important;
  color: #1a1a1a !important;
  transform: translateY(-1px);
}

.job-status-row .download-link svg {
  flex-shrink: 0;
  vertical-align: middle;
}

.job-downloads {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.no-jobs {
  color: var(--text-muted);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.875rem;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ===========================================
   Job Page (job.html)
   =========================================== */
.job-page {
  padding-top: 100px;
  padding-bottom: 2rem;
  min-height: 100vh;
  background: var(--bg-darker);
}

.loading-state {
  text-align: center;
  padding: 4rem 2rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.job-not-found {
  text-align: center;
  padding: 4rem 2rem;
}

.job-not-found h2 {
  margin-bottom: 1rem;
}

.job-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 700px;
  margin: 0 auto;
  overflow: hidden;
}

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.job-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.job-id-label {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-dark);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.job-status-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem;
  border-radius: var(--radius-sm);
}

.job-status-banner.queued {
  background: rgba(254, 204, 68, 0.1);
  border: 1px solid rgba(254, 204, 68, 0.3);
}

.job-status-banner.running {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.job-status-banner.done {
  background: rgba(123, 216, 100, 0.1);
  border: 1px solid rgba(123, 216, 100, 0.3);
}

.job-status-banner.failed {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.job-status-banner .status-icon {
  font-size: 2rem;
}

.job-status-banner strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text-light);
}

.job-status-banner p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-gray);
}

.progress-bar-container {
  height: 4px;
  background: var(--bg-dark);
  margin: 0 1.5rem 1.5rem;
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  transition: width 0.5s ease;
}

.job-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding: 0 1.5rem 1.5rem;
}

.detail-item {
  background: var(--bg-dark);
  padding: 1rem;
  border-radius: var(--radius-sm);
}

.detail-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.detail-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-light);
}

.download-section {
  background: var(--bg-dark);
  padding: 1.5rem;
  margin: 0 1.5rem 1.5rem;
  border-radius: var(--radius-sm);
  text-align: center;
}

.download-section h3 {
  margin-bottom: 1rem;
  color: var(--primary);
}

.download-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.download-btn {
  min-width: 200px;
}

.download-expiry {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.job-options {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
}

.job-options h4 {
  font-size: 0.875rem;
  color: var(--text-gray);
  margin-bottom: 0.75rem;
}

.job-options ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.job-options li {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.job-options li span {
  color: var(--text-gray);
}

@media (max-width: 600px) {
  .job-details-grid,
  .job-options ul {
    grid-template-columns: 1fr;
  }
  
  .download-buttons {
    flex-direction: column;
  }
  
  .download-btn {
    width: 100%;
  }
}
