/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-danger: #dc2626;
  --color-danger-hover: #b91c1c;
  --color-success: #16a34a;
  --color-warning: #d97706;
  --color-info: #0891b2;
  --color-muted: #6b7280;
  --color-bg: #ffffff;
  --color-bg-alt: #f9fafb;
  --color-border: #e5e7eb;
  --color-text: #111827;
  --color-text-secondary: #6b7280;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Source Code Pro", monospace;
  --radius: 4px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

body {
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  margin-bottom: 0.5em;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }

p { margin-bottom: 0.75em; }

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul, ol {
  padding-left: 1.5em;
  margin-bottom: 0.75em;
}

dl {
  margin-bottom: 1em;
}

dt {
  font-weight: 600;
  margin-top: 0.5em;
}

dd {
  margin-left: 0;
  color: var(--color-text-secondary);
}

section {
  margin-bottom: 2em;
}

.text-muted {
  color: var(--color-muted);
  font-size: 0.875rem;
}

.text-danger {
  color: var(--color-danger);
}
/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
  text-decoration: none;
  vertical-align: middle;
}

.btn:hover {
  background: var(--color-bg-alt);
  text-decoration: none;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
  border-color: var(--color-danger);
}

.btn-danger:hover {
  background: var(--color-danger-hover);
  border-color: var(--color-danger-hover);
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.8125rem;
}

/* Forms */
.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

/* Setting taken over by a device profile: shown, but not the user's to change. */
.field-suppressed {
  opacity: 0.5;
}

.field-suppressed label,
.field-suppressed input {
  cursor: not-allowed;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="url"],
.field input[type="number"],
.field textarea,
.field select {
  display: block;
  width: 100%;
  padding: 0.5rem;
  font-size: 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: inherit;
}

.field textarea {
  resize: vertical;
}

.field .hint {
  font-size: 0.8125rem;
  color: var(--color-muted);
  margin-top: 0.25rem;
}

.inline-field {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.inline-field label {
  margin-bottom: 0;
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.actions {
  margin-top: 1.5rem;
}

.form-errors {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  color: var(--color-danger);
}

.form-errors h3 {
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.form-errors ul {
  font-size: 0.875rem;
  margin-bottom: 0;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1em;
}

.table th,
.table td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.875rem;
}

.table th {
  font-weight: 600;
  background: var(--color-bg-alt);
}

.table tbody tr:hover {
  background: var(--color-bg-alt);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}

.badge-new { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.badge-learning { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.badge-review { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.badge-suspended { background: #f3f4f6; color: #6b7280; border-color: #d1d5db; }
.badge-buried { background: #f3f4f6; color: #9ca3af; border-color: #e5e7eb; }

.badge-again { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }
.badge-hard { background: #fff7ed; color: #9a3412; border-color: #fdba74; }
.badge-good { background: #f0fdf4; color: #166534; border-color: #86efac; }
.badge-easy { background: #eff6ff; color: #1e40af; border-color: #93c5fd; }

/* Flash messages */
.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.flash-notice {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #86efac;
}

.flash-alert {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* Readonly copyable input */
.field input[readonly] {
  background: var(--color-bg-alt);
  cursor: text;
  color: var(--color-text-secondary);
}

/* Tag list */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
/* Navigation */
.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
}

.nav-brand a {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-text);
  text-decoration: none;
}

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

.nav-links a {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  padding: 0.25rem 0;
}

.nav-links a:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.nav-links a.active {
  color: var(--color-primary);
  font-weight: 600;
  border-bottom: 2px solid var(--color-primary);
}

/* Container */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}
/* Stats grid */
.stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
}

.stat-label {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-top: 0.25rem;
}
/* Study page */
.study-counts {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.count-new { color: #2563eb; font-weight: 600; }
.count-learning { color: #d97706; font-weight: 600; }
.count-due { color: #16a34a; font-weight: 600; }

/* Flashcard */
.flashcard {
  max-width: 600px;
  margin: 1rem auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.flashcard-front h2 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.flashcard-front .hint {
  color: var(--color-muted);
  font-style: italic;
  font-size: 0.875rem;
}

.flashcard-back {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.flashcard-back h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.flashcard-back .example {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  font-style: italic;
}

.flashcard-actions {
  margin-top: 1.5rem;
}

/* Rating buttons */
.rating-buttons {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.btn-rating {
  padding: 0.5rem 1.25rem;
  font-weight: 600;
  border-radius: var(--radius);
}

.btn-again {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fca5a5;
}
.btn-again:hover { background: #fee2e2; }

.btn-hard {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fdba74;
}
.btn-hard:hover { background: #ffedd5; }

.btn-good {
  background: #f0fdf4;
  color: #166534;
  border-color: #86efac;
}
.btn-good:hover { background: #dcfce7; }

.btn-easy {
  background: #eff6ff;
  color: #1e40af;
  border-color: #93c5fd;
}
.btn-easy:hover { background: #dbeafe; }

.study-complete {
  text-align: center;
  padding: 3rem 1rem;
}

.study-complete h2 {
  color: var(--color-success);
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
