@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;600;700&display=swap');

:root {
  --bg-dark: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-border: rgba(255, 255, 255, 0.1);
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.35);
  --accent-green: #10b981;
  --accent-green-glow: rgba(16, 185, 129, 0.35);
  --accent-red: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.1) 0px, transparent 50%);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  padding-bottom: 60px;
}

/* Header */
header {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bg-card-border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem 2rem;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--accent-green));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 20px var(--primary-glow);
}

.brand-text h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.nav-tabs {
  display: flex;
  background: rgba(2, 6, 23, 0.6);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--bg-card-border);
}

.nav-tab {
  padding: 8px 18px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.875rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-tab.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* Layout Container */
.main-container {
  max-width: 1100px;
  margin: 2.5rem auto;
  padding: 0 1.5rem;
}

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  margin-bottom: 2rem;
}

.card-header {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--bg-card-border);
  padding-bottom: 1rem;
}

.card-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* Wizard Steps */
.step-indicator {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  position: relative;
}

.step-indicator::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 30px;
  right: 30px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 1;
}

.step-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;

}

.step-num {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #1e293b;
  border: 2px solid var(--text-dim);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}

.step-item.active .step-num {
  background: var(--primary);
  border-color: #60a5fa;
  color: white;
  box-shadow: 0 0 15px var(--primary-glow);
}

.step-item.completed .step-num {
  background: var(--accent-green);
  border-color: #34d399;
  color: white;
}

.step-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.step-item.active .step-title {
  color: white;
  font-weight: 600;
}

/* Form Section */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 8px;
}

input[type="text"], select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  color: white;
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}

input[type="text"]:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Student Identity Card */
.student-profile-badge {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1rem;
  animation: fadeIn 0.3s ease-out;
}

.profile-avatar {
  width: 90px;
  height: 90px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  background: #0f172a;
}

.profile-details h3 {
  font-size: 1.15rem;
  color: white;
  font-weight: 700;
}

.profile-details p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.profile-meta {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.meta-chip {
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  color: #93c5fd;
  font-weight: 500;
}

/* Face Comparison Grid */
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

@media (max-width: 640px) {
  .comparison-grid {
    grid-template-columns: 1fr;
  }
}

.photo-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}

.photo-box h4 {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.photo-preview-wrapper {
  width: 100%;
  height: 220px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #020617;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--text-dim);
}

.photo-preview-wrapper img, .photo-preview-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-controls {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* Signature Box & Image Upload */
.signature-section {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.5rem 0;
}

.signature-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 1rem;
}

.sig-btn {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bg-card-border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.sig-btn.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--primary);
  color: white;
}

.canvas-container {
  width: 100%;
  height: 160px;
  background: #ffffff;
  border-radius: var(--radius-sm);
  position: relative;
  touch-action: none;
}

canvas {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-sm);
  cursor: crosshair;
}

.signature-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 0.8rem;
}

.size-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.size-badge.exceeded {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

/* Consent Radio Choice */
.consent-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

.consent-card {
  border: 2px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(15, 23, 42, 0.5);
  text-align: center;
}

.consent-card:hover {
  border-color: var(--primary);
}

.consent-card.selected-agree {
  border-color: var(--accent-green);
  background: rgba(16, 185, 129, 0.1);
  box-shadow: 0 0 20px var(--accent-green-glow);
}

.consent-card.selected-disagree {
  border-color: var(--accent-red);
  background: rgba(239, 68, 68, 0.1);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.25);
}

.consent-card h4 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.consent-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #2563eb);
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--bg-card-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-success {
  background: linear-gradient(135deg, var(--accent-green), #059669);
  color: white;
  box-shadow: 0 4px 15px var(--accent-green-glow);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.actions-row {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
}

/* Compact Lecturer Dashboard Stats Strip */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 1.25rem;
}

.stat-pill {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-pill-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.stat-pill-info {
  display: flex;
  flex-direction: column;
}

.stat-pill-val {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  line-height: 1.2;
  color: white;
}

.stat-pill-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Audit Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--bg-card-border);
}

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

table.admin-table th {
  background: rgba(15, 23, 42, 0.95);
  padding: 12px 16px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--bg-card-border);
  white-space: nowrap;
}

table.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

table.admin-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.tbl-avatar {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--bg-card-border);
}

.tbl-signature {
  height: 36px;
  max-width: 100px;
  object-fit: contain;
  background: white;
  padding: 2px;
  border-radius: 4px;
}

.status-tag {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
}

.status-tag.agreed {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.status-tag.disagreed {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.status-tag.pending {
  background: rgba(234, 179, 8, 0.2);
  color: #fde047;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Print CSS Rules for Ultra-Compact PDF Output */
@media print {
  body {
    background: white !important;
    color: black !important;
    padding: 0 !important;
    font-size: 9pt !important;
  }
  header, .nav-tabs, .actions-row, .step-indicator, .camera-controls, #studentFormSection, .filters-bar, .no-print {
    display: none !important;
  }
  .main-container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .glass-card {
    background: white !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    color: black !important;
  }

  /* Ultra-Compact Print Header */
  .print-header {
    display: block !important;
    text-align: center;
    margin-bottom: 8px !important;
    padding-bottom: 4px;
    border-bottom: 2px solid #000;
  }
  .print-header h2 {
    font-size: 11pt !important;
    font-weight: bold;
    margin: 0 !important;
    color: black !important;
  }
  .print-header h3 {
    font-size: 10pt !important;
    margin: 2px 0 !important;
    color: black !important;
  }
  .print-header p {
    font-size: 8.5pt !important;
    margin: 2px 0 !important;
    font-weight: bold;
    color: black !important;
  }

  /* Ultra-Compact Stats Strip in PDF Print */
  .stats-strip {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-around !important;
    gap: 8px !important;
    margin-bottom: 8px !important;
    padding: 4px 8px !important;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
  }
  .stat-pill {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    gap: 6px !important;
  }
  .stat-pill-icon {
    display: none !important;
  }
  .stat-pill-val {
    font-size: 9.5pt !important;
    color: black !important;
  }
  .stat-pill-lbl {
    font-size: 8pt !important;
    color: #475569 !important;
  }

  /* Table PDF Print Optimizations */
  table.admin-table {
    font-size: 8.5pt !important;
    color: black !important;
    border: 1px solid #000 !important;
    width: 100% !important;
  }
  table.admin-table th {
    background: #e2e8f0 !important;
    color: black !important;
    padding: 4px 6px !important;
    border: 1px solid #94a3b8 !important;
    font-size: 8.5pt !important;
  }
  table.admin-table td {
    border: 1px solid #cbd5e1 !important;
    color: black !important;
    padding: 3px 6px !important;
  }
  .tbl-avatar {
    width: 30px !important;
    height: 30px !important;
    border: 1px solid #94a3b8 !important;
    border-radius: 3px !important;
  }
  .tbl-signature {
    height: 24px !important;
    max-width: 70px !important;
    border: 1px solid #ccc !important;
  }
  .status-tag {
    padding: 1px 6px !important;
    font-size: 7.5pt !important;
    border: 1px solid #cbd5e1 !important;
  }
}
