/* ============================================================
   MaaşAnaliz Component Library — v1.0
   Built on top of design-system.css
   ============================================================ */

/* ---------- 1. BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
  padding: 10px 18px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast),
              box-shadow var(--t-fast), transform var(--t-fast),
              color var(--t-fast);
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: var(--sh-primary);
}
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--sh-primary-lg); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--sh-xs);
}
.btn-secondary:hover { background: var(--surface-hover); border-color: var(--border-strong); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-alt); color: var(--text); }

.btn-danger {
  background: var(--danger);
  color: #FFFFFF;
}
.btn-danger:hover { background: #B91C1C; }

.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn-lg { padding: 13px 24px; font-size: 15px; border-radius: var(--r-lg); }
.btn-xl { padding: 16px 32px; font-size: 16px; border-radius: var(--r-lg); }
.btn-icon { padding: 10px; width: 40px; height: 40px; }
.btn-block { width: 100%; }

/* ---------- 2. CARDS ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
  transition: box-shadow var(--t-smooth), border-color var(--t-smooth);
}
.card-hover:hover { box-shadow: var(--sh-md); border-color: var(--border-strong); }
.card-raised { box-shadow: var(--sh-sm); }
.card-flush { box-shadow: none; border: none; background: transparent; }

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-body { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-hover);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* ---------- 3. INPUTS ---------- */
.input, .select, .textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-tertiary); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.input-error { border-color: var(--danger); }
.input-error:focus { box-shadow: 0 0 0 3px var(--danger-soft); }

.label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.label-required::after { content: ' *'; color: var(--danger); }
.help-text { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }
.error-text { font-size: 12px; color: var(--danger); margin-top: 4px; }

/* ---------- 4. BADGES ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--r-full);
  line-height: 1.4;
}
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-success { background: var(--success-soft); color: var(--success-foreground); }
.badge-warning { background: var(--warning-soft); color: var(--warning-foreground); }
.badge-danger { background: var(--danger-soft); color: var(--danger-foreground); }
.badge-info { background: var(--info-soft); color: var(--info-foreground); }
.badge-neutral { background: var(--bg-alt); color: var(--text-secondary); }

/* ---------- 5. TABLES ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-hover);
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text);
}
.table tbody tr:hover { background: var(--surface-hover); }
.table tbody tr:last-child td { border-bottom: none; }

/* ---------- 6. NAV ITEMS (sidebar) ---------- */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  color: var(--dark-muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast);
  cursor: pointer;
}
.nav-item:hover { background: var(--dark-border); color: var(--dark-foreground); }
.nav-item.active {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: var(--sh-primary);
}
.nav-item-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* ---------- 7. STAT CARD ---------- */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--sh-xs);
  transition: box-shadow var(--t-smooth), transform var(--t-smooth);
}
.stat-card:hover { box-shadow: var(--sh-md); }
.stat-card-label {
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 500;
  margin-bottom: 8px;
}
.stat-card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-card-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  margin-top: 8px;
}
.stat-card-trend.up { color: var(--success); }
.stat-card-trend.down { color: var(--danger); }

/* ---------- 8. SECTION SPACING ---------- */
.section { padding: 48px 0; }
.section-sm { padding: 24px 0; }
.section-lg { padding: 80px 0; }
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 24px; } }
@media (min-width: 1024px) { .container { padding: 0 32px; } }

/* ---------- 9. DIVIDER ---------- */
.divider { height: 1px; background: var(--border); border: none; margin: 0; }
.divider-soft { height: 1px; background: var(--border-subtle); border: none; }

/* ---------- 10. SKELETON ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-alt) 25%, var(--border-subtle) 50%, var(--bg-alt) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- 11. ANIMATION UTILITIES ---------- */
.fade-in { animation: fadeIn var(--t-enter) ease-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.slide-up { animation: slideUp var(--t-enter) ease-out; }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
