/* Wacana — Komponen UI Dasar (PRD Bagian 13) */

/* Tombol */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: background var(--transition-color), border-color var(--transition-color), color var(--transition-color);
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--color-espresso);
  color: var(--color-bg);
}
.btn-primary:hover:not(:disabled) { background: var(--color-espresso-soft); }

.btn-secondary {
  background: transparent;
  border-color: var(--color-border-strong);
  color: var(--color-text);
}
.btn-secondary:hover:not(:disabled) { background: var(--color-surface-soft); }

.btn-destructive {
  background: transparent;
  border-color: var(--color-border-strong);
  color: var(--color-text);
}
.btn-destructive:hover:not(:disabled) { background: var(--color-surface-soft); }

.btn-destructive-solid {
  background: var(--color-espresso);
  color: var(--color-bg);
}
.btn-destructive-solid:hover:not(:disabled) { background: var(--color-espresso-soft); }

.btn-text {
  padding: 4px 2px;
  font-weight: 500;
  color: var(--color-text);
}
.btn-text:hover { text-decoration: underline; }

.btn-full { width: 100%; }
.btn-icon {
  padding: 8px;
  border-radius: 50%;
}
.btn-icon:hover { background: var(--color-surface-soft); }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }

/* Kartu */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

/* Avatar */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--color-surface-soft);
}
.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-espresso);
  color: var(--color-bg);
  font-family: var(--font-display);
  font-weight: 600;
  border-radius: 50%;
  flex-shrink: 0;
}
.avatar-sm { width: 36px; height: 36px; font-size: 0.9rem; }
.avatar-md { width: 48px; height: 48px; font-size: 1.1rem; }
.avatar-lg { width: 88px; height: 88px; font-size: 2rem; }

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--brand-purple);
  color: #2A0E33;
  font-size: 0.7rem;
  font-weight: 700;
}

/* Modal / Dialog */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(56, 42, 33, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  z-index: 200;
}
.modal {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-float);
  padding: var(--space-5);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-title { margin-bottom: var(--space-2); }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

/* Toast */
.toast-region {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--space-3));
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: max-content;
  max-width: 90vw;
}
.toast {
  background: var(--color-espresso);
  color: var(--color-bg);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-toast);
  font-size: 0.9rem;
  animation: toast-in 200ms ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Skeleton */
.skeleton {
  background: var(--color-surface-soft);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skeleton-line { height: 14px; margin-bottom: var(--space-2); width: 100%; }
.skeleton-line.short { width: 40%; }
.skeleton-circle { width: 48px; height: 48px; border-radius: 50%; }

/* Empty / error state */
.state-block {
  text-align: center;
  padding: var(--space-7) var(--space-4);
  color: var(--color-text-secondary);
}
.state-block svg { width: 40px; height: 40px; margin: 0 auto var(--space-3); stroke: var(--color-text-muted); fill: none; stroke-width: 1.5; }
.state-block h3 { margin-bottom: var(--space-1); }
.state-block p { max-width: 320px; margin: 0 auto var(--space-3); }

/* Dropdown */
.dropdown {
  position: relative;
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  min-width: 200px;
  padding: var(--space-1);
  z-index: 150;
}
.dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}
.dropdown-item:hover { background: var(--color-surface-soft); }
.dropdown-item.destructive { color: var(--color-accent); }
.dropdown-divider { height: 1px; background: var(--color-border); margin: var(--space-1) 0; }

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
}
.tab {
  flex: 1;
  text-align: center;
  padding: var(--space-3);
  font-weight: 600;
  color: var(--color-text-secondary);
  border-bottom: 2px solid transparent;
  transition: color var(--transition-color);
}
.tab[aria-selected="true"] {
  color: var(--color-text);
  border-bottom-color: var(--color-text);
}

/* Divider */
.divider { height: 1px; background: var(--color-border); border: none; }

.notif-unread {
  background: var(--brand-purple) !important;
  color: #2A0E33 !important;
}
.notif-unread .text-meta { color: #5A3A66 !important; }
