@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@600;700&display=swap');

:root {
  --primary: #007a87;
  --primary-hover: #00636e;
  --primary-light: #e6f6f7;
  --primary-glow: rgba(0, 122, 135, 0.25);
  --accent-gold: #f59e0b;
  --accent-gold-light: #fef3c7;
  --success: #10b981;
  --success-light: #d1fae5;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --danger-glow: rgba(239, 68, 68, 0.35);
  
  --bg-gradient: radial-gradient(at 0% 0%, rgba(0, 122, 135, 0.09) 0px, transparent 50%),
                      radial-gradient(at 100% 0%, rgba(245, 158, 11, 0.08) 0px, transparent 40%),
                      radial-gradient(at 50% 100%, rgba(0, 122, 135, 0.05) 0px, transparent 60%),
                      #f8fafc;
                      
  --surface-glass: rgba(255, 255, 255, 0.88);
  --surface-glass-card: rgba(255, 255, 255, 0.94);
  --border-glass: rgba(226, 232, 240, 0.85);
  --border-focus: #007a87;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  
  --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.06), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 25px 50px -12px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 25px var(--primary-glow);
  
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 16px;
  position: relative;
  z-index: 10;
}

/* Ambient glow orbs in background */
.bg-ambient-orb {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 1;
  opacity: 0.45;
  animation: floatOrb 12s ease-in-out infinite alternate;
}
.orb-1 {
  top: -100px;
  left: -100px;
  background: radial-gradient(circle, #007a87 0%, transparent 70%);
}
.orb-2 {
  bottom: -100px;
  right: -100px;
  background: radial-gradient(circle, #f59e0b 0%, transparent 70%);
  animation-delay: -6s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, 30px) scale(1.1); }
}

/* Header & Glassmorphism Navigation */
.app-header {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 16px 0;
  border-bottom: 1px solid var(--border-glass);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.03);
  position: relative;
  z-index: 40;
}

.header-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo-img {
  height: 48px;
  max-width: 200px;
  object-fit: contain;
  transition: transform 0.3s ease;
}
.brand-logo-img:hover {
  transform: scale(1.03);
}

.brand-info h1 {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #0f172a;
}
.brand-info p {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Sticky Quiz Bar with Dynamic Circular Ring Countdown */
.sticky-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  padding: 14px 0;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
}

.sticky-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.candidate-pill {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(241, 245, 249, 0.8);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid #e2e8f0;
}

/* Futuristic Circular Timer Widget */
.timer-widget {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  padding: 6px 16px 6px 10px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-glass);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.timer-circle-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-svg {
  width: 44px;
  height: 44px;
  transform: rotate(-90deg);
}

.timer-circle-bg {
  fill: none;
  stroke: #f1f5f9;
  stroke-width: 3.5;
}

.timer-circle-progress {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 113.1; /* 2 * PI * 18 */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.8s linear, stroke 0.3s ease;
}

.timer-digits {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  min-width: 40px;
}

/* Timer Warning and Critical States */
.timer-widget.warning-orange {
  border-color: var(--accent-gold);
  background: var(--accent-gold-light);
}
.timer-widget.warning-orange .timer-circle-progress {
  stroke: var(--accent-gold);
}
.timer-widget.warning-orange .timer-digits {
  color: #b45309;
}

.timer-widget.critical-red {
  border-color: var(--danger);
  background: var(--danger-light);
  box-shadow: 0 0 20px var(--danger-glow);
  animation: heartPulse 0.8s infinite alternate;
}
.timer-widget.critical-red .timer-circle-progress {
  stroke: var(--danger);
}
.timer-widget.critical-red .timer-digits {
  color: var(--danger);
}

@keyframes heartPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

/* Sleek Progress Bar */
.progress-container {
  width: 100%;
  height: 6px;
  background: #f1f5f9;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 10px;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #007a87, #00b4d8, #f59e0b);
  width: 0%;
  border-radius: var(--radius-full);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px rgba(0, 122, 135, 0.4);
}

/* Glass Cards */
.card {
  background: var(--surface-glass-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover {
  border-color: rgba(0, 122, 135, 0.3);
  box-shadow: var(--shadow-lg);
}

.card-header-styled {
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 20px;
  margin-bottom: 24px;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  margin-bottom: 12px;
}

/* Animated Entrance for Question Card */
.question-animated-card {
  animation: cardEntrance 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardEntrance {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Question Burnout Flash Shake */
.question-burn-shake {
  animation: burnShake 0.5s ease-in-out;
}

@keyframes burnShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}
.form-label span.req { color: var(--danger); }

.form-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  border: 1.5px solid var(--border-glass);
  background: #ffffff;
  border-radius: var(--radius-sm);
  outline: none;
  font-family: inherit;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
}

.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px var(--primary-glow);
  background: #ffffff;
}

/* Instructions Box */
.instructions-box {
  background: linear-gradient(135deg, rgba(230, 246, 247, 0.8), rgba(254, 243, 199, 0.6));
  border: 1.5px solid rgba(0, 122, 135, 0.2);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin: 20px 0;
  font-size: 0.95rem;
  color: #0f172a;
}
.instructions-box ul {
  padding-left: 20px;
  margin-top: 10px;
}
.instructions-box li {
  margin-bottom: 8px;
  line-height: 1.45;
}

/* Option Items (Interactive Cards with Micro-Interactions) */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  position: relative;
  overflow: hidden;
}

.option-item:hover {
  border-color: #94a3b8;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: #fafbfc;
}

.option-item.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.015);
  box-shadow: 0 0 0 2px var(--primary), 0 8px 20px var(--primary-glow);
}

.option-key {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  margin-right: 16px;
  flex-shrink: 0;
  background: #f8fafc;
  color: var(--text-main);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.option-item:hover .option-key {
  border-color: var(--primary);
  color: var(--primary);
}

.option-item.selected .option-key {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  transform: rotate(360deg);
}

.option-text {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-main);
  flex: 1;
  line-height: 1.45;
}
.option-item.selected .option-text {
  font-weight: 700;
  color: #005f69;
}

/* Buttons with tactile feedback */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
}
.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, #007a87 0%, #005f69 100%);
  color: #ffffff;
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 8px 25px rgba(0, 122, 135, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
}
.btn-success:hover:not(:disabled) {
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
}
.btn-danger:hover:not(:disabled) {
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.35);
}

.btn-outline {
  background: #ffffff;
  border: 1.5px solid var(--border-glass);
  color: var(--text-main);
}
.btn-outline:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

/* Success Card */
.success-card {
  text-align: center;
  padding: 50px 32px;
}
.success-icon-wrap {
  width: 90px;
  height: 90px;
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #059669;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  margin: 0 auto 24px auto;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.25);
  animation: bounceIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes bounceIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

/* Admin Dashboard Specifics */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 8px;
}

/* Table */
.table-responsive {
  overflow-x: auto;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

thead {
  background: #f8fafc;
  border-bottom: 1px solid var(--border-glass);
}

th {
  padding: 14px 18px;
  font-weight: 800;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 16px 18px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-main);
}

tbody tr {
  transition: background 0.15s ease;
}
tbody tr:hover {
  background: #f8fafc;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }

/* Modal */
.modal-backdrop {
  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;
  padding: 16px;
  z-index: 100;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 820px;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes modalPop {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 20px 28px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 24px 28px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 28px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: flex-end;
  background: #f8fafc;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s ease;
}
.btn-close:hover { color: var(--danger); }

.review-item {
  border: 1.5px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-bottom: 16px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.review-item.correct {
  border-left: 5px solid var(--success);
}

.review-item.wrong {
  border-left: 5px solid var(--danger);
  background: #fffafa;
}

.review-explanation {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-top: 10px;
  font-size: 0.88rem;
  color: #334155;
  line-height: 1.45;
}

/* Animated Custom Input Validation Error */
.form-input.has-error {
  border-color: var(--danger) !important;
  background-color: #fffafb !important;
  box-shadow: 0 0 0 4px var(--danger-glow) !important;
  animation: inputShake 0.4s ease-in-out;
}

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

.input-error-msg {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #dc2626;
  font-size: 0.84rem;
  font-weight: 700;
  margin-top: 6px;
  animation: errorSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes errorSlideDown {
  0% { opacity: 0; transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}

.hidden { display: none !important; }

