﻿/* ============================================
   MANZIL — Reusable Components
   ============================================ */

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  font-weight: 800;
  letter-spacing: -0.2px;
  border-radius: var(--r-full);
  transition: transform var(--dur-short) var(--ease),
              opacity var(--dur-short) var(--ease);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  height: 56px;
  padding: 0 var(--s-6);
  background: var(--black);
  color: #FFFFFF;
  font-size: 15px;
  box-shadow: var(--sh-black);
  width: 100%;
}
.btn-primary:active { transform: scale(0.98); }

.btn-neon {
  height: 44px;
  padding: 0 22px;
  background: var(--neon);
  color: var(--black);
  font-size: 14px;
  box-shadow: 0 4px 16px var(--neon-glow);
}
.btn-neon:active { transform: scale(0.97); }

.btn-ghost {
  height: 44px;
  padding: 0 var(--s-4);
  background: transparent;
  color: var(--text-1);
  font-size: 14px;
}

.btn-danger {
  height: 56px;
  padding: 0 var(--s-6);
  background: var(--danger);
  color: #FFFFFF;
  font-size: 15px;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.35);
  width: 100%;
}

/* ---------- ICON BUTTON ---------- */
.icon-btn {
  width: 46px;
  height: 46px;
  background: var(--white);
  border-radius: var(--r-full);
  box-shadow: var(--sh-soft), var(--sh-inset);
  display: grid;
  place-items: center;
  transition: transform var(--dur-short) var(--ease);
  flex-shrink: 0;
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-1);
  stroke-width: 2.2;
  fill: none;
}

/* ---------- INPUT ---------- */
.input {
  height: 58px;
  width: 100%;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 0 var(--s-5);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-1);
  transition: border-color var(--dur-short) var(--ease);
}
.input::placeholder { color: var(--text-3); font-weight: 500; }
.input:focus { border-color: var(--neon); }

/* ---------- CARD ---------- */
.card {
  background: var(--white);
  border-radius: var(--r-xl);
  padding: var(--s-4);
  box-shadow: var(--sh-card), var(--sh-inset);
}
.card-dark {
  background: var(--black);
  color: #FFFFFF;
  border-radius: var(--r-2xl);
  padding: var(--s-4);
  box-shadow: var(--sh-black);
}

/* ---------- BADGE ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: 5px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: #B45309; }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-neon    { background: var(--neon);       color: var(--black); }
.badge-info    { background: var(--info-bg);    color: var(--info); }

/* ---------- SEARCH BAR ---------- */
.search-bar {
  height: 62px;
  background: var(--white);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-card), var(--sh-inset);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 0 var(--s-5);
  cursor: pointer;
  transition: transform var(--dur-short) var(--ease);
}
.search-bar:active { transform: scale(0.99); }
.search-bar svg { width: 20px; height: 20px; stroke: var(--text-2); stroke-width: 2.2; fill: none; flex-shrink: 0; }
.search-bar span { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; color: var(--text-3); }

/* ---------- TOAST ---------- */
#toast-container {
  position: fixed;
  top: max(env(safe-area-inset-top), 20px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  pointer-events: none;
}
.toast {
  background: var(--black);
  color: #FFFFFF;
  padding: 12px 20px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
  animation: toastIn var(--dur-med) var(--spring);
  pointer-events: auto;
}
.toast.out { animation: toastOut var(--dur-std) var(--ease) forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(-20px); }
}

/* ---------- MODAL ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: grid;
  place-items: center;
  z-index: 9000;
  padding: var(--s-5);
  animation: fadeIn var(--dur-std) var(--ease);
}
.modal-card {
  background: var(--white);
  border-radius: var(--r-3xl);
  padding: var(--s-6);
  max-width: 340px;
  width: 100%;
  box-shadow: var(--sh-float);
  animation: modalIn var(--dur-med) var(--spring);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

/* ---------- BOTTOM SHEET ---------- */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 8000;
  animation: fadeIn var(--dur-std) var(--ease);
}
.sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 500px;
  background: var(--elevated);
  border-radius: var(--r-3xl) var(--r-3xl) 0 0;
  padding: var(--s-6) 22px max(env(safe-area-inset-bottom), var(--s-5));
  box-shadow: 0 -8px 32px rgba(0,0,0,0.06);
  z-index: 8001;
  animation: sheetIn var(--dur-med) var(--ease);
  max-height: 90dvh;
  overflow-y: auto;
}
.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border-strong);
  border-radius: var(--r-full);
  margin: 0 auto var(--s-5);
}
@keyframes sheetIn {
  from { transform: translate(-50%, 100%); }
  to   { transform: translate(-50%, 0); }
}

/* ---------- OTP INPUT ---------- */
.otp-group {
  display: flex;
  gap: var(--s-3);
  justify-content: center;
}
.otp-box {
  width: 56px;
  height: 64px;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  color: var(--text-1);
  transition: border-color var(--dur-short) var(--ease),
              background-color var(--dur-short) var(--ease);
  caret-color: var(--neon);
}
.otp-box:focus { border-color: var(--neon); outline: none; }
.otp-box.filled {
  border-color: var(--neon);
  background: var(--neon-soft);
}

/* ---------- AVATAR ---------- */
.avatar {
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--neon), var(--neon-dim));
  color: var(--black);
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar-sm { width: 40px; height: 40px; font-size: 14px; }
.avatar-md { width: 56px; height: 56px; font-size: 20px; }
.avatar-lg { width: 96px; height: 96px; font-size: 32px; border: 3px solid var(--bg); }

/* ---------- SKELETON ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--elevated) 0%, var(--bg) 50%, var(--elevated) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-md);
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ---------- PILLS ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: 8px 16px;
  border-radius: var(--r-full);
  background: var(--white);
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--dur-short) var(--ease);
  white-space: nowrap;
}
.pill.active {
  background: var(--black);
  color: #FFFFFF;
  border-color: var(--black);
}

/* ---------- DIVIDER ---------- */
.divider {
  height: 1px;
  background: var(--border);
  margin: var(--s-4) 0;
}
