/* ==========================================================================
   CSS Replikasi Simulasi TKA - Pusmendik Kemendikdasmen (ANBK)
   Berdasarkan ekstraksi DOM & CSS asli via REA
   ========================================================================== */

body.mode-landing {
  background: linear-gradient(135deg, #326698 0%, #4a7fb8 100%, #667eea 100%);
  font-family: 'Poppins', sans-serif;
  min-height: 100vh;
  margin: 0;
}

body.mode-cbt {
  background: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  margin: 0;
}

/* Background Pattern */
.bg-pattern {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.1) 2px, transparent 2px),
    radial-gradient(circle at 80% 80%, rgba(255,255,255,0.08) 2px, transparent 2px),
    radial-gradient(circle at 40% 40%, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 50px 50px, 80px 80px, 30px 30px;
  z-index: -1;
  pointer-events: none;
}

.loader {
  margin: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  -ms-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
}

.wrapper {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  padding: 20px 20px 75px 20px;
  margin: 0 auto;
  text-align: center;
}

.cbt-wrapper {
  min-height: auto;
  padding-top: 20px;
}

/* Header Styling */
.logo-container {
  display: flex;
  align-items: center;
}

.header-text h3 {
  margin: 0;
  letter-spacing: 1px;
}

.header-text p {
  margin: 0;
  font-weight: 400;
}

/* Landing Card (#formContent on page 1) */
.landing-card {
  border-radius: 20px;
  background: #ffffff;
  padding: 45px;
  width: 90%;
  max-width: 480px;
  position: relative;
  box-shadow: 0 15px 35px 0 rgba(50, 102, 152, 0.1);
  text-align: center;
  border: 1px solid rgba(255,255,255,0.8);
}

/* Classic CBT Card (#formContent on pages 2-6) */
.cbt-card {
  border-radius: 10px;
  background: #fff;
  position: relative;
  box-shadow: 0 30px 60px 0 rgba(0,0,0,0.3);
  text-align: center;
}

.exam-main-card {
  padding-left: 50px;
  padding-right: 50px;
}

/* Header Icon */
.header-icon .icon-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #326698 0%, #4a7fb8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 10px 30px rgba(50, 102, 152, 0.2);
  border: 2px solid rgba(50, 102, 152, 0.1);
  animation: floating 3s ease-in-out infinite;
}

.header-icon .icon-circle i {
  font-size: 35px;
  color: white;
}

@keyframes floating {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* Form Styling */
.form-label {
  color: #333;
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 14px;
  display: flex;
  align-items: center;
}

.form-label i {
  color: #326698;
  margin-right: 8px;
  font-size: 16px;
}

.custom-select {
  border: 2px solid #e8ecf1;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.3s ease;
  background-color: #fff;
  background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23326698" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 12px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(50, 102, 152, 0.08);
  height: auto;
}

.custom-select:focus {
  border-color: #326698;
  box-shadow: 0 0 0 3px rgba(50, 102, 152, 0.1), 0 4px 16px rgba(50, 102, 152, 0.15);
  outline: none;
  transform: translateY(-1px);
}

.custom-select:hover {
  border-color: #4a7fb8;
  box-shadow: 0 4px 12px rgba(50, 102, 152, 0.12);
}

.custom-btn {
  background: linear-gradient(135deg, #326698 0%, #4a7fb8 100%);
  border: none;
  border-radius: 12px;
  padding: 16px 30px;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(50, 102, 152, 0.25);
  position: relative;
  overflow: hidden;
}

.custom-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.custom-btn:hover::before {
  left: 100%;
}

.custom-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(50, 102, 152, 0.35);
  background: linear-gradient(135deg, #4a7fb8 0%, #326698 100%);
}

/* Custom Searchable Dropdown */
.mapel-select-wrapper {
  position: relative;
}

.mapel-select-display {
  border: 2px solid #e8ecf1;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 500;
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(50, 102, 152, 0.08);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.mapel-select-display:hover {
  border-color: #4a7fb8;
  box-shadow: 0 4px 12px rgba(50, 102, 152, 0.12);
}

.mapel-select-display.open {
  border-color: #326698;
  box-shadow: 0 0 0 3px rgba(50, 102, 152, 0.1), 0 4px 16px rgba(50, 102, 152, 0.15);
  transform: translateY(-1px);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.mapel-select-display.open.open-up {
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  transform: translateY(1px);
}

.mapel-placeholder { color: #999; }
.mapel-selected-text { color: #333; }

.mapel-arrow {
  color: #326698;
  font-size: 12px;
  transition: transform 0.3s ease;
}

.mapel-arrow.rotated {
  transform: rotate(180deg);
}

.mapel-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 2px solid #326698;
  border-top: none;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  box-shadow: 0 8px 25px rgba(50, 102, 152, 0.2);
  z-index: 9999;
  overflow: hidden;
}

.mapel-dropdown.up {
  top: auto;
  bottom: 100%;
  border-top: 2px solid #326698;
  border-bottom: none;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  box-shadow: 0 -8px 25px rgba(50, 102, 152, 0.2);
}

.mapel-search-box {
  padding: 10px 12px;
  border-bottom: 1px solid #e8ecf1;
  display: flex;
  align-items: center;
  background: #f8f9fa;
}

.mapel-search-icon {
  color: #326698;
  margin-right: 8px;
  font-size: 13px;
}

.mapel-search-box input {
  border: none !important;
  outline: none !important;
  background: transparent;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  color: #333;
  width: 100%;
}

.mapel-options-list {
  max-height: 220px;
  overflow-y: auto;
}

.mapel-option {
  padding: 11px 16px;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  color: #333;
  transition: background 0.15s;
}

.mapel-option:hover {
  background-color: #e8f0f8;
  color: #326698;
}

.mapel-option.selected {
  background-color: #e8f0f8;
  color: #326698;
  font-weight: 600;
}

.mapel-loading, .mapel-empty {
  padding: 16px;
  text-align: center;
  color: #999;
  font-size: 14px;
}

.error-input, .mapel-select-display.error-input {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* CBT Inputs */
.cbt-line-input {
  border: none !important;
  color: #0d0d0d;
  font-size: 16px;
  border-radius: 0px !important;
  border-bottom: 2px solid #eee !important;
  box-shadow: none !important;
}

.cbt-flat-input {
  border: none;
  color: #0d0d0d;
  text-decoration: none;
  border-radius: 0px;
  border-bottom: 1px solid #eee;
  background: transparent;
  font-size: 15px;
  padding: 3px 0;
  outline: none;
}

.jenis_kelamin {
  border: none;
  color: #0d0d0d;
  border-radius: 0px;
  border-bottom: 1px solid #eee;
  background: transparent;
  padding-left: 0px;
  box-shadow: none !important;
}

/* CBT Exam Area */
.cfont {
  cursor: pointer;
  user-select: none;
}

.mataujian {
  text-align: right;
  font-weight: 500;
}

.cont-btn-informasi {
  text-align: right;
}

.btn-navigasi {
  width: 180px;
}

.cont-soal img, .isi-soal img {
  max-width: 100%;
  height: auto;
}

.option-row-clickable {
  cursor: pointer;
}

.option-row-clickable:hover {
  background-color: rgba(50, 102, 152, 0.04);
}

/* Animations */
.fadeInDown {
  opacity: 1;
  animation-name: fadeInDown;
  animation-duration: 0.4s;
  animation-fill-mode: both;
}

@keyframes fadeInDown {
  0% {
    opacity: 1;
    transform: translate3d(0, -15px, 0);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

.fadeIn {
  opacity: 1;
}

/* Footer Info */
.footer-info {
  position: fixed;
  bottom: 15px;
  left: 0;
  right: 0;
  z-index: 10;
  pointer-events: none;
}

.copyright-card {
  background: rgba(255, 255, 255, 0.95);
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 12px;
  color: #333;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  border: 1px solid rgba(255,255,255,0.5);
  display: inline-flex;
  align-items: center;
  margin: 0 auto;
}

/* Review Page Styles */
.review-main-card {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  position: relative;
  overflow: hidden;
}

.user-avatar .avatar-circle {
  width: 45px;
  height: 45px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-avatar .avatar-circle i {
  color: white;
  font-size: 18px;
}

.result-icon .icon-circle-result {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #17a2b8 0%, #326698 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 10px 30px rgba(23, 162, 184, 0.2);
  animation: resultPulse 2s ease-in-out infinite;
}

.result-icon .icon-circle-result i {
  font-size: 35px;
  color: white;
}

@keyframes resultPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.result-title {
  color: #333;
  font-weight: 700;
  font-size: 28px;
  margin-bottom: 15px;
}

.subject-badge {
  background: linear-gradient(135deg, rgba(50, 102, 152, 0.1) 0%, rgba(23, 162, 184, 0.1) 100%);
  color: #326698;
  padding: 10px 25px;
  border-radius: 25px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  border: 2px solid rgba(50, 102, 152, 0.2);
  font-size: 16px;
}

/* Score Stat Boxes */
.score-stat-box {
  border-radius: 15px;
  padding: 18px 15px;
  text-align: center;
  color: #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  height: 100%;
}

.score-primary { background: linear-gradient(135deg, #326698 0%, #17a2b8 100%); }
.score-success { background: linear-gradient(135deg, #28a745 0%, #20c997 100%); }
.score-danger  { background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%); }
.score-warning { background: linear-gradient(135deg, #f39c12 0%, #fd7e14 100%); }

.score-stat-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  opacity: 0.9;
}

.score-stat-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  margin: 6px 0;
}

.score-stat-sub {
  font-size: 12px;
  opacity: 0.9;
}

/* Modern Table */
.modern-table {
  border: none;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  background: white;
}

.table-header {
  background: linear-gradient(135deg, #326698 0%, #4a7fb8 100%);
  color: white;
}

.table-header th {
  border: none;
  padding: 18px 15px;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table-row {
  border-bottom: 1px solid #f0f0f0;
}

.number-cell {
  background: rgba(50, 102, 152, 0.05);
  font-weight: 700;
  color: #326698;
  border-right: 3px solid #326698;
  font-size: 16px;
  padding: 18px 15px;
}

.answer-cell, .key-cell {
  padding: 18px 15px;
  vertical-align: top;
}

.answer-item, .key-item {
  background: rgba(248, 249, 250, 0.8);
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: 8px;
  border-left: 4px solid #dee2e6;
  font-size: 14px;
  line-height: 1.5;
}

.answer-item p, .key-item p {
  margin-bottom: 0;
  display: inline;
}

.answer-item {
  border-left-color: #17a2b8;
  background: rgba(23, 162, 184, 0.05);
}

.key-item {
  border-left-color: #28a745;
  background: rgba(40, 167, 69, 0.05);
}

.pembahasan-box {
  margin-top: 8px;
  padding: 10px 12px;
  background: #fff9db;
  border-left: 4px solid #f59f00;
  border-radius: 6px;
  font-size: 13px;
  color: #495057;
}

.stat-card {
  background: linear-gradient(135deg, rgba(50, 102, 152, 0.1) 0%, rgba(23, 162, 184, 0.1) 100%);
  border-radius: 15px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  border: 2px solid rgba(50, 102, 152, 0.1);
}

.stat-icon {
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, #326698 0%, #4a7fb8 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 18px;
  box-shadow: 0 5px 15px rgba(50, 102, 152, 0.3);
}

.stat-icon i {
  color: white;
  font-size: 22px;
}

.stat-info h5 {
  margin: 0;
  color: #333;
  font-weight: 700;
  font-size: 17px;
}

.stat-info p {
  margin: 3px 0 0;
  color: #666;
  font-size: 14px;
}

.action-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.custom-btn-download, .custom-btn-logout {
  border: none;
  border-radius: 12px;
  padding: 13px 22px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  color: white;
}

.custom-btn-download {
  background: linear-gradient(135deg, #17a2b8 0%, #326698 100%);
  box-shadow: 0 6px 20px rgba(23, 162, 184, 0.25);
}

.custom-btn-logout {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  box-shadow: 0 6px 20px rgba(220, 53, 69, 0.25);
}

.custom-btn-download:hover, .custom-btn-logout:hover {
  transform: translateY(-2px);
  color: white;
}

/* Floating Admin Button */
.floating-admin-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9500;
  background: #212529;
  color: #ffffff !important;
  padding: 11px 18px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  box-shadow: 0 6px 20px rgba(0,0,0,0.28);
  border: 2px solid rgba(255,255,255,0.25);
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
}

.floating-admin-btn:hover {
  background: #326698;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(50,102,152,0.4);
}

@media (max-width: 768px) {
  .landing-card {
    margin: 20px;
    padding: 35px 25px;
  }
  .exam-main-card {
    padding-left: 15px;
    padding-right: 15px;
  }
  .mataujian {
    text-align: left;
  }
  .row-atas {
    text-align: center;
  }
  .cont-btn-informasi {
    text-align: center;
    margin-top: 8px;
  }
  .btn-navigasi {
    width: auto;
    padding-left: 14px;
    padding-right: 14px;
  }
}

@media print {
  #floatingAdminBtn, #footerInfo, .action-buttons {
    display: none !important;
  }
  body.mode-landing {
    background: #fff !important;
  }
}
