/**
 * Custom CSS untuk Aplikasi Absensi Pelatihan
 * In-House Training: Sharing Best Practice
 */

:root {
  --primary-navy: #091e3a;
  --secondary-navy: #0f2d59;
  --accent-gold: #f59e0b;
  --accent-blue: #2563eb;
  --accent-teal: #0d9488;
  --surface-card: rgba(255, 255, 255, 0.95);
}

/* Glassmorphism effects */
.glass-panel {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 20px 40px -15px rgba(9, 30, 58, 0.08), 0 0 1px 1px rgba(9, 30, 58, 0.04);
}

.glass-header {
  background: linear-gradient(135deg, #091e3a 0%, #113360 50%, #0d9488 100%);
}

.card-hover {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 30px -10px rgba(15, 45, 89, 0.12);
}

/* Camera viewport styling */
.camera-box {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4; /* Optimal portrait ratio on mobile */
  background: #061325;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.6), 0 12px 30px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 1024px) {
  .camera-box {
    aspect-ratio: 4 / 3; /* Landscape on desktop */
  }
}

.camera-box video,
.camera-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Biometric Face Oval Guide */
.face-oval-guide {
  position: absolute;
  width: 60%;
  height: 65%;
  max-width: 260px;
  max-height: 330px;
  border: 2px dashed rgba(56, 189, 248, 0.7);
  border-radius: 50% / 60%;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(6, 19, 37, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Biometric Scanning Beam */
.biometric-scanner-beam {
  position: absolute;
  left: 5%;
  right: 5%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #38bdf8, #34d399, transparent);
  box-shadow: 0 0 12px #38bdf8;
  animation: scanbeam 2.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes scanbeam {
  0% { top: 18%; opacity: 0; }
  20% { opacity: 0.9; }
  80% { opacity: 0.9; }
  100% { top: 82%; opacity: 0; }
}

/* Native Shutter Button */
.shutter-btn-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3.5px solid rgba(255, 255, 255, 0.9);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
}
.shutter-btn-ring:active {
  transform: scale(0.92);
}
.shutter-btn-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, #06b6d4 0%, #10b981 100%);
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
}

/* Framing overlay over video */
.camera-guide {
  position: absolute;
  inset: 16px;
  border: 2px dashed rgba(255, 255, 255, 0.4);
  border-radius: 1rem;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
}

.camera-corners {
  position: absolute;
  inset: 20px;
  pointer-events: none;
}
.camera-corners::before,
.camera-corners::after {
  content: '';
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: #38bdf8;
  border-style: solid;
}
.camera-corners::before {
  top: 0;
  left: 0;
  border-width: 3px 0 0 3px;
  border-top-left-radius: 10px;
}
.camera-corners::after {
  bottom: 0;
  right: 0;
  border-width: 0 3px 3px 0;
  border-bottom-right-radius: 10px;
}

/* Flash animation on snap */
@keyframes camera-flash {
  0% { opacity: 0; }
  25% { opacity: 0.9; }
  100% { opacity: 0; }
}

.flash-active {
  animation: camera-flash 0.35s ease-out;
}

/* Shimmer animation */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-shimmer {
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
  background-size: 200% 100%;
  animation: shimmer 2.5s infinite;
}

/* Signature Pad */
.signature-pad-wrapper {
  position: relative;
  border: 1.5px dashed rgba(56, 189, 248, 0.4);
  border-radius: 1rem;
  background: rgba(4, 13, 26, 0.9);
  overflow: hidden;
  touch-action: none;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}
.signature-pad-wrapper::before {
  content: 'Tanda tangan di sini';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.28);
  letter-spacing: 0.05em;
  pointer-events: none;
  user-select: none;
}
.signature-pad-wrapper canvas {
  width: 100%;
  height: 110px;
  display: block;
  position: relative;
  z-index: 2;
}

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

/* Print Styles */
@media print {
  body {
    background: white !important;
    color: black !important;
  }
  .no-print {
    display: none !important;
  }
  .print-only {
    display: block !important;
  }
  .glass-panel {
    border: none !important;
    box-shadow: none !important;
  }
}
