/* Beautiful, accessible styling for quotes.php.
   Plays nicely with Bootstrap classes already in use.
   Scoped to general elements + classes present in quotes.php. */

:root {
  --bg: #f7f8fc;
  --bg-accent: #eef2ff;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #4f46e5;
  --primary-600: #4338ca;
  --primary-700: #3730a3;
  --border: #e5e7eb;
  --table-stripe: #f9fafb;
  --focus: #22d3ee;
  --shadow-lg: 0 10px 30px rgba(2, 6, 23, 0.08);
  --shadow-md: 0 6px 18px rgba(2, 6, 23, 0.06);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
}

/* Page background */
html, body {
  height: 100%;
  background:
    radial-gradient(1200px 400px at 10% -10%, var(--bg-accent) 0%, rgba(238,242,255,0) 60%),
    radial-gradient(900px 300px at 110% -10%, var(--bg-accent) 0%, rgba(238,242,255,0) 60%),
    var(--bg);
  color: var(--text);
}

/* Layout container */
.main-content {
  max-width: 1100px;
  margin: 28px auto;
  padding: 0 18px 40px;
}

/* Header */
.header {
  background: linear-gradient(180deg, #ffffffbf, #ffffffe6);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 22px;
}

.welcome h1 {
  margin: 0 0 6px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  background: linear-gradient(90deg, #0f172a, #334155);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.welcome p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

/* Section wrapper */
.content-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 22px 22px 8px;
}

/* Section header */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.section-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  position: relative;
  padding-left: 14px;
}

.section-header h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  box-shadow: 0 4px 10px rgba(79,70,229,0.35);
}

/* Form controls */
form .form-control {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fbfbfe;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

form .form-control:hover {
  background: #ffffff;
}

form .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(79,70,229,0.15);
}

/* Buttons */
.btn {
  border-radius: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 8px 16px rgba(79,70,229,0.25);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--primary-600);
  border-color: var(--primary-600);
  box-shadow: 0 10px 18px rgba(67,56,202,0.28);
}

.btn-secondary {
  background-color: #0ea5e9;
  border-color: #0ea5e9;
  color: #fff;
  box-shadow: 0 8px 16px rgba(14,165,233,0.22);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: #0284c7;
  border-color: #0284c7;
  box-shadow: 0 10px 18px rgba(2,132,199,0.25);
}

/* Icon-only button in table */
.table .btn.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 11px;
  box-shadow: var(--shadow-md);
}

.table .btn.btn-sm i {
  font-size: 0.95rem;
}

/* Table styling */
.table-responsive {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.table {
  margin-bottom: 0;
  background: var(--card);
  border: 0 !important;
}

.table > :not(caption) > * > * {
  padding: 0.9rem 1rem;
  vertical-align: middle;
  border-bottom-color: var(--border);
}

.table thead.table-light th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9) !important;
  color: #0f172a;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--border);
}

.table tbody tr {
  transition: background-color 0.15s ease, transform 0.08s ease;
}

.table-hover tbody tr:hover {
  background-color: var(--table-stripe);
}

.table tbody tr:hover td:first-child {
  font-weight: 600;
}

/* Zebra striping for readability */
.table tbody tr:nth-child(2n) {
  background-color: #fcfdff;
}

/* Date and numbers */
.table td:first-child {
  white-space: nowrap;
}

.table td:nth-child(2) {
  font-variant-numeric: tabular-nums;
}

/* Empty state */
.table tbody tr td.text-center {
  color: var(--muted);
  padding: 2rem 1rem;
}

/* Footer harmonization if present */
footer, .footer {
  color: var(--muted);
}

/* Focus visibility */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Small screens */
@media (max-width: 576px) {
  .header {
    padding: 22px 18px;
  }
  .welcome h1 {
    font-size: 1.6rem;
  }
  .content-section {
    padding: 16px 16px 6px;
  }
  .table > :not(caption) > * > * {
    padding: 0.75rem 0.75rem;
  }
  .table .btn.btn-sm {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --bg-accent: #0f172a;
    --card: #0f172a;
    --text: #e5e7eb;
    --muted: #a1a1aa;
    --border: #1f2937;
    --table-stripe: #111827;
    --focus: #22d3ee;
  }

  html, body {
    background:
      radial-gradient(1200px 400px at 10% -10%, rgba(59,130,246,0.12) 0%, rgba(59,130,246,0) 60%),
      radial-gradient(900px 300px at 110% -10%, rgba(99,102,241,0.14) 0%, rgba(99,102,241,0) 60%),
      var(--bg);
  }

  .header {
    background: linear-gradient(180deg, rgba(17,24,39,0.7), rgba(17,24,39,0.6));
    border-color: var(--border);
  }

  .welcome h1 {
    background: linear-gradient(90deg, #e5e7eb, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  .content-section {
    background: var(--card);
    border-color: var(--border);
  }

  form .form-control {
    background: #0b1220;
    color: var(--text);
    border-color: var(--border);
  }

  form .form-control:hover {
    background: #0c1626;
  }

  .table-responsive {
    border-color: var(--border);
  }

  .table {
    background: var(--card);
    color: var(--text);
  }

  .table thead.table-light th {
    background: linear-gradient(180deg, #0b1220, #0c1626) !important;
    color: #e5e7eb;
    border-bottom-color: var(--border);
  }

  .table > :not(caption) > * > * {
    border-bottom-color: var(--border);
  }

  .table tbody tr:nth-child(2n) {
    background: #0c1424;
  }

  .btn-secondary {
    color: #0b1220;
    background: #67e8f9;
    border-color: #67e8f9;
  }

  .btn-secondary:hover,
  .btn-secondary:focus {
    background: #22d3ee;
    border-color: #22d3ee;
  }
}