/* =========================================================
   Placement Drive Assessment System - Global Theme Stylesheet
   ========================================================= */

:root {
  --primary: #1e40af;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-dark: #172554;
  --accent: #0284c7;
  --success: #15803d;
  --success-light: #dcfce7;
  --warning: #b45309;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --purple: #7e22ce;
  --purple-light: #f3e8ff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.5;
  min-height: 100vh;
}

/* User Selection & Context menu disable during exam */
body.exam-mode {
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  overflow-x: hidden;
  overflow-y: auto; /* Allows smooth scrolling so content is never cut off */
}

/* Common Header */
.top-nav {
  background: #ffffff;
  border-bottom: 1px solid var(--gray-200);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 2px 4px rgba(30, 64, 175, 0.2);
}

.brand-info h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
}

.brand-info p {
  font-size: 12px;
  color: var(--gray-500);
}

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

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: white;
  color: var(--gray-700);
  border-color: var(--gray-300);
}
.btn-secondary:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
}

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover {
  background: #166534;
}

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover {
  background: #991b1b;
}

.btn-warning {
  background: #f59e0b;
  color: #78350f;
}

.btn-purple {
  background: var(--purple);
  color: white;
}
.btn-purple:hover {
  background: #6b21a8;
}

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

.btn-lg {
  padding: 12px 24px;
  font-size: 16px;
  border-radius: var(--radius-md);
}

.btn:disabled, .btn[disabled] {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  background: #94a3b8 !important;
  border-color: #cbd5e1 !important;
  color: #f1f5f9 !important;
  box-shadow: none !important;
  transform: none !important;
}

/* Cards */
.card {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

/* =========================================================
   Login & Registration Page Styles
   ========================================================= */
.login-container {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 16px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.login-box {
  width: 100%;
  max-width: 480px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.login-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 30px 24px;
  text-align: center;
}

.login-logo-badge {
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  margin-bottom: 12px;
}

.login-header h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #ffffff;
}

.login-header p {
  font-size: 13px;
  color: #bfdbfe;
}

.login-tabs {
  display: flex;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
}

.tab-btn {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-600);
  background: transparent;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab-btn.active {
  color: var(--primary);
  background: white;
  border-bottom-color: var(--primary);
}

.login-body {
  padding: 28px 24px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: white;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-purple { background: var(--purple-light); color: var(--purple); }
.badge-gray { background: var(--gray-200); color: var(--gray-700); }

/* Alert Box */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #fecaca;
}

.alert-warning {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid #fde68a;
}

.alert-success {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid #bbf7d0;
}

/* =========================================================
   Exam Interface (EMS Layout)
   ========================================================= */
.exam-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #f1f5f9;
}

/* Top bar during exam */
.exam-header {
  background: #ffffff;
  border-bottom: 2px solid var(--gray-200);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  flex-shrink: 0;
}

.candidate-profile-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.candidate-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  border: 2px solid #bfdbfe;
}

.candidate-details .name {
  font-weight: 700;
  font-size: 14px;
  color: var(--gray-900);
}

.candidate-details .sub {
  font-size: 12px;
  color: var(--gray-500);
}

.exam-center-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-900);
  color: #ffffff;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.exam-center-timer.danger {
  background: var(--danger);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.violation-status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
  border-radius: 20px;
}

/* Exam Section Sub-Header */
.section-nav-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--gray-200);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.section-pill {
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--gray-300);
  background: var(--gray-50);
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.15s;
}

.section-pill:hover {
  background: var(--gray-100);
}

.section-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Main Exam Body Split */
.exam-main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Left Question Panel */
.question-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: white;
  overflow-y: auto;
  border-right: 1px solid var(--gray-200);
}

.question-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.q-badge {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
}

.marks-badge {
  font-size: 12px;
  color: var(--gray-500);
}

.question-body {
  padding: 24px;
  flex: 1;
}

.question-text {
  font-size: 16px;
  font-weight: 500;
  color: var(--gray-900);
  line-height: 1.6;
  margin-bottom: 24px;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
  background: white;
}

.option-item:hover {
  background: var(--primary-light);
  border-color: #93c5fd;
}

.option-item.selected {
  background: #eff6ff;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.option-radio {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
}

.option-label {
  font-weight: 700;
  font-size: 14px;
  color: var(--gray-700);
  min-width: 24px;
}

.option-text {
  font-size: 14px;
  color: var(--gray-800);
  flex: 1;
}

/* Exam Action Footer */
.question-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--gray-200);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.footer-left {
  display: flex;
  gap: 10px;
}

.footer-right {
  display: flex;
  gap: 10px;
}

/* Right Question Palette Sidebar */
.palette-sidebar {
  width: 320px;
  background: var(--gray-50);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.palette-header {
  padding: 16px;
  background: white;
  border-bottom: 1px solid var(--gray-200);
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-800);
}

/* Legend */
.palette-legend {
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid var(--gray-200);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  font-size: 11px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-circle {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}

.palette-grid-wrapper {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.palette-btn {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-300);
  background: white;
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.palette-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.palette-btn.current {
  border: 2px solid #2563eb !important;
  font-weight: 800;
}

/* Question Status Colors */
.palette-btn.status-answered {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.palette-btn.status-not-answered {
  background: #ea580c;
  color: white;
  border-color: #ea580c;
}

.palette-btn.status-review {
  background: var(--purple);
  color: white;
  border-color: var(--purple);
}

.palette-btn.status-review-answered {
  background: var(--purple);
  color: white;
  border-color: var(--purple);
}

.palette-btn.status-review-answered::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
}

.palette-btn.status-not-visited {
  background: #f1f5f9;
  color: var(--gray-600);
  border-color: var(--gray-300);
}

.palette-footer {
  padding: 16px;
  background: white;
  border-top: 1px solid var(--gray-200);
}

/* =========================================================
   Security & Proctoring Warning Overlay
   ========================================================= */
.proctor-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(5px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.proctor-box {
  background: white;
  width: 100%;
  max-width: 520px;
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border-top: 6px solid var(--danger);
  animation: shake 0.4s ease-in-out;
}

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

.proctor-icon {
  width: 64px;
  height: 64px;
  background: #fee2e2;
  color: var(--danger);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 16px;
}

.proctor-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.proctor-message {
  font-size: 14px;
  color: var(--gray-600);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Instructions Screen before Exam */
.instructions-container {
  max-width: 860px;
  margin: 16px auto 30px auto;
  padding: 0 16px 40px;
}

.instructions-sticky-footer {
  position: sticky;
  bottom: 0;
  background: white;
  border-top: 2px solid var(--gray-200);
  padding: 14px 4px 6px;
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  z-index: 10;
  box-shadow: 0 -4px 6px -2px rgba(0,0,0,0.03);
}

.instruction-list {
  margin: 20px 0;
  padding-left: 20px;
  color: var(--gray-700);
  font-size: 14px;
}

.instruction-list li {
  margin-bottom: 12px;
  line-height: 1.6;
}

/* =========================================================
   Admin Dashboard Styles
   ========================================================= */
.admin-container {
  max-width: 1300px;
  margin: 24px auto;
  padding: 0 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.stat-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--gray-900);
}

.stat-sub {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}

.table-wrapper {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.data-table th {
  background: var(--gray-100);
  padding: 12px 16px;
  font-weight: 700;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-800);
  vertical-align: middle;
}

.data-table tr:hover {
  background: var(--gray-50);
}

/* Candidate Score Card (Result Page) */
.result-card {
  max-width: 750px;
  margin: 40px auto;
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.result-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 32px 24px;
  text-align: center;
}

.score-display-ring {
  font-size: 48px;
  font-weight: 800;
  margin: 12px 0 4px;
  color: #ffffff;
}

.score-percentage {
  font-size: 16px;
  color: #bfdbfe;
  font-weight: 600;
}

.result-body {
  padding: 32px;
}

.section-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-200);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: white;
  border-radius: var(--radius-md);
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
}

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

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

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Excel File Dropzone */
.excel-dropzone {
  border: 2px dashed #93c5fd;
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.excel-dropzone:hover, .excel-dropzone.dragover {
  border-color: var(--primary);
  background: #eff6ff;
  transform: translateY(-1px);
}

