/* ============================================================
   WolfNET — Option C Color Scheme
   Gold + Deep Crimson identity — frosted glass, deep navy
   ============================================================ */

:root {
  --bg: #05080c;
  --bg-2: #090e16;
  --panel: rgba(12, 17, 26, 0.93);
  --panel-2: rgba(8, 12, 20, 0.95);
  --panel-3: rgba(16, 22, 32, 0.96);
  --line: rgba(150, 180, 210, 0.11);
  --line-strong: rgba(150, 180, 210, 0.20);
  --text: #edf2f8;
  --muted: #8a96a8;
  --accent: #b8860b;
  --accent-2: #d4a017;
  --accent-3: #e8b84b;
  --crimson: #8B1a1a;
  --crimson-2: #b91c1c;
  --crimson-light: #fca5a5;
  --blue: #74b7ff;
  --green: #43e59a;
  --yellow: #ffd76a;
  --red: #ff6b81;
  --shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 0 32px rgba(184, 134, 11, 0.10);
}

/* ============================================================
   Base / Reset
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(116, 183, 255, 0.05), transparent 28%),
    radial-gradient(circle at 85% 12%, rgba(184, 134, 11, 0.05), transparent 25%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, transparent 0 36px, rgba(255,255,255,0.016) 36px 37px),
    repeating-linear-gradient(90deg, transparent 0 36px, rgba(255,255,255,0.016) 36px 37px);
  opacity: 0.5;
  z-index: 0;
}

main {
  position: relative;
  z-index: 1;
}

/* ============================================================
   Layout
   ============================================================ */

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* ============================================================
   Cards
   ============================================================ */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(184, 134, 11, 0.22);
  box-shadow: var(--shadow), var(--shadow-gold);
}

.card-header {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
}

/* ============================================================
   Nav Links
   ============================================================ */

.nav-link {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.875rem;
  transition: color 150ms, background 150ms;
  border: 1px solid transparent;
  display: inline-block;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}

.nav-link.active {
  color: var(--accent-2);
  border-color: rgba(184, 134, 11, 0.18);
  background: rgba(184, 134, 11, 0.05);
}

/* ============================================================
   Badges
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge-pending {
  background: rgba(184, 134, 11, 0.10);
  color: #fcd34d;
  border: 1px solid rgba(184, 134, 11, 0.22);
}

.badge-assigned {
  background: rgba(116,183,255,0.12);
  color: #bfdbfe;
  border: 1px solid rgba(116,183,255,0.25);
}

.badge-completed {
  background: rgba(67,229,154,0.12);
  color: #86efac;
  border: 1px solid rgba(67,229,154,0.25);
}

.badge-default {
  background: rgba(255,255,255,0.05);
  color: var(--muted);
  border: 1px solid var(--line);
}

.badge-critical {
  background: rgba(139,26,26,0.25);
  color: #fca5a5;
  border: 1px solid rgba(185,28,28,0.4);
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #b45309, #d97706);
  color: #fff8e7;
  border-color: rgba(184, 134, 11, 0.28);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #92400e, #b45309);
  box-shadow: 0 4px 16px rgba(184, 134, 11, 0.22);
  color: #fff8e7;
}

.btn-danger {
  background: rgba(139,26,26,0.3);
  color: #fca5a5;
  border-color: rgba(185,28,28,0.4);
}

.btn-danger:hover {
  background: rgba(185,28,28,0.4);
  color: #fca5a5;
}

.btn-secondary {
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  border-color: var(--line-strong);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.07);
  color: var(--text);
}

.btn-gold {
  background: linear-gradient(135deg, #b45309, #d97706);
  color: #fff8e7;
  border-color: rgba(184, 134, 11, 0.28);
}

.btn-gold:hover {
  background: linear-gradient(135deg, #92400e, #b45309);
  color: #fff8e7;
}

/* Backwards-compat .button class */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  background: linear-gradient(135deg, #b45309, #d97706);
  color: #fff8e7;
  border: 1px solid rgba(184, 134, 11, 0.28);
  text-decoration: none;
}

.button:hover {
  background: linear-gradient(135deg, #92400e, #b45309);
  color: #fff8e7;
}

/* Generic button reset */
button {
  cursor: pointer;
  font-family: inherit;
}

/* ============================================================
   Tables
   ============================================================ */

.table-wolfnet {
  width: 100%;
  border-collapse: collapse;
}

.table-wolfnet thead {
  background: rgba(116, 183, 255, 0.04);
}

.table-wolfnet th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-2);
  border-bottom: 1px solid rgba(184, 134, 11, 0.15);
  font-weight: 700;
}

.table-wolfnet td {
  padding: 10px 14px;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.table-wolfnet tbody tr:hover {
  background: rgba(255,255,255, 0.02);
}

.overflow-x-auto {
  overflow-x: auto;
}

/* Legacy table-border */
.table-border {
  border: 1px solid var(--line);
  border-collapse: collapse;
  width: 100%;
}

.table-border th,
.table-border td {
  border: 1px solid var(--line);
  padding: 10px;
}

/* ============================================================
   Forms & Inputs
   ============================================================ */

input,
textarea,
select {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 14px;
  font-size: 0.875rem;
  width: 100%;
  transition: border-color 150ms, box-shadow 150ms;
  font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.10);
}

textarea {
  resize: vertical;
}

.input {
  display: block;
  width: 100%;
  background: rgba(255,255,255,0.03);
  color: var(--text);
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-size: 0.875rem;
  transition: border-color 150ms, box-shadow 150ms;
  box-sizing: border-box;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.10);
}

.input[readonly] {
  opacity: 0.6;
  cursor: not-allowed;
}

form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: var(--panel);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin-top: 24px;
}

/* ============================================================
   Required / Breadcrumb / Empty State / Spinner
   ============================================================ */

.required::after {
  content: ' *';
  color: var(--crimson-light);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.breadcrumb a {
  color: var(--accent-2);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
  color: var(--accent-3);
}

.breadcrumb-sep {
  color: var(--line-strong);
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}

.empty-state-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.empty-state-text {
  font-size: 0.95rem;
}

.spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 0.4em;
}

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

/* ============================================================
   Flash Messages
   ============================================================ */

.flash-messages {
  margin-bottom: 1.5rem;
}

.alert {
  padding: 14px 18px;
  background: rgba(184, 134, 11, 0.05);
  color: var(--text);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  margin-top: 16px;
  backdrop-filter: blur(8px);
}

/* ============================================================
   Header / Nav (legacy nav element)
   ============================================================ */

nav {
  background: rgba(8,12,20,0.97);
  padding: 10px 20px;
  border-bottom: 1px solid rgba(180,150,100,0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 999;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  margin: 0 8px;
  font-weight: 500;
  transition: color 0.15s ease;
}

nav a:hover {
  color: var(--accent-2);
}

/* ============================================================
   AI Chat Output
   ============================================================ */

#ai-response {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-x: auto;
  background: rgba(5,8,12,0.9);
  color: var(--text);
  padding: 1rem;
  border-radius: 10px;
  margin-top: 1rem;
  max-height: 400px;
  overflow-y: auto;
  font-family: ui-monospace, monospace;
  line-height: 1.5;
  border: 1px solid var(--line);
}

.ai-interaction {
  padding: 1rem 1.25rem 1.25rem;
}

.ai-interaction h2 {
  color: var(--green);
  font-family: ui-monospace, monospace;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ============================================================
   Modal
   ============================================================ */

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--panel-2);
  color: var(--text);
  padding: 30px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  z-index: 9999;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.modal h3 {
  margin-top: 0;
  color: var(--accent-2);
}

.modal .close-button {
  background: var(--accent);
  color: #1a0e00;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  float: right;
  border: none;
}

.modal .close-button:hover {
  background: var(--accent-3);
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 768px) {
  .container {
    padding: 20px 10px;
  }

  nav {
    flex-direction: column;
    align-items: flex-start;
  }

  nav a {
    margin: 8px 0;
  }

  form {
    padding: 16px;
  }
}

/* === Dark select dropdowns === */
select {
  appearance: none;
  -webkit-appearance: none;
  background-color: #0d1520 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238a96a8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px !important;
  color: #edf2f8 !important;
  border: 1px solid rgba(150, 180, 210, 0.2) !important;
  border-radius: 10px;
  cursor: pointer;
}
select:focus {
  outline: none;
  border-color: #b8860b !important;
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.15);
}
select option {
  background-color: #0d1520;
  color: #edf2f8;
}
/* Tailwind override for select elements */
.bg-zinc-700 select,
select.bg-zinc-700,
.bg-zinc-800 select,
select.bg-zinc-800 {
  background-color: #0d1520 !important;
  color: #edf2f8 !important;
}
