/* ============================================
   VulnBank — Design System v2 (Green Edition)
   Green brand palette, light/dark mode
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ================================================
   TOKENS — LIGHT MODE (default)
   ================================================ */
:root {
  /* Brand — İndi yaşıl tonlarındadır (Emerald) */
  --brand: #10B981;
  --brand-light: #34D399;
  --brand-dark: #059669;
  --accent: #10B981;
  --accent-dim: #059669;
  --accent-text: #FFFFFF;

  /* Green Scale (Köhnə navy rənglərinin yerinə) */
  --navy-50:  #ECFDF5;
  --navy-100: #D1FAE5;
  --navy-200: #A7F3D0;
  --navy-300: #6EE7B7;
  --navy-400: #34D399;
  --navy-500: #10B981;
  --navy-600: #059669;
  --navy-700: #047857;
  --navy-800: #065F46;
  --navy-900: #064E3B;
  --navy-950: #022C22;

  /* Surface (light) */
  --bg:        #F6FBF9; /* Bir az yaşıl çalar qatıldı */
  --surface:   #FFFFFF;
  --surface-2: #F0F5F3;
  --surface-3: #E8F0ED;
  --border:    #E2EDEA;
  --border-2:  #D0DDD9;

  /* Text (light) */
  --text-1:    #062019;
  --text-2:    #3D4F4A;
  --text-3:    #6B7A75;
  --text-4:    #9BA7A2;

  /* Semantic */
  --green:      #10B981;
  --green-bg:   #ECFDF5;
  --green-text: #065F46;
  --red:        #EF4444;
  --red-bg:     #FEF2F2;
  --red-text:   #991B1B;
  --amber:      #F59E0B;
  --amber-bg:   #FFFBEB;
  --amber-text: #92400E;
  --sky:        #0EA5E9;
  --sky-bg:     #F0F9FF;
  --sky-text:   #075985;

  /* Sidebar (Tünd yaşıl/Forest tonu) */
  --sidebar-bg:      #064E3B;
  --sidebar-surface: rgba(255,255,255,0.06);
  --sidebar-border:  rgba(255,255,255,0.06);
  --sidebar-text-1:  rgba(255,255,255,0.9);
  --sidebar-text-2:  rgba(255,255,255,0.5);
  --sidebar-text-3:  rgba(255,255,255,0.3);
  --sidebar-hover:   rgba(255,255,255,0.08);
  --sidebar-active:  rgba(255,255,255,0.12);

  /* Typography */
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body:    'Outfit', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* Radii */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   20px;
  --r-2xl:  28px;
  --r-full: 9999px;

  /* Shadows (light) */
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.05), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg:  0 10px 32px rgba(0,0,0,0.07), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-xl:  0 20px 60px rgba(0,0,0,0.10), 0 4px 16px rgba(0,0,0,0.04);
  --shadow-glow: 0 0 20px rgba(16,185,129,0.15);

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 150ms;
  --dur-mid:  250ms;
  --dur-slow: 500ms;

  /* Layout */
  --sidebar-w: 260px;
  --topbar-h:  64px;
}

/* ================================================
   DARK MODE
   ================================================ */
[data-theme="dark"] {
  --bg:         #040D0B;
  --surface:    #0B1A16;
  --surface-2:  #11251F;
  --surface-3:  #1A2E28;
  --border:     #1E362F;
  --border-2:   #2A473E;

  --text-1:     #E2EFEB;
  --text-2:     #9FB1AB;
  --text-3:     #6D847D;
  --text-4:     #3D564F;

  --green-bg:   rgba(16,185,129,0.1);
  --green-text: #6EE7B7;
  --red-bg:     rgba(239,68,68,0.1);
  --red-text:   #FCA5A5;
  --amber-bg:   rgba(245,158,11,0.1);
  --amber-text: #FCD34D;
  --sky-bg:     rgba(14,165,233,0.1);
  --sky-text:   #7DD3FC;

  --shadow-sm:  0 1px 2px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg:  0 10px 32px rgba(0,0,0,0.5);
  --shadow-xl:  0 20px 60px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 30px rgba(16,185,129,0.12);
}

/* Legacy aliases */
:root {
  --primary-color: var(--brand);
  --primary-dark:  var(--navy-900);
  --secondary-color: var(--green);
  --danger-color:  var(--red);
  --warning-color: var(--amber);
  --success-color: var(--green);
  --info-color:    var(--sky);
  --text-color:    var(--text-1);
  --text-light:    var(--text-3);
  --text-dark:      var(--text-1);
  --background-color: var(--bg);
  --border-color:  var(--border);
  --shadow-color:  rgba(0,0,0,0.06);
}

/* ================================================
   RESET
   ================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-1);
  background: var(--bg);
  transition: background var(--dur-mid) ease, color var(--dur-mid) ease;
}

/* ================================================
   SKIP LINK & ACCESSIBILITY
   ================================================ */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 10000;
  padding: 0.75rem 1.25rem; background: var(--brand); color: #fff;
  font-weight: 700; border-radius: 0 0 var(--r-md) 0; text-decoration: none;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ================================================
   TYPOGRAPHY
   ================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-1);
  letter-spacing: -0.02em;
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.625rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.0625rem; }
p  { color: var(--text-2); margin-bottom: 0; }
a  { color: var(--brand); text-decoration: none; transition: color var(--dur-fast) ease; }
a:hover { color: var(--brand-light); }
.mono { font-family: var(--font-mono); letter-spacing: 0.03em; }

/* ================================================
   BUTTONS
   ================================================ */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-family: var(--font-body); font-size: 0.875rem; font-weight: 600; line-height: 1.4;
  border: none; border-radius: var(--r-md); cursor: pointer;
  transition: all var(--dur-fast) ease; white-space: nowrap;
}

.btn-primary, button[type="submit"] {
  background: var(--navy-800); color: #fff;
}
.btn-primary:hover, button[type="submit"]:hover {
  background: var(--navy-700); transform: translateY(-1px); box-shadow: var(--shadow-md);
}
[data-theme="dark"] .btn-primary, [data-theme="dark"] button[type="submit"] {
  background: var(--brand-light); color: #062019;
}
[data-theme="dark"] .btn-primary:hover, [data-theme="dark"] button[type="submit"]:hover {
  background: var(--brand);
}

.btn-primary:active, button[type="submit"]:active { transform: scale(0.97); box-shadow: none; }

.btn-accent {
  background: var(--accent); color: var(--accent-text);
}
.btn-accent:hover { background: var(--accent-dim); }

.btn-secondary {
  background: var(--surface); color: var(--text-1); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { background: var(--surface-2); border-color: var(--border-2); }

.btn-ghost { background: transparent; color: var(--text-2); padding: 0.5rem 0.75rem; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text-1); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #DC2626; }

.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #059669; }

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.75rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* ================================================
   FORM ELEMENTS
   ================================================ */
label {
  display: block; font-size: 0.8125rem; font-weight: 600;
  color: var(--text-2); margin-bottom: 0.375rem;
}
input[type="text"], input[type="password"], input[type="email"],
input[type="number"], input[type="url"], select, textarea {
  width: 100%; padding: 0.625rem 0.875rem;
  font-family: var(--font-body); font-size: 0.9375rem;
  color: var(--text-1); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-md);
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease, background var(--dur-mid) ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.12);
}
input::placeholder, textarea::placeholder { color: var(--text-4); }
.form-group { margin-bottom: 1.25rem; }
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }

/* ================================================
   CARDS
   ================================================ */
.card {
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  transition: background var(--dur-mid) ease, border-color var(--dur-mid) ease;
}

/* ================================================
   TABLES
   ================================================ */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.75rem 1rem; text-align: left; font-size: 0.875rem; }
th {
  font-weight: 600; color: var(--text-3); background: var(--surface-2);
  border-bottom: 1px solid var(--border); font-size: 0.6875rem;
  text-transform: uppercase; letter-spacing: 0.06em;
}
td { border-bottom: 1px solid var(--border); color: var(--text-2); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); }

/* ================================================
   NOTIFICATIONS
   ================================================ */
#message:empty { display: none; }
#message {
  padding: 0.875rem 1rem; border-radius: var(--r-md);
  font-size: 0.875rem; font-weight: 500; margin-bottom: 1.25rem;
  animation: slideDown var(--dur-mid) var(--ease);
}
#message.success { background: var(--green-bg); color: var(--green-text); border-left: 3px solid var(--green); }
#message.error   { background: var(--red-bg);   color: var(--red-text);   border-left: 3px solid var(--red); }
@keyframes slideDown { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }

/* ================================================
   BADGES
   ================================================ */
.badge {
  display: inline-flex; align-items: center; padding: 0.2rem 0.625rem;
  border-radius: var(--r-full); font-size: 0.6875rem; font-weight: 600;
}
.badge-success { background: var(--green-bg); color: var(--green-text); }
.badge-danger  { background: var(--red-bg);   color: var(--red-text); }
.badge-warning { background: var(--amber-bg); color: var(--amber-text); }
.badge-info    { background: var(--sky-bg);   color: var(--sky-text); }
.badge-neutral { background: var(--surface-2); color: var(--text-3); }

.status-pending  { background: var(--amber-bg); color: var(--amber-text); padding: 0.2rem 0.625rem; border-radius: var(--r-full); font-size: 0.6875rem; font-weight: 600; }
.status-approved { background: var(--green-bg); color: var(--green-text); padding: 0.2rem 0.625rem; border-radius: var(--r-full); font-size: 0.6875rem; font-weight: 600; }

/* ================================================
   PAGINATION
   ================================================ */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 1rem; margin-top: 0.5rem; border-top: 1px solid var(--border); font-size: 0.8125rem;
}
.page-summary { color: var(--text-3); }
.page-controls { display: flex; align-items: center; gap: 0.5rem; }
.page-link {
  padding: 0.375rem 0.75rem; border: 1px solid var(--border); border-radius: var(--r-sm);
  font-size: 0.8125rem; font-weight: 600; color: var(--text-2); background: var(--surface);
  transition: all var(--dur-fast) ease;
}
.page-link:hover { background: var(--surface-2); border-color: var(--border-2); color: var(--text-1); }
.page-info { font-weight: 600; color: var(--text-3); }

/* ================================================
   LOADING SPINNER
   ================================================ */
.loading-spinner {
  display: inline-block; width: 32px; height: 32px;
  border: 3px solid var(--border); border-radius: 50%;
  border-top-color: var(--brand); animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================
   THEME TOGGLE (iOS-style switch with icons)
   ================================================ */
.theme-toggle {
  width: 70px; height: 28px; position: relative;
  background: var(--border-2); border-radius: var(--r-full);
  cursor: pointer; transition: background var(--dur-mid) ease;
  border: none; padding: 0;
}
.theme-toggle:hover { background: var(--border); }
.theme-toggle .toggle-icon {
  position: absolute; top: 50%; transform: translateY(-50%);
  font-size: 14px; z-index: 1; pointer-events: none;
  width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-full);
}
.theme-toggle .toggle-icon-sun { left: 4px; background: #FFA500; }
.theme-toggle .toggle-icon-moon { right: 4px; background: #064E3B; color: #E8ECF1; }
.theme-toggle .toggle-slider {
  position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px;
  background: #fff; border-radius: var(--r-full);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: transform var(--dur-mid) ease; z-index: 2;
}
[data-theme="dark"] .theme-toggle { background: var(--brand); }
[data-theme="dark"] .theme-toggle:hover { background: var(--brand-dark); }
[data-theme="dark"] .theme-toggle .toggle-slider { transform: translateX(42px); }

/* ================================================
   UTILITIES
   ================================================ */
.text-center { text-align: center; }
.hidden { display: none !important; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }
img { max-width: 100%; height: auto; }

/* ================================================
   REVEAL ANIMATION
   ================================================ */
.reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}
.reveal.revealed { opacity: 1; transform: translateY(0); }
