/* ==========================================================================
   Aplikasi Cetak & Generate Kartu Peserta Ujian - Main CSS
   ========================================================================== */

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

/* Glassmorphism & Elevation */
.glass-panel {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.glass-panel-dark {
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(51, 65, 85, 0.6);
}

/* Drag & Drop Zone */
.dropzone-active {
  border-color: #0284c7 !important;
  background-color: #f0f9ff !important;
  transform: scale(1.01);
}

/* Tab Navigation Active State */
.nav-tab-btn.active {
  color: #0284c7;
  border-bottom: 2px solid #0284c7;
  font-weight: 600;
  background-color: #f8fafc;
}

/* Live Card Styling on Screen (Preview) */
.card-preview-wrapper {
  background: #cbd5e1;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

.a4-sheet-preview {
  background: #ffffff;
  width: 100%;
  max-width: 900px;
  margin: 0 auto 2rem auto;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 24px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
}

/* Participant Card Screen Styles */
.participant-card {
  position: relative;
  background: #ffffff;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  box-sizing: border-box;
  transition: all 0.2s ease;
  page-break-inside: avoid;
  break-inside: avoid;
}

.participant-card:hover {
  border-color: #0284c7;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

/* Watermark */
.card-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 140px;
  height: 140px;
  opacity: 0.05;
  pointer-events: none;
  object-fit: contain;
  z-index: 0;
}

/* Card Header */
.card-header-kop {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 2px double #334155;
  margin-bottom: 8px;
}

.card-logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.card-kop-text {
  flex-grow: 1;
  text-align: center;
}

.card-kop-school {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  color: #0f172a;
  line-height: 1.2;
  letter-spacing: 0.2px;
}

.card-kop-exam {
  font-size: 10px;
  font-weight: 700;
  color: #0284c7;
  text-transform: uppercase;
  line-height: 1.2;
  margin-top: 1px;
}

.card-kop-addr {
  font-size: 8px;
  color: #64748b;
  line-height: 1.15;
  margin-top: 1px;
}

.card-kop-year {
  font-size: 8px;
  font-weight: 600;
  color: #475569;
}

/* Card Body (Two Columns: QR Left, Info Right) */
.card-body-content {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-grow: 1;
  padding: 4px 0;
}

/* Left Column: Big QR Code Container */
.card-qr-section {
  width: 104px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.card-qr-box {
  width: 98px;
  height: 98px;
  background: #ffffff;
  padding: 4px;
  border: 1.5px solid #0284c7;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-qr-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.card-qr-label {
  font-size: 7.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: #0369a1;
  margin-top: 3px;
  letter-spacing: 0.3px;
}

/* Right Column: Participant Details Table */
.card-info-table {
  flex-grow: 1;
  width: 100%;
  font-size: 9.5px;
  border-collapse: collapse;
}

.card-info-table tr {
  line-height: 1.35;
}

.card-info-table td.label-col {
  width: 78px;
  font-weight: 600;
  color: #475569;
  vertical-align: middle;
  padding: 2px 0;
}

.card-info-table td.sep-col {
  width: 10px;
  text-align: center;
  font-weight: bold;
  color: #64748b;
  vertical-align: middle;
}

.card-info-table td.val-col {
  font-weight: 600;
  color: #0f172a;
  vertical-align: middle;
  padding: 2px 0;
}

.card-val-name {
  font-size: 10.5px;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
}

.card-badge-no {
  display: inline-block;
  font-family: 'Fira Code', monospace;
  font-weight: 700;
  font-size: 9.5px;
  background: #e0f2fe;
  color: #0369a1;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #bae6fd;
}

.card-badge-pass {
  display: inline-block;
  font-family: 'Fira Code', monospace;
  font-weight: 700;
  font-size: 9.5px;
  background: #f1f5f9;
  color: #334155;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
}

/* Card Footer */
.card-footer-section {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid #e2e8f0;
  padding-top: 5px;
  margin-top: 4px;
  gap: 8px;
}

.card-rules-box {
  flex-grow: 1;
  font-size: 7.5px;
  color: #64748b;
  line-height: 1.25;
}

.card-signature-box {
  width: 130px;
  flex-shrink: 0;
  text-align: center;
  font-size: 7.5px;
  color: #334155;
  line-height: 1.15;
}

.card-signature-date {
  font-size: 7.5px;
  color: #475569;
}

.card-signature-role {
  font-weight: 600;
}

.card-signature-img-space {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.card-signature-img {
  max-height: 28px;
  max-width: 70px;
  object-fit: contain;
}

.card-stamp-img {
  position: absolute;
  max-height: 32px;
  max-width: 48px;
  left: 10px;
  opacity: 0.85;
  pointer-events: none;
}

.card-signature-name {
  font-weight: 700;
  font-size: 8px;
  text-decoration: underline;
  color: #0f172a;
}

.card-signature-nip {
  font-size: 7px;
  color: #64748b;
}

/* Color Themes */
/* Theme 1: Sky Blue (Default) */
.theme-sky .card-kop-exam { color: #0284c7; }
.theme-sky .card-qr-box { border-color: #0284c7; }
.theme-sky .card-qr-label { color: #0369a1; }
.theme-sky .card-badge-no { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }

/* Theme 2: Emerald Green (Madrasah / Kemenag) */
.theme-emerald .card-kop-exam { color: #059669; }
.theme-emerald .card-qr-box { border-color: #059669; }
.theme-emerald .card-qr-label { color: #047857; }
.theme-emerald .card-badge-no { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }

/* Theme 3: Royal Indigo */
.theme-indigo .card-kop-exam { color: #4f46e5; }
.theme-indigo .card-qr-box { border-color: #4f46e5; }
.theme-indigo .card-qr-label { color: #3730a3; }
.theme-indigo .card-badge-no { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }

/* Theme 4: Crimson Maroon */
.theme-crimson .card-kop-exam { color: #e11d48; }
.theme-crimson .card-qr-box { border-color: #e11d48; }
.theme-crimson .card-qr-label { color: #9f1239; }
.theme-crimson .card-badge-no { background: #ffe4e6; color: #9f1239; border-color: #fecdd3; }

/* Theme 5: Slate Dark */
.theme-slate .card-kop-exam { color: #334155; }
.theme-slate .card-qr-box { border-color: #475569; }
.theme-slate .card-qr-label { color: #1e293b; }
.theme-slate .card-badge-no { background: #f1f5f9; color: #0f172a; border-color: #cbd5e1; }

/* Modal Backdrop & Animations */
.modal-backdrop {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.animate-modal {
  animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Quick Card Action Buttons overlay on hover */
.card-hover-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  opacity: 0;
  transition: opacity 0.15s ease;
  display: flex;
  gap: 4px;
  z-index: 10;
}

.participant-card:hover .card-hover-actions {
  opacity: 1;
}

.card-action-btn {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 10px;
  color: #334155;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.card-action-btn:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}
