/* SHARP Raffle System — Custom Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ─── SHARP Design Tokens ───
   Sharp Red per SHARP Logo (Trademark) Display Manual (Corporate Brand
   Strategy Division, rev. Sep 2024): RGB R230 G0 B13 / PANTONE 186C / CMYK M100+Y80.
   Rule: white background as default; Sharp red surfaces carry reverse (white) content. */
:root {
  --sharp-red:       #E6000D;
  --sharp-red-dark:  #B4000A;
  --sharp-red-deep:  #8A0008;
  --sharp-red-soft:  #FDEBEC;
  --sharp-black:     #111111;
  --sharp-gray-900:  #1F2937;
  --sharp-gray-500:  #6B7280;
  --sharp-gray-100:  #F3F4F6;
  --sharp-white:     #FFFFFF;
  --winner-gold:     #F6C343;
  --success-green:   #22C55E;
  --warning-orange:  #F97316;
  --error-red:       #DC2626;
}

*, *::before, *::after { box-sizing: border-box; }

body { font-family: 'Inter', Arial, Helvetica, sans-serif; }

/* ─── Brand focus ring (menggantikan hack onfocus/onblur inline) ─── */
input:focus, select:focus, textarea:focus {
  border-color: var(--sharp-red) !important;
  box-shadow: 0 0 0 3px rgba(230, 0, 13, 0.12);
  outline: none;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--sharp-red); }
::selection { background: var(--sharp-red); color: #fff; }

/* ─── Brand buttons ─── */
.btn-sharp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--sharp-red);
  color: #fff;
  font-weight: 600;
  border-radius: 8px;
  transition: background-color 0.15s ease;
}
.btn-sharp:hover  { background: var(--sharp-red-dark); }
.btn-sharp:active { background: var(--sharp-red-deep); }

/* ─── Be Original. — motto korporat resmi (titik adalah bagian dari motto) ─── */
.be-original {
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--sharp-black);
}
.be-original::after { content: ''; }
.be-original .dot { color: var(--sharp-red); }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ─── Sidebar — putih sesuai aturan brand (latar putih, aksen Sharp red) ─── */
#sidebar {
  transition: width 0.3s ease, transform 0.3s ease;
  min-height: 100vh;
  background: #fff;
  border-right: 1px solid #e5e7eb;
}
#sidebar.collapsed { width: 0 !important; overflow: hidden; }

/* ─── Nav active item ─── */
.nav-item { position: relative; }
.nav-item.active {
  background-color: var(--sharp-red) !important;
  color: #fff !important;
}
.nav-item.active svg { color: #fff !important; }
.nav-item:not(.active):hover { background-color: var(--sharp-red-soft); color: var(--sharp-red-dark); }

/* ─── Toast ─── */
#toast {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
#toast.toast-show { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* ─── Status Badges ─── */
.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 9999px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em; }
.badge-active    { background: #dcfce7; color: #15803d; }
.badge-draft     { background: #f3f4f6; color: #4b5563; }
.badge-testing   { background: #fef9c3; color: #a16207; }
.badge-completed { background: #dbeafe; color: #1d4ed8; }
.badge-archived  { background: #e5e7eb; color: #6b7280; }
.badge-success   { background: #dcfce7; color: #15803d; }
.badge-failed    { background: #fee2e2; color: #b91c1c; }
.badge-official  { background: #ede9fe; color: #6d28d9; }
.badge-partial   { background: #ffedd5; color: #c2410c; }
.badge-outofstock { background: #fee2e2; color: #b91c1c; }
.badge-flow      { background: #dbeafe; color: #1d4ed8; }
.badge-spin      { background: #ede9fe; color: #6d28d9; }
.badge-digit     { background: #fef9c3; color: #a16207; }
.badge-claimed       { background: #dcfce7; color: #15803d; }
.badge-notclaimed    { background: #f3f4f6; color: #4b5563; }
.badge-pending       { background: #fef9c3; color: #a16207; }
.badge-cancelled     { background: #fee2e2; color: #b91c1c; }
.badge-superadmin    { background: #fee2e2; color: #b91c1c; }
.badge-hqadmin       { background: #dbeafe; color: #1d4ed8; }
.badge-branchadmin   { background: #dcfce7; color: #15803d; }
.badge-operator      { background: #fef9c3; color: #a16207; }
.badge-viewer        { background: #f3f4f6; color: #4b5563; }

/* ─── Table ─── */
.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table thead th {
  background: #f9fafb;
  color: #374151;
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.data-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #374151;
  vertical-align: middle;
}
.data-table tbody tr:hover { background: #f9fafb; }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ─── Cards ─── */
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* ─── Digit Display ─── */
.digit-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: 'Courier New', 'Lucida Console', monospace;
}
.digit-group { display: flex; gap: 6px; }
/* Panel digit Sharp red dengan angka reverse putih — kombinasi resmi manual */
.digit-char {
  background: var(--sharp-red);
  color: #fff;
  font-size: 5rem;
  font-weight: 900;
  min-width: 72px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 2px solid var(--sharp-red-dark);
  box-shadow: 0 4px 16px rgba(230,0,13,0.25);
  transition: none;
  line-height: 1;
}
.digit-sep {
  color: var(--sharp-red);
  font-size: 4rem;
  font-weight: 900;
  align-self: center;
}
.digit-char.rolling { animation: digitFlash 0.08s ease-in-out; }

@keyframes digitFlash {
  0%   { opacity: 0.6; }
  50%  { opacity: 1; }
  100% { opacity: 0.6; }
}

/* ─── Spin Wheel ─── */
.wheel-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wheel-pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 28px solid var(--sharp-red);
  filter: drop-shadow(0 2px 6px rgba(230,0,13,0.5));
  z-index: 10;
}

/* ─── Winner Card Animation ─── */
@keyframes winnerReveal {
  0%   { transform: scale(0.6) translateY(20px); opacity: 0; }
  70%  { transform: scale(1.04) translateY(0); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.winner-card { animation: winnerReveal 0.5s cubic-bezier(0.34,1.56,0.64,1) forwards; }

/* ─── Confetti ─── */
.confetti-piece {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ─── Dropzone ─── */
.dropzone {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  transition: border-color 0.2s, background-color 0.2s;
  cursor: pointer;
}
.dropzone:hover, .dropzone.drag-over { border-color: var(--sharp-red); background: #fff1f2; }

/* ─── Spinner ─── */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spinner { animation: spin 0.8s linear infinite; }

/* ─── Checklist ─── */
.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 0.875rem;
}
.checklist-item.done { background: #f0fdf4; color: #15803d; }
.checklist-item.pending { background: #fafafa; color: #6b7280; }
.checklist-item .check-icon { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.checklist-item.done .check-icon { background: #16a34a; color: #fff; }
.checklist-item.pending .check-icon { background: #e5e7eb; color: #9ca3af; }

/* ─── Progress bar ─── */
.progress-bar { height: 6px; background: #e5e7eb; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--sharp-red), #ff2634); transition: width 0.4s ease; }

/* ─── Mobile sidebar overlay ─── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 40;
}
.sidebar-overlay.show { display: block; }

@media (max-width: 1024px) {
  #sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 50;
    transform: translateX(-100%);
  }
  #sidebar.mobile-open {
    transform: translateX(0);
    width: 256px !important;
  }
  .sidebar-overlay { display: none; }
  .sidebar-overlay.show { display: block; }
}

/* ─── Raffle Flow shuffle text ─── */
@keyframes shuffleFlash {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}
.shuffle-text { animation: shuffleFlash 0.1s ease-in-out; font-family: 'Inter', sans-serif; }

/* ─── Modal ─── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  width: 90%;
  max-width: 520px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ─── Tab underline ─── */
.tab-btn {
  padding: 8px 16px;
  border-bottom: 2px solid transparent;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.tab-btn:hover { color: #111; }
.tab-btn.active { color: var(--sharp-red); border-color: var(--sharp-red); }

/* ─── Raffle display pages (light — putih sesuai aturan brand, rona Sharp red lembut) ─── */
.raffle-page-bg {
  background: linear-gradient(180deg, #ffffff 0%, #fdf1f2 100%);
  min-height: 100vh;
}

/* ─── Festive / colorful display accents ───
   --display-accent and --display-font are set at runtime by applyDisplaySettings()
   from Raffle Settings; they default to SHARP red / white when unset. */
:root {
  --display-accent: var(--sharp-red);
  --display-font: #111111;
}

/* Latar display light — putih sebagai dasar (aturan manual), spotlight Sharp red sangat lembut */
[data-display-bg] {
  background: radial-gradient(ellipse 75% 55% at 50% 0%, rgba(230,0,13,0.07), transparent 62%), linear-gradient(180deg,#ffffff 0%,#f8f8f8 100%);
  position: relative;
}

/* Single soft spotlight behind the stage — calmer than a multi-color blend,
   just a gentle breathing glow so the background doesn't feel static. */
.festive-glow-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.festive-glow-layer::before {
  content: '';
  position: absolute;
  width: 55vw;
  height: 55vw;
  max-width: 640px;
  max-height: 640px;
  border-radius: 50%;
  top: -18%;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--display-accent), transparent 68%);
  filter: blur(70px);
  opacity: 0.08;
  animation: festiveBreathe 6s ease-in-out infinite;
}
@keyframes festiveBreathe {
  0%, 100% { opacity: 0.05; transform: translateX(-50%) scale(1); }
  50%      { opacity: 0.1;  transform: translateX(-50%) scale(1.08); }
}

/* Vignette light — sapuan abu sangat halus di tepi agar fokus tetap ke tengah panggung */
.stage-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(ellipse 90% 90% at 50% 50%, transparent 60%, rgba(17,17,17,0.06) 100%);
}

/* Rotating two-tone border ring used to frame winner reveals — restrained, on-brand */
.festive-ring {
  position: relative;
}
.festive-ring::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  background: conic-gradient(from 0deg, var(--display-accent), #F6C343, var(--display-accent));
  z-index: -1;
  animation: festiveSpin 6s linear infinite;
}
@keyframes festiveSpin { to { transform: rotate(360deg); } }

/* Party-string lights strip for header accents */
.party-lights {
  display: flex;
  gap: 10px;
  height: 8px;
}
.party-lights span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: partyTwinkle 1.4s ease-in-out infinite;
}
/* Palet titik lampu dibatasi ke warna brand: Sharp red, emas pemenang, dan turunannya */
.party-lights span:nth-child(1) { background:var(--sharp-red); animation-delay: 0s; }
.party-lights span:nth-child(2) { background:#F6C343; animation-delay: 0.2s; }
.party-lights span:nth-child(3) { background:var(--sharp-red-dark); animation-delay: 0.4s; }
.party-lights span:nth-child(4) { background:#F6C343; animation-delay: 0.6s; }
.party-lights span:nth-child(5) { background:var(--sharp-red); animation-delay: 0.8s; }
@keyframes partyTwinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.8); }
  50%      { opacity: 1;    transform: scale(1.15); }
}

/* ─── Print / Export clean ─── */
@media print {
  #sidebar, header, .no-print { display: none !important; }
  main { margin: 0; padding: 0; }
}
