/* ================================================================
   HuzaHub Design System
   Brand: Blue (#2563eb) + Yellow (#f59e0b)
   Huza = Blue | Hub = Yellow
================================================================ */

/* ── Google Fonts ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@700;800;900&display=swap');

/* ── CSS Variables ───────────────────────────────────────────── */
:root {
  /* Brand */
  --blue:        #2563eb;
  --blue-dark:   #1d4ed8;
  --blue-light:  #eff6ff;
  --blue-mid:    #dbeafe;
  --yellow:      #f59e0b;
  --yellow-dark: #d97706;
  --yellow-light:#fffbeb;
  --yellow-mid:  #fef3c7;

  /* Neutrals */
  --white:       #ffffff;
  --slate-50:    #f8fafc;
  --slate-100:   #f1f5f9;
  --slate-200:   #e2e8f0;
  --slate-300:   #cbd5e1;
  --slate-400:   #94a3b8;
  --slate-500:   #64748b;
  --slate-600:   #475569;
  --slate-700:   #334155;
  --slate-800:   #1e293b;
  --slate-900:   #0f172a;

  /* Semantic */
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;
  --border:         #e2e8f0;
  --border-focus:   #2563eb;
  --bg:             #f8fafc;
  --card-bg:        #ffffff;
  --success:        #10b981;
  --danger:         #ef4444;
  --warning:        #f59e0b;
  --info:           #3b82f6;

  /* Shadows */
  --shadow-sm:   0 1px 2px rgba(0,0,0,.05);
  --shadow:      0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
  --shadow-md:   0 4px 12px rgba(0,0,0,.08), 0 8px 32px rgba(0,0,0,.06);
  --shadow-lg:   0 8px 24px rgba(0,0,0,.1), 0 16px 48px rgba(0,0,0,.08);
  --shadow-blue: 0 4px 16px rgba(37,99,235,.25);

  /* Radii */
  --r-sm:  8px;
  --r:     12px;
  --r-lg:  16px;
  --r-xl:  24px;
  --r-full: 999px;

  /* Transitions */
  --t:     all .2s cubic-bezier(.4,0,.2,1);
  --t-fast:all .15s cubic-bezier(.4,0,.2,1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,h2,h3,h4,h5,h6 {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  letter-spacing: -.02em;
  line-height: 1.2;
  color: var(--text-primary);
}

a { color: var(--blue); text-decoration: none; transition: var(--t-fast); }
a:hover { color: var(--blue-dark); }

img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--slate-400); }

/* ── Page Animations ─────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideRight {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.95); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .5; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.animate-fade-up   { animation: fadeUp .4s ease both; }
.animate-fade-in   { animation: fadeIn .3s ease both; }
.animate-slide-down{ animation: slideDown .25s ease both; }
.animate-scale-in  { animation: scaleIn .2s ease both; }
.animate-float     { animation: float 3s ease-in-out infinite; }

/* Stagger delays */
.delay-1 { animation-delay: .05s; }
.delay-2 { animation-delay: .1s; }
.delay-3 { animation-delay: .15s; }
.delay-4 { animation-delay: .2s; }
.delay-5 { animation-delay: .25s; }

/* ── Layout ──────────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.container-sm { max-width: 800px; margin: 0 auto; padding: 0 24px; }
.container-xs { max-width: 480px; margin: 0 auto; padding: 0 24px; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 600;
  border: none;
  outline: none;
  cursor: pointer;
  transition: var(--t);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background .15s;
}
.btn:hover::after { background: rgba(255,255,255,.08); }
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: var(--shadow-blue);
}
.btn-primary:hover {
  background: var(--blue-dark);
  box-shadow: 0 6px 20px rgba(37,99,235,.35);
  transform: translateY(-1px);
  color: #fff;
}

.btn-yellow {
  background: var(--yellow);
  color: #fff;
  box-shadow: 0 4px 12px rgba(245,158,11,.3);
}
.btn-yellow:hover {
  background: var(--yellow-dark);
  transform: translateY(-1px);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--blue);
  color: var(--blue);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}
.btn-ghost:hover { background: var(--slate-100); color: var(--text-primary); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; transform: translateY(-1px); color: #fff; }

.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: var(--r-sm); }
.btn-lg { padding: 13px 28px; font-size: 15px; border-radius: var(--r-lg); }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: var(--r); }
.btn-block { width: 100%; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  transition: var(--t);
}
.card-hover:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card-body { padding: 24px; }
.card-sm .card-body { padding: 16px; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.input {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  font-size: 14px;
  color: var(--text-primary);
  font-family: inherit;
  transition: var(--t-fast);
  outline: none;
  line-height: 1.5;
}
.input:hover  { border-color: var(--slate-300); }
.input:focus  { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.input::placeholder { color: var(--text-muted); }
.input.error  { border-color: var(--danger); }
.input.error:focus { box-shadow: 0 0 0 3px rgba(239,68,68,.1); }

textarea.input { resize: vertical; min-height: 100px; }
select.input   { cursor: pointer; 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='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; appearance: none; }

.input-icon { position: relative; }
.input-icon .input { padding-left: 40px; }
.input-icon .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 15px; pointer-events: none; }

.form-error { font-size: 12px; color: var(--danger); margin-top: 5px; display: flex; align-items: center; gap: 4px; }
.form-hint  { font-size: 12px; color: var(--text-muted); margin-top: 5px; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
}
.badge-blue   { background: var(--blue-mid);    color: #1e40af; }
.badge-yellow { background: var(--yellow-mid);  color: #92400e; }
.badge-green  { background: #d1fae5;            color: #065f46; }
.badge-red    { background: #fee2e2;            color: #991b1b; }
.badge-purple { background: #ede9fe;            color: #5b21b6; }
.badge-gray   { background: var(--slate-100);   color: var(--slate-600); }

/* ── Chips / Tags ────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 500;
  background: var(--blue-light);
  color: var(--blue);
  border: 1px solid var(--blue-mid);
  transition: var(--t-fast);
  cursor: default;
}
.chip:hover { background: var(--blue-mid); }
.chip-yellow { background: var(--yellow-light); color: var(--yellow-dark); border-color: var(--yellow-mid); }

/* ── Avatar ──────────────────────────────────────────────────── */
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border-radius: var(--r-full);
  background: var(--blue);
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm  { width: 32px; height: 32px; font-size: 13px; }
.avatar-md  { width: 40px; height: 40px; font-size: 15px; }
.avatar-lg  { width: 56px; height: 56px; font-size: 20px; }
.avatar-xl  { width: 80px; height: 80px; font-size: 28px; }
.avatar-sq  { border-radius: var(--r); }

/* ── Stars ───────────────────────────────────────────────────── */
.stars { display: flex; gap: 2px; align-items: center; }
.star  { color: var(--yellow); font-size: 13px; }
.star-empty { color: var(--slate-200); }

/* ── Alert / Flash ───────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideDown .25s ease;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info    { background: var(--blue-light); color: #1e40af; border: 1px solid var(--blue-mid); }
.alert-warning { background: var(--yellow-light); color: #92400e; border: 1px solid var(--yellow-mid); }

/* ── Toast ───────────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  min-width: 300px;
  max-width: 420px;
  padding: 14px 18px;
  border-radius: var(--r-lg);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  animation: slideRight .3s ease;
  cursor: pointer;
}
.toast-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.toast-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.toast-info    { background: var(--blue-light); color: #1e40af; border: 1px solid var(--blue-mid); }

/* ── Skeleton Loader ─────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--slate-100) 25%, var(--slate-200) 50%, var(--slate-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r);
}

/* ── Table ───────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  background: var(--slate-50);
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--slate-50); }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; }
.page-btn {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid var(--border);
  transition: var(--t-fast);
}
.page-btn:hover  { border-color: var(--blue); color: var(--blue); }
.page-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.page-btn[disabled] { opacity: .4; cursor: not-allowed; }

/* ── Empty State ─────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
}
.empty-icon { font-size: 40px; margin-bottom: 16px; }
.empty h3 { font-size: 16px; color: var(--text-secondary); margin-bottom: 8px; }
.empty p  { font-size: 14px; max-width: 320px; margin: 0 auto 20px; }

/* ── Dropdown ────────────────────────────────────────────────── */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  overflow: hidden;
  z-index: 100;
  animation: scaleIn .15s ease;
  transform-origin: top right;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--t-fast);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  font-family: inherit;
  text-align: left;
}
.dropdown-item:hover { background: var(--slate-50); color: var(--blue); }
.dropdown-item.danger:hover { background: #fef2f2; color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .2s ease;
}
.modal {
  background: var(--white);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  max-width: 520px;
  width: 100%;
  animation: scaleIn .2s ease;
}
.modal-header { padding: 20px 24px 16px; border-bottom: 1px solid var(--border); }
.modal-body   { padding: 20px 24px; }
.modal-footer { padding: 16px 24px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ── Toggle Switch ───────────────────────────────────────────── */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  display: inline-block;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--slate-300);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: var(--t);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: var(--t);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle input:checked + .toggle-slider { background: var(--blue); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Progress Bar ────────────────────────────────────────────── */
.progress { height: 6px; background: var(--slate-100); border-radius: var(--r-full); overflow: hidden; }
.progress-bar { height: 100%; background: var(--blue); border-radius: var(--r-full); transition: width .4s ease; }
.progress-yellow .progress-bar { background: var(--yellow); }
.progress-green  .progress-bar { background: var(--success); }

/* ── Section heading ─────────────────────────────────────────── */
.section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--blue);
  margin-bottom: 8px;
}

/* ── Utilities ───────────────────────────────────────────────── */
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.flex-wrap   { flex-wrap: wrap; }
.gap-2       { gap: 8px; }
.gap-3       { gap: 12px; }
.gap-4       { gap: 16px; }
.gap-6       { gap: 24px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-blue   { color: var(--blue); }
.text-yellow { color: var(--yellow); }
.text-green  { color: var(--success); }
.text-red    { color: var(--danger); }
.text-sm     { font-size: 13px; }
.text-xs     { font-size: 12px; }
.text-lg     { font-size: 16px; }

.font-bold   { font-weight: 700; }
.font-semi   { font-weight: 600; }
.font-medium { font-weight: 500; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.p-4  { padding: 16px; }
.p-6  { padding: 24px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }

.w-full  { width: 100%; }
.h-full  { height: 100%; }
.hidden  { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }
.overflow-hidden { overflow: hidden; }

/* Divider */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .grid-3 { grid-template-columns: repeat(2,1fr); }
  .lg-hide { display: none; }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .container, .container-sm { padding: 0 16px; }
  .md-hide { display: none; }
  .md-stack { flex-direction: column; }
}
@media (max-width: 480px) {
  .sm-hide { display: none; }
  .btn-lg  { padding: 11px 20px; font-size: 14px; }
}
