/* ===========================================
   NaijaFreelancer Global Theme (Light + Dark)
   File: /assets/css/nf-theme.css
   =========================================== */

/* Base colour tokens */
:root {
  color-scheme: light dark;

  /* Brand */
  --nf-green: #004225;
  --nf-green-soft: #0b7d4b;
  --nf-cream: #fdf5e6;

  /* Light palette */
  --nf-bg: #f3f4f6;
  --nf-bg-soft: #e5e7eb;
  --nf-card-bg: #ffffff;
  --nf-header-bg: #004225;
  --nf-header-text: #f9fafb;
  --nf-text: #111827;
  --nf-text-soft: #6b7280;
  --nf-border: #e5e7eb;

  /* Dark palette */
  --nf-bg-dark: #020617;
  --nf-bg-soft-dark: #020617;
  --nf-card-bg-dark: #020617;
  --nf-header-bg-dark: #020617;
  --nf-header-text-dark: #e5e7eb;
  --nf-text-dark: #e5e7eb;
  --nf-text-soft-dark: #9ca3af;
  --nf-border-dark: #1f2937;

  --nf-radius-lg: 18px;
  --nf-radius-md: 12px;
  --nf-shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* Default = light (JS will set data-theme) */
html[data-theme="light"],
html:not([data-theme]) {
  --nf-page-bg: var(--nf-bg);
  --nf-page-bg-soft: var(--nf-bg-soft);
  --nf-card-current: var(--nf-card-bg);
  --nf-header-current: var(--nf-header-bg);
  --nf-header-text-current: var(--nf-header-text);
  --nf-text-current: var(--nf-text);
  --nf-text-soft-current: var(--nf-text-soft);
  --nf-border-current: var(--nf-border);
}

/* Dark mode */
html[data-theme="dark"] {
  color-scheme: dark;
  --nf-page-bg: var(--nf-bg-dark);
  --nf-page-bg-soft: var(--nf-bg-soft-dark);
  --nf-card-current: var(--nf-card-bg-dark);
  --nf-header-current: var(--nf-header-bg-dark);
  --nf-header-text-current: var(--nf-header-text-dark);
  --nf-text-current: var(--nf-text-dark);
  --nf-text-soft-current: var(--nf-text-soft-dark);
  --nf-border-current: var(--nf-border-dark);
}

/* =========================
   Global page + typography
   ========================= */

body {
  background: radial-gradient(circle at top, #fdfcf8 0%, var(--nf-page-bg) 50%, var(--nf-page-bg-soft) 100%);
  color: var(--nf-text-current);
}

/* Let Tailwind text classes still work but adjust greys in dark mode */
html[data-theme="dark"] body {
  background: radial-gradient(circle at top, #020617 0%, #020617 40%, #020617 100%);
}

html[data-theme="dark"] .text-gray-800,
html[data-theme="dark"] .text-gray-700 {
  color: var(--nf-text-current) !important;
}

html[data-theme="dark"] .text-gray-600,
html[data-theme="dark"] .text-gray-500,
html[data-theme="dark"] .text-gray-400 {
  color: var(--nf-text-soft-current) !important;
}

/* Background overrides for main surfaces */
html[data-theme="dark"] body.bg-gray-100 {
  background-color: #020617 !important;
}

html[data-theme="dark"] header.bg-white {
  background-color: var(--nf-header-current) !important;
}

html[data-theme="dark"] .bg-white {
  background-color: var(--nf-card-current) !important;
}

/* Borders in dark */
html[data-theme="dark"] .border,
html[data-theme="dark"] .border-b,
html[data-theme="dark"] .border-t,
html[data-theme="dark"] .border-l,
html[data-theme="dark"] .border-r {
  border-color: var(--nf-border-current) !important;
}

/* =========================
   Premium header
   ========================= */

header {
  background: var(--nf-header-current);
  color: var(--nf-header-text-current);
  border-bottom: 3px solid rgba(0, 0, 0, 0.15);
}

header h1 {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.03em;
}

header p {
  color: rgba(241, 245, 249, 0.8);
}

/* =========================
   Theme toggle button (top-right)
   ========================= */

#themeToggleBtn {
  border-radius: 999px;
  border-width: 1px;
  border-style: solid;
  border-color: rgba(148, 163, 184, 0.7);
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(15, 23, 42, 0.06);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

#themeToggleBtn:hover {
  background: rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.25);
}

html[data-theme="dark"] #themeToggleBtn {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(148, 163, 184, 0.5);
}

/* =========================
   Premium cards & stats
   ========================= */

/* Glass-style main card */
.nf-card-pro {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--nf-radius-lg);
  box-shadow: var(--nf-shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.8);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nf-card-pro:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.25);
}

/* Dark mode card */
html[data-theme="dark"] .nf-card-pro {
  background: rgba(15, 23, 42, 0.8);
  border-color: rgba(30, 64, 175, 0.3);
}

/* Stat tiles */
.stat-pro {
  background: var(--nf-card-current);
  border-radius: 16px;
  padding: 1.1rem;
  text-align: center;
  border: 1px solid var(--nf-border-current);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-pro:hover {
  transform: scale(1.03);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.22);
}

/* Titles inside stats */
.stat-pro p {
  font-size: 0.8rem;
  color: var(--nf-text-soft-current);
}

.stat-pro h3 {
  font-size: 1.6rem;
}

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

/* Solid brand button */
.btn-pro {
  background: linear-gradient(to right, var(--nf-green), var(--nf-green-soft));
  color: #ffffff !important;
  border-radius: 999px;
  padding: 0.4rem 1.1rem;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border: none;
  box-shadow: 0 10px 22px rgba(4, 120, 87, 0.35);
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
}

.btn-pro:hover {
  opacity: 0.93;
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(4, 120, 87, 0.45);
}

/* Outline brand button */
.btn-pro-outline {
  border-radius: 999px;
  padding: 0.4rem 1.1rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1.5px solid var(--nf-green-soft);
  background: transparent;
  color: var(--nf-green-soft);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.btn-pro-outline:hover {
  background: var(--nf-green-soft);
  color: #ffffff;
}

/* Disabled */
.btn-pro[disabled],
.btn-pro-outline[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Logout button style in header (keep red but nicer) */
header #logoutBtn {
  border-radius: 999px;
  font-size: 0.8rem;
}

/* =========================
   Tabs
   ========================= */

.tabButton {
  background: rgba(148, 163, 184, 0.2);
  font-weight: 600;
  border-radius: 999px;
  padding-inline: 0.9rem;
  padding-block: 0.4rem;
  font-size: 0.8rem;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s;
}

.tabButton:hover {
  transform: translateY(-1px);
}

.active-tab {
  background-color: var(--nf-green-soft) !important;
  color: #ffffff !important;
}

/* Dark mode tab background */
html[data-theme="dark"] .tabButton {
  background: rgba(30, 64, 175, 0.18);
}

/* =========================
   Charts & progress
   ========================= */

#targetBar {
  transition: width 0.6s ease;
}

/* =========================
   Loader
   ========================= */

.loader {
  border: 3px solid var(--nf-border-current);
  border-top-color: transparent;
  border-radius: 9999px;
  width: 1.25rem;
  height: 1.25rem;
  animation: spin 0.8s linear infinite;
}

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

/* =========================
   Modal & watermark
   ========================= */

#modal {
  align-items: flex-start;
  padding-top: 6rem;
}

/* Enhance glassy modal box */
.modal-box {
  animation: slideUp 0.25s ease-out;
  border-radius: var(--nf-radius-lg);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
}

html[data-theme="dark"] .modal-box {
  background-color: rgba(15, 23, 42, 0.92) !important;
  color: var(--nf-text-current);
}

@keyframes slideUp {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Watermark in PDF card */
.watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0.06;
  font-size: 6rem;
  transform: rotate(-30deg);
  color: var(--nf-text-soft-current);
}

/* =========================
   Tables (earnings/history)
   ========================= */

table {
  border-collapse: collapse;
}

/* Light hover effect on rows */
tbody tr:hover {
  background-color: rgba(148, 163, 184, 0.07);
}

html[data-theme="dark"] tbody tr:hover {
  background-color: rgba(31, 41, 55, 0.9);
}

/* =========================
   Small helpers
   ========================= */

.nf-muted {
  color: var(--nf-text-soft-current);
  font-size: 0.8rem;
}