/* =============================================================================
   MFMS Exam Dashboard - Premium UI Design System
   ============================================================================= */

:root {
  --dash-primary: #1e3a8a;
  --dash-primary-light: #3b82f6;
  --dash-accent: #d97706;
  --dash-bg: #f8fafc;
  --dash-card-bg: #ffffff;
  --dash-border: #e2e8f0;
  --dash-text-main: #0f172a;
  --dash-text-muted: #64748b;
  --dash-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.06), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --dash-shadow-hover: 0 20px 25px -5px rgba(30, 58, 138, 0.12), 0 10px 10px -5px rgba(30, 58, 138, 0.06);
}

/* --- Hero Banner Polish --- */
.page-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #1e1b4b 100%) !important;
  position: relative;
  overflow: hidden;
  padding: 3.5rem 0 3rem !important;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
}

.page-hero .breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.35rem 1rem;
  border-radius: 9999px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 1rem;
}

.page-hero .breadcrumb a,
.page-hero .breadcrumb span {
  color: rgba(255, 255, 255, 0.85) !important;
  font-size: 0.825rem;
  text-decoration: none;
  font-weight: 500;
}

.page-hero .breadcrumb a:hover {
  color: #ffffff !important;
}

.page-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: #ffffff !important;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.page-hero h1 span {
  color: #fbbf24 !important;
  position: relative;
}

.page-hero p {
  color: rgba(255, 255, 255, 0.85) !important;
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* --- Dashboard Section Layout --- */
.dashboard-wrapper {
  padding: 2.5rem 0 4rem;
  background: var(--dash-bg);
  min-height: 75vh;
}

/* --- User Profile Card --- */
.dashboard-user-bar {
  background: var(--dash-card-bg);
  border: 1px solid var(--dash-border);
  border-radius: 16px;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--dash-shadow);
  flex-wrap: wrap;
  gap: 1.25rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-user-bar:hover {
  box-shadow: var(--dash-shadow-hover);
}

.user-profile-info {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.user-avatar {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25);
  border: 2px solid #ffffff;
}

.user-details h3 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dash-text-main);
  letter-spacing: -0.01em;
}

.user-details p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--dash-text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dashboard-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

/* --- Stat Cards Grid --- */
.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.dash-stat-card {
  background: var(--dash-card-bg);
  border: 1px solid var(--dash-border);
  border-radius: 14px;
  padding: 1.35rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.15rem;
  box-shadow: var(--dash-shadow);
  transition: all 0.25 ease;
  position: relative;
  overflow: hidden;
}

.dash-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--dash-shadow-hover);
}

.dash-stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.dash-stat-icon.blue { background: #eff6ff; color: #2563eb; border: 1px solid #dbeafe; }
.dash-stat-icon.green { background: #f0fdf4; color: #16a34a; border: 1px solid #dcfce7; }
.dash-stat-icon.red { background: #fef2f2; color: #dc2626; border: 1px solid #fee2e2; }
.dash-stat-icon.gold { background: #fefce8; color: #ca8a04; border: 1px solid #fef9c3; }

.dash-stat-val {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--dash-text-main);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.dash-stat-label {
  font-size: 0.85rem;
  color: var(--dash-text-muted);
  font-weight: 600;
  margin-top: 0.2rem;
}

/* --- Table Card & Header --- */
.dash-card {
  background: var(--dash-card-bg);
  border: 1px solid var(--dash-border);
  border-radius: 16px;
  box-shadow: var(--dash-shadow);
  overflow: hidden;
}

.dash-card-header {
  padding: 1.35rem 2rem;
  border-bottom: 1px solid var(--dash-border);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.dash-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--dash-text-main);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.dash-table-wrap {
  overflow-x: auto;
}

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

.dash-table th {
  background: #f8fafc;
  padding: 1rem 1.5rem;
  font-weight: 600;
  color: #475569;
  border-bottom: 1px solid var(--dash-border);
  white-space: nowrap;
  font-size: 0.825rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dash-table td {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}

.dash-table tr:hover td {
  background: #f8fafc;
}

.dash-table tr:last-child td {
  border-bottom: none;
}

/* --- Status Badges --- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.status-badge.registered {
  background: #fefce8;
  color: #a16207;
  border: 1px solid #fef08a;
}

.status-badge.selected {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.status-badge.not_selected {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* --- Empty State --- */
.empty-state {
  padding: 4rem 2rem;
  text-align: center;
  color: var(--dash-text-muted);
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  background: #f1f5f9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 2.25rem;
  color: #94a3b8;
}

.empty-state h4 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dash-text-main);
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 0.925rem;
  max-width: 420px;
  margin: 0 auto 1.5rem;
  color: var(--dash-text-muted);
}

/* --- Edit Profile Modal --- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center;
  z-index: 1000; opacity: 0; transition: opacity 0.2s ease;
}
.modal-overlay.active { display: flex; opacity: 1; }
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 500px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); transform: scale(0.95); transition: transform 0.2s ease;
  position: relative;
}
.modal-overlay.active .modal { transform: scale(1); }

/* --- Premium Profile Modal Redesign --- */
.profile-modal {
  overflow: hidden;
  max-width: 420px !important;
}
.profile-modal-cover {
  height: 120px;
  background: linear-gradient(135deg, var(--dash-primary) 0%, var(--dash-primary-light) 100%);
  position: relative;
}
.modal-close-white {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: rgba(255, 255, 255, 0.8) !important;
  background: rgba(0, 0, 0, 0.2) !important;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem !important;
  cursor: pointer;
  transition: all 0.2s ease !important;
}
.modal-close-white:hover {
  background: rgba(0, 0, 0, 0.4) !important;
  color: #fff !important;
}
.profile-modal-avatar {
  width: 80px;
  height: 80px;
  background: #fff;
  border: 4px solid #fff;
  border-radius: 50%;
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--dash-primary);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 10;
}
.profile-modal-body {
  padding: 3.5rem 2rem 1.5rem !important;
}
.profile-modal-header-text {
  text-align: center;
  margin-bottom: 1.5rem;
}
.profile-modal-header-text h2 {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
  color: var(--dash-text-main);
  font-weight: 700;
}
.profile-modal-header-text p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--dash-text-muted);
}
.form-group-modern {
  margin-bottom: 1.15rem;
}
.form-label-modern {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--dash-text-main);
  margin-bottom: 0.4rem;
}
.input-icon-wrap {
  position: relative;
}
.input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.95rem;
}
.form-input-modern {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.6rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--dash-text-main);
  transition: all 0.2s ease;
  box-sizing: border-box;
}
.form-input-modern:focus {
  background: #fff;
  border-color: var(--dash-primary-light);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  outline: none;
}
.input-icon-wrap:focus-within .input-icon {
  color: var(--dash-primary-light);
}
.profile-modal-footer {
  background: #fff !important;
  border-top: none !important;
  padding: 0 2rem 2rem !important;
  display: flex;
  gap: 1rem;
}
.profile-alert {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-top: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.profile-alert.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}
.profile-alert.success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

/* -- Detail View (Mirrors Admin Student Profile) -- */
.adm-detail-container { display: flex; flex-direction: column; }
.adm-sections-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.25rem;
    align-items: start;
}
.adm-detail-hero {
    display: flex; gap: 1.5rem; align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 50%, #f5f0ff 100%);
    border-radius: 14px;
    border: 1px solid rgba(99, 102, 241, 0.12);
    margin-bottom: 1.5rem;
}
.adm-hero-photo img {
    width: 110px; height: 140px; border-radius: 12px; object-fit: cover;
    border: 3px solid white; box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    cursor: pointer; transition: transform 0.2s;
}
.adm-hero-photo img:hover { transform: scale(1.05); }
.adm-hero-avatar {
    width: 110px; height: 140px; border-radius: 12px;
    background: linear-gradient(135deg, var(--blue-100), var(--blue-200));
    display: flex; align-items: center; justify-content: center;
    color: var(--blue-500); font-size: 2.8rem;
    border: 3px solid white; box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    flex-shrink: 0;
}
.adm-hero-info { flex: 1; min-width: 0; }
.adm-hero-name {
    font-size: 1.25rem; font-weight: 800;
    color: var(--gray-900); text-transform: uppercase;
    margin: 0 0 4px; letter-spacing: 0.02em;
}
.adm-hero-id {
    font-family: 'Courier New', monospace; font-size: 0.85rem; font-weight: 700;
    color: var(--blue-600); letter-spacing: 1px; margin-bottom: 10px;
    display: flex; align-items: center; gap: 6px;
}
.adm-hero-chips {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.adm-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 12px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 600;
}
.adm-chip-blue { background: var(--blue-100); color: var(--blue-700); }
.adm-chip-green { background: #d1fae5; color: #047857; }
.adm-chip-purple { background: #ede9fe; color: #7c3aed; }
.adm-chip-gray { background: var(--gray-100); color: var(--gray-700); }

.adm-section {
    margin-bottom: 1rem; border: 1px solid var(--gray-100);
    border-radius: 12px; overflow: hidden; background: white;
}
.adm-section-head {
    padding: 11px 18px; background: var(--gray-50);
    font-size: 0.78rem; font-weight: 700; color: var(--gray-500);
    text-transform: uppercase; letter-spacing: 0.06em;
    display: flex; align-items: center; gap: 8px;
    border-bottom: 1px solid var(--gray-100);
}
.adm-section-head i { font-size: 0.88rem; color: var(--blue-500); width: 20px; text-align: center; }
.adm-section-grid { display: grid; grid-template-columns: 1fr 1fr; }
.adm-field {
    padding: 12px 18px; border-bottom: 1px solid var(--gray-50); border-right: 1px solid var(--gray-50);
}
.adm-field:nth-child(even) { border-right: none; }
.adm-field:last-child, .adm-field:nth-last-child(2):nth-child(odd) { border-bottom: none; }
.adm-field-full { grid-column: 1 / -1; border-right: none !important; }
.adm-field-label {
    font-size: 0.7rem; font-weight: 500; color: var(--gray-400);
    text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 3px;
}
.adm-field-value {
    font-size: 0.9rem; font-weight: 600; color: var(--gray-800); word-break: break-word;
}

/* -- Full-Screen Immersive Modal Override -- */
#exam-detail-modal .modal {
    width: 96%;
    max-width: 1000px;
    min-height: 75vh;
    max-height: 92vh;
    border-radius: 16px;
    padding: 0;
    display: flex;
    flex-direction: column;
}

#exam-detail-modal .modal-header {
    padding: 1.25rem 1.75rem;
    margin: 0;
    border-bottom: 1px solid var(--gray-100);
    border-radius: 16px 16px 0 0;
    background: var(--white);
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#exam-detail-modal .modal-header .modal-close {
    position: static;
    background: var(--gray-100);
    color: var(--gray-600);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

#exam-detail-modal .modal-header .modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

#exam-detail-modal .modal-body {
    padding: 1.5rem 1.75rem;
    overflow-y: auto;
    flex: 1;
    margin: 0;
}

#exam-detail-modal .modal-footer {
    padding: 1rem 1.75rem;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
    border-radius: 0 0 16px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

@media (max-width: 768px) {
    #exam-detail-modal .modal { width: 98%; max-height: 95vh; }
    #exam-detail-modal .modal-body { padding: 1rem; }
    #exam-detail-modal .modal-header { padding: 1rem; }
}
