/* ═══════════════════════════════════════
   COMPONENTS — Prenoty Vetrina
   Reusable UI components
   ═══════════════════════════════════════ */

/* ═══ BUTTONS ═══ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 20px; border-radius: var(--r-md);
  font-size: .875rem; font-weight: 600;
  transition: all var(--duration) var(--ease);
  white-space: nowrap; border: 1px solid transparent;
  position: relative; overflow: hidden;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: var(--shadow-glow); transform: translateY(-1px); }
.btn-secondary { background: var(--bg-3); color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-4); border-color: var(--border-hover); }
.btn-ghost { color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-3); }
.btn-danger { background: var(--error-muted); color: var(--error); border-color: transparent; }
.btn-danger:hover { background: var(--error); color: #fff; }
.btn-success { background: var(--success-muted); color: var(--success); }
.btn-success:hover { background: var(--success); color: #fff; }
.btn-gradient { background: var(--grad-brand); color: #fff; box-shadow: var(--shadow-glow); }
.btn-gradient:hover { transform: translateY(-2px); box-shadow: 0 0 40px var(--accent-glow); filter: brightness(1.1); }
.btn-sm { padding: 6px 12px; font-size: .78rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-xl { padding: 16px 36px; font-size: 1rem; border-radius: var(--r-full); }
.btn-icon-only { width: 36px; height: 36px; padding: 0; border-radius: var(--r-md); border: 1px solid var(--border); color: var(--text-secondary); display: flex; align-items: center; justify-content: center; transition: all .2s; }
.btn-icon-only:hover { background: var(--bg-4); color: var(--text-primary); border-color: var(--border-hover); }

/* Landing-specific rounded buttons */
.btn-pill { border-radius: var(--r-full); }

/* ═══ CARDS ═══ */
.card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  transition: all .25s var(--ease);
}
[data-theme="light"] .card { box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.card:hover { border-color: var(--border-hover); }
.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-weight: 700; font-size: .95rem; }
.card-body { padding: 24px; }
.card-footer { padding: 16px 24px; border-top: 1px solid var(--border); }

/* ═══ KPI CARDS ═══ */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 28px; }
.kpi {
  padding: 24px; border-radius: var(--r-2xl);
  background: var(--bg-3); border: 1px solid var(--border);
  position: relative; overflow: hidden;
  transition: all .25s var(--ease);
}
[data-theme="light"] .kpi { box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.kpi:hover { border-color: var(--border-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.kpi-icon {
  width: 48px; height: 48px; border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
}
.kpi-icon.purple { background: var(--accent-muted); color: var(--accent); }
.kpi-icon.green { background: var(--success-muted); color: var(--success); }
.kpi-icon.yellow { background: var(--warning-muted); color: var(--warning); }
.kpi-icon.blue { background: var(--info-muted); color: var(--info); }
.kpi-icon.red { background: var(--error-muted); color: var(--error); }
.kpi-change {
  display: flex; align-items: center; gap: 3px;
  font-size: .72rem; font-weight: 600;
  padding: 3px 8px; border-radius: var(--r-full);
}
.kpi-change.up { background: var(--success-muted); color: var(--success); }
.kpi-change.down { background: var(--error-muted); color: var(--error); }
.kpi-value { font-size: 2rem; font-weight: 800; font-family: var(--font-mono); letter-spacing: -.02em; line-height: 1; }
.kpi-label { font-size: .82rem; color: var(--text-tertiary); margin-top: 6px; }

/* ═══ BADGES ═══ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--r-full);
  font-size: .7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .03em;
}
.badge-bronze { background: rgba(205,127,50,.12); color: #CD7F32; }
.badge-silver { background: rgba(192,192,192,.12); color: #C0C0C0; }
.badge-gold { background: rgba(255,215,0,.12); color: #FFD700; }
.badge-success { background: var(--success-muted); color: var(--success); }
.badge-warning { background: var(--warning-muted); color: var(--warning); }
.badge-error { background: var(--error-muted); color: var(--error); }
.badge-info { background: var(--info-muted); color: var(--info); }
.badge-accent { background: var(--accent-muted); color: var(--accent); }

/* ═══ INPUTS ═══ */
.input {
  width: 100%; padding: 10px 14px;
  background: var(--bg-5); border: 1px solid var(--border);
  border-radius: var(--r-md); font-size: .875rem;
  transition: all .2s; color: var(--text-primary);
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-muted); }
.input::placeholder { color: var(--text-muted); }
.input-group { margin-bottom: 16px; }
.input-label { display: block; font-size: .78rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.input-icon-wrap { position: relative; }
.input-icon-wrap .icon-left { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: .9rem; color: var(--text-muted); }
.input-icon-wrap .input { padding-left: 36px; }
.input-error { border-color: var(--error); }
.input-error:focus { box-shadow: 0 0 0 3px var(--error-muted); }
.input-hint { font-size: .75rem; color: var(--text-tertiary); margin-top: 4px; }
.input-error-msg { font-size: .75rem; color: var(--error); margin-top: 4px; display: none; }

/* ═══ TOGGLE ═══ */
.toggle { position: relative; width: 40px; height: 22px; display: inline-block; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--bg-5); border: 1px solid var(--border);
  border-radius: var(--r-full); cursor: pointer; transition: all .2s;
}
.toggle-track::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--text-secondary);
  top: 2px; left: 2px; transition: all .2s var(--ease);
}
.toggle input:checked + .toggle-track { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .toggle-track::before { transform: translateX(18px); background: #fff; }

/* ═══ TABLE ═══ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; font-size: .85rem; white-space: nowrap; }
th {
  font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-3); position: sticky; top: 0;
}
tr { border-bottom: 1px solid rgba(255,255,255,.03); transition: background .15s; }
tr:hover { background: rgba(255,255,255,.02); }
[data-theme="light"] tr { border-bottom: 1px solid var(--border); }
[data-theme="light"] tr:hover { background: rgba(0,0,0,.02); }

/* ═══ STAMPS INDICATOR ═══ */
.stamps-bar { display: flex; gap: 2px; align-items: center; }
.stamps-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--bg-5); transition: background .2s; }
.stamps-dot.on { background: var(--accent); }
.stamps-info { font-size: .7rem; color: var(--text-muted); margin-left: 6px; font-family: var(--font-mono); }

/* ═══ SEARCH BAR ═══ */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; background: var(--bg-5);
  border: 1px solid var(--border); border-radius: var(--r-md);
  transition: all .2s; width: 240px;
}
.search-bar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-muted); }
.search-bar svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.search-bar input { flex: 1; font-size: .85rem; }

/* ═══ COLOR PICKER ═══ */
.color-pick { display: flex; align-items: center; gap: 10px; }
.color-swatch {
  width: 36px; height: 36px; border-radius: var(--r-md);
  border: 2px solid var(--border); cursor: pointer; transition: all .2s;
}
.color-swatch:hover { border-color: var(--border-hover); transform: scale(1.05); }
.color-hex { font-family: var(--font-mono); font-size: .82rem; color: var(--text-secondary); }
input[type="color"] { position: absolute; opacity: 0; width: 0; height: 0; }

/* ═══ TOAST ═══ */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 20px; border-radius: var(--r-md);
  background: var(--bg-3); border: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  min-width: 280px; box-shadow: var(--shadow-lg);
  animation: slideInRight .3s var(--ease);
  font-size: .85rem; font-weight: 500;
}
.toast-icon { font-size: 1rem; }
.toast.ok { border-left: 3px solid var(--success); }
.toast.err { border-left: 3px solid var(--error); }
.toast.info { border-left: 3px solid var(--info); }

/* ═══ CONFIRM DIALOG ═══ */
.confirm-overlay {
  position: fixed; inset: 0; z-index: 8000;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.confirm-overlay.open { display: flex; }
.confirm-box {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 28px; text-align: center;
  max-width: 360px; width: 100%; animation: scaleIn .25s var(--ease);
  box-shadow: var(--shadow-lg);
}
.confirm-icon { font-size: 2.5rem; margin-bottom: 14px; }
.confirm-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 6px; }
.confirm-text { font-size: .88rem; color: var(--text-secondary); margin-bottom: 24px; }
.confirm-btns { display: flex; gap: 10px; justify-content: center; }

/* ═══ CONFETTI ═══ */
.confetti-container { position: fixed; inset: 0; pointer-events: none; z-index: 9999; overflow: hidden; }
.confetti-p { position: absolute; top: -10px; animation: confettiFall 3s linear forwards; }

/* ═══ EMPTY STATE ═══ */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-tertiary); }
.empty-state-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: .5; }
.empty-state-text { font-size: .9rem; }

/* ═══ PROGRESS BAR ═══ */
.progress { height: 6px; background: var(--bg-5); border-radius: var(--r-full); overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: var(--r-full); transition: width .6s var(--ease); }

/* ═══ AVATAR ═══ */
.avatar {
  width: 36px; height: 36px; border-radius: var(--r-full);
  background: var(--grad-brand);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: .7rem; }
.avatar-lg { width: 48px; height: 48px; font-size: 1.1rem; }

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

/* ═══ CHIP ═══ */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: var(--r-full);
  font-size: .75rem; font-weight: 500;
  background: var(--bg-4); color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* ═══ SECTION STYLING (landing) ═══ */
.sec { padding: 100px 0; position: relative; z-index: 1; }
.sec-label {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .16em;
  color: var(--accent); margin-bottom: 16px;
}
.sec-label::before { content: ''; width: 20px; height: 1.5px; background: var(--accent); opacity: .5; }
.sec-title { font-size: clamp(2rem,5vw,3rem); font-weight: 800; line-height: 1.15; margin-bottom: 14px; letter-spacing: -.02em; }
.sec-sub { font-size: 1.05rem; color: var(--text-tertiary); max-width: 560px; }
.sec-header { text-align: center; margin-bottom: 60px; }
.sec-header .sec-sub { margin: 0 auto; }

/* ═══ REVIEW COMPONENTS ═══ */
.review-card-admin {
  padding: 16px 20px; border-radius: var(--r-lg);
  background: var(--bg-3); border: 1px solid var(--border);
  margin-bottom: 8px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  transition: all .2s;
}
.review-card-admin:hover { border-color: var(--border-hover); }
.review-stars { color: var(--warning); font-size: .85rem; letter-spacing: 1px; margin-bottom: 6px; }
.review-text { font-size: .88rem; color: var(--text-secondary); font-style: italic; line-height: 1.6; margin-bottom: 8px; }
.review-meta { display: flex; align-items: center; gap: 8px; font-size: .78rem; }
.review-author { font-weight: 600; color: var(--text-primary); }
.review-date { color: var(--text-muted); font-family: var(--font-mono); }

/* ═══ NOTIFICATION ROW ═══ */
.notif-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.notif-row:last-child { border-bottom: none; }
.notif-row-label { font-weight: 600; font-size: .88rem; }
.notif-row-desc { font-size: .78rem; color: var(--text-tertiary); }

/* ═══ SETTINGS ═══ */
.settings-card {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r-2xl); padding: 28px; margin-bottom: 20px;
}
[data-theme="light"] .settings-card { box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.settings-card-title {
  font-weight: 700; font-size: .95rem; margin-bottom: 20px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ═══ QR SCANNER ═══ */
.qr-scanner-viewport {
  width: 280px; height: 280px; margin: 20px auto;
  border: 2px dashed var(--border); border-radius: var(--r-xl);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  position: relative; overflow: hidden;
  background: repeating-linear-gradient(0deg, transparent, transparent 10px, rgba(99,102,241,.02) 10px, rgba(99,102,241,.02) 20px);
}
.qr-scanner-viewport::after {
  content: ''; position: absolute;
  width: 90%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: scanLine 2s infinite linear; border-radius: 1px;
}
.qr-scanner-corners { position: absolute; inset: 16px; }
.qr-scanner-corners::before, .qr-scanner-corners::after {
  content: ''; position: absolute; width: 24px; height: 24px;
  border-color: var(--accent); border-style: solid;
}
.qr-scanner-corners::before { top: 0; left: 0; border-width: 3px 0 0 3px; border-radius: 4px 0 0 0; }
.qr-scanner-corners::after { top: 0; right: 0; border-width: 3px 3px 0 0; border-radius: 0 4px 0 0; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr; }
}
