/* Police Report Generator - Modern, Dynamic Styles with Dark Mode */
:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --background: #f8fafc;
  --surface: #fff;
  --border: #e5e7eb;
  --text: #1e293b;
  --muted: #64748b;
  --success: #22c55e;
  --error: #ef4444;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(30,41,59,0.07);
}

[data-theme="dark"] {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --background: #0f172a;
  --surface: #1e293b;
  --border: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --success: #10b981;
  --error: #f87171;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
}

* {
  box-sizing: border-box;
}

body {
  background: var(--background);
  color: var(--text);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  min-height: 100vh;
  transition: background-color 0.3s, color 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
}

.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s;
  box-shadow: var(--shadow);
  z-index: 100;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

main {
  width: 100%;
  max-width: 600px;
  margin: 2rem auto;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem;
  transition: background-color 0.3s, box-shadow 0.3s;
}

h1 {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--primary);
  font-size: 2rem;
  font-weight: 700;
}

.mode-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-radius: var(--radius);
  background: var(--background);
  padding: 0.25rem;
}

.mode-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.mode-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 1px 3px rgba(37,99,235,0.2);
}

.mode-btn:hover:not(.active) {
  background: var(--border);
  color: var(--text);
}

#structured-mode, #natural-mode {
  display: none;
}

#structured-mode.active, #natural-mode.active {
  display: block;
}

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

label {
  display: flex;
  flex-direction: column;
  font-weight: 500;
  gap: 0.5rem;
}

select, input, textarea {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--background);
  color: var(--text);
  transition: border-color 0.2s, background-color 0.3s, color 0.3s;
  font-family: inherit;
}

select:focus, input:focus, textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

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

#natural-description {
  min-height: 150px;
}

button[type="submit"], #download-pdf {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background 0.2s, transform 0.2s;
  box-shadow: 0 2px 4px rgba(37,99,235,0.2);
}

button[type="submit"]:hover, #download-pdf:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

#dynamic-fields {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.field-suggestion {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
  font-style: italic;
}

#output-section {
  margin-top: 2.5rem;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  animation: fadeIn 0.5s;
  transition: all 0.3s;
}

#output-section h2 {
  margin-top: 0;
  color: var(--primary);
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
}

#report-output {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 0.95rem;
  white-space: pre-wrap;
  margin-bottom: 1.5rem;
  color: var(--text);
  border: 1px solid var(--border);
  line-height: 1.6;
}

@media (max-width: 768px) {
  main {
    margin: 1rem;
    padding: 1.5rem;
  }
  
  h1 {
    font-size: 1.5rem;
  }

  .theme-toggle {
    top: 0.5rem;
    right: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
  }
}

/* Animations */
@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translateY(20px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

/* Alert styles */
.alert {
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  animation: fadeIn 0.3s;
}

.alert.error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert.success {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

/* Loading animation */
.loading {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--muted);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s ease-in-out infinite;
  margin-right: 0.5rem;
}

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