/**
 * SISTEM ABSENSI EKSTRAKURIKULER
 * UPT SMP NEGERI 1 WATANG PULU
 * Stylesheet & Print Media Rules
 */

:root {
  --primary-dark: #0b2545;
  --primary-blue: #134074;
  --accent-cyan: #00a6fb;
  --accent-sky: #0582ca;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #ef4444;
  --bg-slate: #f8fafc;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #f1f5f9;
  color: #1e293b;
  -webkit-font-smoothing: antialiased;
}

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

/* Scanner Laser Animation */
.scanner-laser {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #10b981, #00a6fb, transparent);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.8);
  animation: scanning 2.2s infinite ease-in-out;
}

@keyframes scanning {
  0% { top: 5%; opacity: 0.2; }
  50% { top: 90%; opacity: 1; }
  100% { top: 5%; opacity: 0.2; }
}

/* Viewfinder Corner Markers */
.finder-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: #00a6fb;
  pointer-events: none;
}
.finder-top-left { top: 12px; left: 12px; border-top-width: 4px; border-left-width: 4px; border-top-left-radius: 8px; }
.finder-top-right { top: 12px; right: 12px; border-top-width: 4px; border-right-width: 4px; border-top-right-radius: 8px; }
.finder-bottom-left { bottom: 12px; left: 12px; border-bottom-width: 4px; border-left-width: 4px; border-bottom-left-radius: 8px; }
.finder-bottom-right { bottom: 12px; right: 12px; border-bottom-width: 4px; border-right-width: 4px; border-bottom-right-radius: 8px; }

/* Student ID Card Layout (PVC Standard CR80: 85.6mm x 53.98mm) */
.student-card {
  width: 324px;
  height: 204px;
  background: linear-gradient(135deg, #0b2545 0%, #134074 55%, #0582ca 100%);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 25px -5px rgba(11, 37, 69, 0.25);
  display: flex;
  flex-direction: column;
  padding: 12px;
  color: #ffffff;
  user-select: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.student-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(0, 166, 251, 0.35) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.student-card .card-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.student-card .school-name {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.student-card .card-type {
  font-size: 8px;
  font-weight: 600;
  color: #38bdf8;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.student-card .card-body {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
}

.student-card .card-photo {
  width: 58px;
  height: 74px;
  border-radius: 6px;
  object-fit: cover;
  background-color: #cbd5e1;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.student-card .card-info {
  flex: 1;
  min-width: 0;
}

.student-card .student-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #ffffff;
}

.student-card .info-line {
  font-size: 9.5px;
  color: #e2e8f0;
  margin-top: 2px;
}

.student-card .qr-container {
  width: 72px;
  height: 72px;
  background: #ffffff;
  padding: 4px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.student-card .card-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.student-card .token-code {
  font-family: monospace;
  font-size: 8px;
  color: #93c5fd;
  letter-spacing: 1px;
}

.student-card .year-badge {
  font-size: 7.5px;
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
  padding: 2px 6px;
  border-radius: 9999px;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Print Optimization */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .no-print, header, aside, #navSidebar, #appHeader, .modal, .action-btn {
    display: none !important;
  }
  .print-only {
    display: block !important;
  }
  #mainContent {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }
  
  /* Print Grid for Student Cards */
  .cards-print-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 85.6mm);
    gap: 12mm 15mm;
    justify-content: center;
    padding: 10mm 0;
    page-break-after: always;
  }
  
  .student-card {
    box-shadow: none !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Printable Report */
  .official-report-sheet {
    width: 100%;
    page-break-after: always;
    font-size: 11pt;
  }
}
