/* Results Page Stylesheet */

/* Layout & Page structure */
.page-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.results-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Tabs & Chips */
.results-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0;
  scrollbar-width: none; /* Hide scrollbar Firefox */
}
.results-tabs::-webkit-scrollbar {
  display: none; /* Hide scrollbar Chrome/Safari */
}

.results-tab {
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  padding: 10px 18px;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.results-tab:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.results-tab.active {
  background: var(--accent);
  color: #03140c;
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(105, 229, 165, 0.2);
}

.results-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  scrollbar-width: none;
}
.results-chips::-webkit-scrollbar {
  display: none;
}

.results-chip {
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.results-chip:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.results-chip.active {
  background: rgba(105, 229, 165, 0.12);
  color: var(--accent);
  border-color: var(--accent);
}

/* GPA Metric Cards */
.results-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.metric-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  padding: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}
.metric-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(105, 229, 165, 0.03) 0%, transparent 70%);
  pointer-events: none;
}

.metric-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.metric-value {
  font-size: 42px;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
}

/* Grades Table Card */
.results-table-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 22px;
  padding: 20px;
}

.results-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.results-table-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.results-status-badge {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.results-status-badge.pass {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.3);
}
.results-status-badge.fail {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.results-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
}

.results-table th, .results-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.results-table th {
  background: rgba(255,255,255,0.02);
  color: var(--accent);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.results-table td {
  color: #fff;
  font-size: 14px;
}

.results-table tr:last-child td {
  border-bottom: 0;
}

.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 12px;
}
.grade-badge.excellent {
  background: rgba(105, 229, 165, 0.15);
  color: var(--accent);
}
.grade-badge.good {
  background: rgba(52, 152, 219, 0.15);
  color: #3498db;
}
.grade-badge.pass {
  background: rgba(241, 196, 15, 0.15);
  color: #f1c40f;
}
.grade-badge.fail {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
}

/* Upload Panel Form styles */
.result-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.upload-area {
  border: 2px dashed rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  background: rgba(255,255,255,0.01);
  transition: all 0.2s ease;
  margin-bottom: 20px;
}
.upload-area:hover, .upload-area.dragover {
  border-color: var(--accent);
  background: rgba(105, 229, 165, 0.02);
}

.upload-area-icon {
  font-size: 38px;
  margin-bottom: 10px;
}

/* Progress Section */
.import-progress-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 22px;
  padding: 20px;
  margin-top: 20px;
}

.progress-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
  margin-bottom: 16px;
}

.progress-metric-item {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}
.progress-metric-item.failed {
  border-color: rgba(231, 76, 60, 0.2);
}
.progress-metric-item.success {
  border-color: rgba(46, 204, 113, 0.2);
}

.progress-metric-val {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 2px;
}

.progress-bar-container {
  background: rgba(255,255,255,0.06);
  height: 8px;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 14px;
}

.progress-bar-fill {
  background: var(--accent);
  height: 100%;
  width: 0%;
  border-radius: 99px;
  transition: width 0.1s ease;
  box-shadow: 0 0 8px rgba(105, 229, 165, 0.4);
}

.console-log-box {
  background: #020b08;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px;
  font-family: monospace;
  font-size: 12px;
  max-height: 180px;
  overflow-y: auto;
  white-space: pre-wrap;
  color: #aab9b1;
  line-height: 1.5;
}
.console-log-box .err { color: #e74c3c; }
.console-log-box .ok { color: var(--accent); }
.console-log-box .warn { color: #f1c40f; }

/* Responsive adjustments */
@media (max-width: 480px) {
  .results-metrics {
    grid-template-columns: 1fr;
  }
  .result-form-row {
    grid-template-columns: 1fr;
  }
  .progress-metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .results-table th, .results-table td {
    padding: 10px 12px;
  }
}

/* Global Profile Modal Overlay */
.profile-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 17000; /* Ensure it is above results page and calendar pages */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 16px;
}

.profile-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.profile-modal-sheet {
  background: linear-gradient(145deg, #112b20, #0b2118);
  border: 1px solid #315344;
  border-radius: 24px;
  padding: 24px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(105, 229, 165, 0.05);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.profile-modal-overlay.active .profile-modal-sheet {
  transform: scale(1);
}

/* Profile Photo & Info */
.profile-photo {
  border: 3px solid #315344;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.profile-avatar {
  background: rgba(105, 229, 165, 0.12);
  color: var(--accent);
  border: 2px solid #315344;
  border-radius: 50%;
  text-align: center;
  font-weight: 800;
}

.status-pill {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(105, 229, 165, 0.15);
  color: var(--accent);
  border: 1px solid rgba(105, 229, 165, 0.3);
}

.status-pill.rejected {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.3);
}

/* Loading Skeletons */
.skeleton-pulse {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 8px;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
}

.skeleton-title {
  height: 24px;
  width: 180px;
  margin: 4px auto;
}

.skeleton-badge {
  height: 18px;
  width: 70px;
  border-radius: 99px;
  margin: 0 auto;
}

.skeleton-line {
  height: 16px;
  margin-bottom: 8px;
  width: 100%;
}
.skeleton-line:last-child {
  margin-bottom: 0;
}

