/**
 * ARIXA EXAM PORTAL - Primary Design System
 * Theme: ARIXA Physiotherapy Learning Solutions in collaboration with APTA Kansas
 */

:root {
  --arixa-primary: #0e5f76;
  --arixa-primary-dark: #083c4b;
  --arixa-primary-light: #167e9c;
  --arixa-accent: #f59e0b;
  --arixa-teal: #06b6d4;
  --arixa-bg: #f8fafc;
  --arixa-card-bg: #ffffff;
  --arixa-text: #1e293b;
  --arixa-text-muted: #64748b;
  --arixa-border: #e2e8f0;
  
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --info: #0284c7;
  --info-bg: #f0f9ff;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(14,95,118,0.1);
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Tahoma, sans-serif;
  background-color: var(--arixa-bg);
  color: var(--arixa-text);
  line-height: 1.6;
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* LTR Support */
body[dir="ltr"], .ltr {
  direction: ltr;
  text-align: left;
}

/* Top Navbar */
.arixa-navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--arixa-border);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

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

.brand-group img.logo-arixa {
  height: 48px;
  object-fit: contain;
}

.brand-divider {
  width: 1px;
  height: 32px;
  background: var(--arixa-border);
}

.apta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f0fdfa;
  border: 1px solid #ccfbf1;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--arixa-primary);
}

.apta-pill img {
  height: 22px;
  object-fit: contain;
}

.user-nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-circle {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--arixa-primary) 0%, var(--arixa-teal) 100%);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--arixa-text);
}

.user-role {
  font-size: 11px;
  color: var(--arixa-text-muted);
}

/* Layout container */
.app-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 30px 20px;
  flex: 1;
  width: 100%;
}

/* Cards & Surfaces */
.card {
  background: var(--arixa-card-bg);
  border: 1px solid var(--arixa-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header-styled {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--arixa-border);
  padding-bottom: 14px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--arixa-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--arixa-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--arixa-primary-dark);
  box-shadow: 0 4px 12px rgba(14,95,118,0.25);
}

.btn-secondary {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-warning {
  background: var(--warning);
  color: #fff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 6px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: 10px;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.badge-success {
  background: var(--success-bg);
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.badge-danger {
  background: var(--danger-bg);
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.badge-warning {
  background: var(--warning-bg);
  color: #92400e;
  border: 1px solid #fcd34d;
}

.badge-info {
  background: var(--info-bg);
  color: #075985;
  border: 1px solid #7dd3fc;
}

/* Proctoring Webcam & Timer Toolbar */
.proctor-header {
  position: sticky;
  top: 0;
  background: #ffffff;
  border-bottom: 2px solid var(--arixa-primary);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 999;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.exam-timer-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #083c4b;
  color: #ffffff;
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 20px;
  font-family: 'Courier New', Courier, monospace;
  font-weight: 700;
  letter-spacing: 1px;
}

.exam-timer-box.timer-urgent {
  background: #b91c1c;
  animation: pulse-danger 1s infinite alternate;
}

@keyframes pulse-danger {
  0% { transform: scale(1); }
  100% { transform: scale(1.04); }
}

/* Floating Webcam Box */
.proctor-cam-wrapper {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 220px;
  height: 165px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
  border: 3px solid var(--arixa-primary);
  z-index: 1000;
}

.proctor-cam-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror view */
}

.proctor-cam-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rec-dot {
  width: 9px;
  height: 9px;
  background: #ef4444;
  border-radius: 50%;
  display: inline-block;
  animation: rec-blink 1.2s infinite;
}

@keyframes rec-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

/* Cheating Lockout Fullscreen Overlay */
.cheating-lockout-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.96);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  padding: 30px;
}

.lockout-box {
  background: #1e293b;
  border: 2px solid #ef4444;
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 580px;
  box-shadow: 0 15px 40px rgba(239, 68, 68, 0.3);
}

.lockout-icon {
  font-size: 64px;
  color: #ef4444;
  margin-bottom: 20px;
  animation: shake 0.6s;
}

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

/* Question Box */
.question-card {
  background: #ffffff;
  border: 1px solid var(--arixa-border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 20px;
}

.question-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e0f2fe;
  color: #0369a1;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}

.question-text {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 18px;
  line-height: 1.6;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1.5px solid var(--arixa-border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.option-item:hover {
  background: #f8fafc;
  border-color: var(--arixa-teal);
}

.option-item.selected {
  background: #f0fdfa;
  border-color: var(--arixa-primary);
}

.option-item input[type="radio"] {
  accent-color: var(--arixa-primary);
  width: 18px;
  height: 18px;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

.data-table th {
  background: #f8fafc;
  padding: 12px 16px;
  font-weight: 700;
  color: #475569;
  border-bottom: 2px solid var(--arixa-border);
  font-size: 13px;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--arixa-border);
  font-size: 14px;
  color: #334155;
  vertical-align: middle;
}

.data-table tr:hover td {
  background: #fbfcfe;
}

/* Footer */
.arixa-footer {
  background: #ffffff;
  border-top: 1px solid var(--arixa-border);
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--arixa-text-muted);
  margin-top: auto;
}
