:root {
  --bg-color: #f5f7fa;
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --accent-color: #4f46e5;
  --accent-hover: #4338ca;
  --card-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.6);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Merriweather', serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #111827;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --card-bg: rgba(31, 41, 55, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent-color: #6366f1;
    --accent-hover: #818cf8;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* Background Decoration */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 50%, rgba(79, 70, 229, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(236, 72, 153, 0.08) 0%, transparent 40%);
  z-index: -1;
  pointer-events: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 4rem;
  animation: fadeInDown 1s ease-out;
}

h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 3.5rem;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

/* Settings Button (Floating Top-Right) */
.settings-trigger {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.settings-trigger:hover {
  transform: rotate(90deg) scale(1.1);
  color: var(--accent-color);
  background: white;
  box-shadow: var(--shadow-lg);
}

.settings-trigger svg {
  width: 22px;
  height: 22px;
}

.modal-desc {
  margin-bottom: 2rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  background: rgba(0, 0, 0, 0.03);
  padding: 1rem;
  border-radius: 8px;
}

/* Better Input Fields */
.form-input,
.form-textarea {
  font-family: var(--font-sans);
  background: rgba(255, 255, 255, 0.5);
  border: 2px solid transparent;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05) inset;
  border-radius: 10px;
  padding: 0.85rem;
  font-size: 1rem;
  color: var(--text-primary);
  transition: all 0.2s;
  width: 100%;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  background: white;
  border-color: var(--accent-color);
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.1);
}

.btn-danger-outline {
  background: transparent;
  color: #ef4444;
  border: 1px solid #ef4444;
}

.btn-danger-outline:hover {
  background: #fef2f2;
}

/* Floating Action Button (Moved up slightly to avoid collision) */
.fab {
  position: fixed;
  bottom: 2.5rem;
  right: 2.5rem;
  width: 64px;
  height: 64px;

  background-color: var(--accent-color);
  color: white;
  border-radius: 50%;
  border: none;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  transition: transform 0.3s ease, background-color 0.3s ease;
  z-index: 100;
}

.fab:hover {
  transform: scale(1.1) rotate(90deg);
  background-color: var(--accent-hover);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-color);
  width: 90%;
  max-width: 600px;
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.modal h2 {
  font-family: var(--font-serif);
  margin-bottom: 2rem;
  color: var(--text-primary);
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.form-input,
.form-textarea {
  font-family: var(--font-sans);
  background: transparent;
  border: 1px solid var(--text-secondary);
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 1rem;
  color: var(--text-primary);
  transition: border-color 0.2s;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-textarea {
  min-height: 150px;
  resize: vertical;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: rgba(0, 0, 0, 0.05);
}

.btn-primary {
  background: var(--accent-color);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-primary);
  color: var(--bg-color);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  box-shadow: var(--shadow-lg);
  font-weight: 500;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 300;
}

.toast.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Loading/Empty States */
.state-box {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-secondary);
  width: 100%;
  grid-column: 1 / -1;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(79, 70, 229, 0.1);
  border-radius: 50%;
  border-top-color: var(--accent-color);
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}