@import url('fonts.css');

/* Institutional SMK Theme - Plus Jakarta Sans & Modern Utilities */
:root {
  --font-primary: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  --color-brand-primary: #1e40af;
  --color-brand-accent: #2563eb;
  --color-brand-glow: #60a5fa;
  --color-gold: #d97706;
}

*, ::before, ::after {
  font-family: var(--font-primary);
}

body {
  font-family: var(--font-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #f8fafc;
  color: #0f172a;
}

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

.glass-panel {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
  animation: fadeIn 0.25s ease-out forwards;
}

/* Choice Cards for CBT Exam */
/* Choice Cards for CBT Exam */
.choice-card {
  display: flex;
  align-items: flex-start;
  padding: 0.875rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 1rem;
  background: #ffffff;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 640px) {
  .choice-card {
    padding: 1rem 1.25rem;
  }
}

.choice-card:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  transform: translateX(3px);
}

.choice-card:active {
  transform: scale(0.99);
}

.choice-card.selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 2px #2563eb, 0 4px 12px rgba(37, 99, 235, 0.15);
}

.choice-prefix {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

@media (min-width: 640px) {
  .choice-prefix {
    width: 34px;
    height: 34px;
    margin-right: 1rem;
  }
}

.choice-card:hover .choice-prefix {
  background: #dbeafe;
  color: #1d4ed8;
}

.choice-card.selected .choice-prefix {
  background: linear-gradient(135deg, #1e40af, #2563eb);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.choice-content {
  flex: 1;
  font-size: 0.925rem;
  line-height: 1.6;
  color: #1e293b;
  font-weight: 500;
  word-break: break-word;
}

@media (min-width: 640px) {
  .choice-content {
    font-size: 0.95rem;
  }
}

/* Question Navigator Boxes */
.q-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
}

@media (min-width: 480px) {
  .q-grid {
    gap: 0.5rem;
  }
}

.q-box, .q-grid-btn {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem;
  font-weight: 800;
  font-size: 0.8rem;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  min-width: 36px;
  min-height: 36px;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 640px) {
  .q-box, .q-grid-btn {
    border-radius: 0.75rem;
    font-size: 0.85rem;
  }
}

.q-box:hover, .q-grid-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
  transform: scale(1.05);
}

.q-box.answered, .q-grid-btn.answered {
  background: #10b981 !important;
  border-color: #059669 !important;
  color: #ffffff !important;
}

.q-box.doubtful, .q-grid-btn.doubtful {
  background: #f59e0b !important;
  border-color: #d97706 !important;
  color: #ffffff !important;
}

.q-box.active, .q-grid-btn.active {
  border-color: #1d4ed8 !important;
  box-shadow: 0 0 0 3px #3b82f6, 0 4px 12px rgba(37, 99, 235, 0.3) !important;
  transform: scale(1.06);
  z-index: 5;
}

/* Timer Box */
.timer-box {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(135deg, #1e3a8a, #1e40af);
  color: #ffffff;
  font-family: monospace;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 0.35rem 0.65rem;
  border-radius: 0.65rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .timer-box {
    gap: 0.5rem;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
  }
}

.timer-box.timer-warning {
  background: linear-gradient(135deg, #b91c1c, #dc2626);
  animation: pulse 1.5s infinite;
}

/* Modern Institutional Modal Overlay & Dialog */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-card {
  background: #ffffff;
  border-radius: 1.5rem;
  max-width: 460px;
  width: calc(100% - 1rem);
  max-height: 88vh;
  overflow-y: auto;
  padding: 2rem 1.25rem 1.5rem 1.25rem;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(226, 232, 240, 0.8);
  position: relative;
  transform: scale(0.94) translateY(12px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
}

@media (min-width: 640px) {
  .modal-card {
    border-radius: 1.75rem;
    width: 100%;
    padding: 2.25rem 2rem 2rem 2rem;
    max-height: 90vh;
  }
}

.modal-overlay.active .modal-card {
  transform: scale(1) translateY(0);
}

/* Mobile Bottom Sheet Drawer for Question Navigator */
.mobile-nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.mobile-nav-drawer.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-nav-sheet {
  background: #ffffff;
  border-top-left-radius: 1.75rem;
  border-top-right-radius: 1.75rem;
  padding: 1.25rem 1rem 2rem 1rem;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
}

.mobile-nav-drawer.active .mobile-nav-sheet {
  transform: translateY(0);
}

/* Responsive Table Container */
.table-responsive-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-responsive-container::-webkit-scrollbar {
  height: 6px;
}
.table-responsive-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}

.modal-overlay.active .modal-card {
  transform: scale(1) translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  background: #f1f5f9;
  color: #334155;
}

.modal-icon-badge {
  width: 60px;
  height: 60px;
  border-radius: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem auto;
  transition: all 0.2s ease;
}

.modal-icon-badge.badge-primary, .modal-icon-badge:not([class*="badge-"]) {
  background: #eff6ff;
  color: #1e40af;
  box-shadow: 0 0 0 8px rgba(239, 246, 255, 0.7);
}

.modal-icon-badge.badge-danger {
  background: #fff1f2;
  color: #e11d48;
  box-shadow: 0 0 0 8px rgba(255, 241, 242, 0.7);
}

.modal-icon-badge.badge-warning {
  background: #fffbeb;
  color: #d97706;
  box-shadow: 0 0 0 8px rgba(255, 251, 235, 0.7);
}

.modal-icon-badge.badge-success {
  background: #ecfdf5;
  color: #059669;
  box-shadow: 0 0 0 8px rgba(236, 253, 245, 0.7);
}

.modal-icon-badge.badge-time {
  background: #eef2ff;
  color: #4f46e5;
  box-shadow: 0 0 0 8px rgba(238, 242, 255, 0.7);
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.modal-btn-cancel {
  flex: 1;
  padding: 0.75rem 1.25rem;
  border-radius: 0.875rem;
  font-weight: 700;
  font-size: 0.875rem;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-btn-cancel:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.modal-btn-confirm {
  flex: 1.2;
  padding: 0.75rem 1.25rem;
  border-radius: 0.875rem;
  font-weight: 700;
  font-size: 0.875rem;
  color: #ffffff;
  background: #1e3a8a;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25);
  transition: all 0.15s ease;
}

.modal-btn-confirm:hover {
  background: #1e40af;
}

.modal-btn-confirm.btn-danger {
  background: #dc2626 !important;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25) !important;
}

.modal-btn-confirm.btn-danger:hover {
  background: #b91c1c !important;
}

.modal-btn-confirm.btn-warning {
  background: #d97706 !important;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25) !important;
}

.modal-btn-confirm.btn-warning:hover {
  background: #b45309 !important;
}

.modal-btn-confirm.btn-success {
  background: #059669 !important;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25) !important;
}

.modal-btn-confirm.btn-success:hover {
  background: #047857 !important;
}

.modal-btn-confirm.btn-time {
  background: #4f46e5 !important;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25) !important;
}

.modal-btn-confirm.btn-time:hover {
  background: #4338ca !important;
}

.preset-chip-btn:hover {
  background: #e0e7ff !important;
  border-color: #818cf8 !important;
  color: #3730a3 !important;
}

.q-stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  text-align: center;
}

.q-stat-item {
  padding: 0.5rem;
}

.q-stat-num {
  font-size: 1.25rem;
  font-weight: 900;
}

.q-stat-label {
  font-size: 0.7rem;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 700;
}

.img-question {
  max-width: 100%;
  max-height: 380px;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin: 0.75rem 0;
}
