/* FINAL ULTRA-TARGETED CSS - Only affects the specific "One unified row" section */

/* Reset and Base Styles - Keep Original */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: #f0f4fa;
}

.main-header {
  width: 100%;
}

.header-background {
  width: 100%;
  display: block;
}

/* ULTRA-SPECIFIC: Target ONLY the header-row that comes AFTER header-background */
.header-background + .header-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  padding: 20px 25px !important;
  gap: 25px !important;
  flex-wrap: wrap !important;
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 16px !important;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08) !important;
  position: relative !important;
  overflow: visible !important;
  margin: 15px !important;
  max-height: none !important;
}

/* Animated gradient border - ONLY for the specific header-row */
.header-background + .header-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #f5576c);
  background-size: 300% 100%;
  animation: finalHeaderGradient 4s ease infinite;
}

@keyframes finalHeaderGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Target ONLY Home button in the specific header-row after header-background */
.header-background + .header-row #home-btn.styled-button.home {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: white !important;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.25) !important;
  border: none !important;
  padding: 12px 20px !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative !important;
  overflow: hidden !important;
}

.header-background + .header-row #home-btn.styled-button.home::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.header-background + .header-row #home-btn.styled-button.home:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.35) !important;
}

.header-background + .header-row #home-btn.styled-button.home:hover::before {
  left: 100%;
}

/* Target ONLY student name in the specific header-row after header-background */
.header-background + .header-row #student-name-bar {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
  color: white !important;
  padding: 12px 20px 12px 24px !important;
  padding-right: 45px !important;
  border-radius: 25px !important;
  font-weight: 700 !important;
  font-size: 16px !important;
  box-shadow: 0 4px 15px rgba(240, 147, 251, 0.25) !important;
  position: relative !important;
  overflow: hidden !important;
  min-width: 140px !important;
}

.header-background + .header-row #student-name-bar::after {
  content: '👋';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  animation: finalHeaderWave 2s ease-in-out infinite;
  z-index: 1;
}

@keyframes finalHeaderWave {
  0%, 100% { transform: translateY(-50%) rotate(0deg); }
  25% { transform: translateY(-50%) rotate(20deg); }
  75% { transform: translateY(-50%) rotate(-10deg); }
}

/* Target ONLY progress wrapper in the specific header-row after header-background */
.header-background + .header-row .general-progress-wrapper {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 12px 18px !important;
  justify-content: stretch !important;
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(15px) !important;
  padding: 18px 24px !important;
  border-radius: 16px !important;
  border: 2px solid rgba(102, 126, 234, 0.2) !important;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15) !important;
  position: relative !important;
  overflow: visible !important;
}

.header-background + .header-row .general-progress-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
  animation: finalHeaderProgressGlow 3s infinite;
}

@keyframes finalHeaderProgressGlow {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: 100%; }
}

.header-background + .header-row .general-progress-label {
  grid-column: 1 / 2 !important;
  display: block !important;
  font-weight: 800 !important;
  font-size: 12px !important;
  letter-spacing: 0.8px !important;
  color: #4c63d2 !important;
  text-transform: uppercase !important;
  white-space: normal !important;
  line-height: 1.35 !important;
  max-width: clamp(160px, 24vw, 240px) !important;
  text-align: left !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
  z-index: 1 !important;
  position: relative !important;
  align-self: start !important;
}

.header-background + .header-row .general-progress-bar {
  grid-column: 2 / 3 !important;
  width: 100% !important;
  height: 14px !important;
  background: #e2e8f0 !important;
  border-radius: 50px !important;
  position: relative !important;
  overflow: hidden !important;
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.15) !important;
  min-width: clamp(200px, 35vw, 320px) !important;
  border: 1px solid rgba(102, 126, 234, 0.2) !important;
}

.header-background + .header-row .general-progress-fill {
  height: 100% !important;
  width: 0% !important;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%) !important;
  background-size: 200% 100% !important;
  border-radius: 50px !important;
  text-align: center !important;
  color: white !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 14px !important;
  position: relative !important;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1) !important;
  animation: finalHeaderGradientFlow 4s ease infinite !important;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4) !important;
}

.header-background + .header-row .general-progress-fill.progress-low {
  background: linear-gradient(90deg, #ef4444 0%, #f97316 100%) !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.45) !important;
}

.header-background + .header-row .general-progress-fill.progress-medium {
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%) !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.45) !important;
}

.header-background + .header-row .general-progress-fill.progress-high {
  background: linear-gradient(90deg, #10b981 0%, #059669 100%) !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.45) !important;
}

@keyframes finalHeaderGradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.header-background + .header-row .general-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: finalHeaderShimmer 2.5s infinite;
}

@keyframes finalHeaderShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.header-background + .header-row .general-progress-max {
  position: absolute !important;
  right: 10px !important;
  top: 0 !important;
  font-size: 10px !important;
  color: #4c63d2 !important;
  line-height: 14px !important;
  font-weight: 600 !important;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8) !important;
}

.header-background + .header-row .term-grade-badge {
  grid-column: 3 / 4 !important;
  justify-self: end !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 14px 18px !important;
  min-width: 132px !important;
  border-radius: 18px !important;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.18) 0%, rgba(118, 75, 162, 0.22) 100%) !important;
  border: 1px solid rgba(102, 126, 234, 0.35) !important;
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.18) !important;
  position: relative !important;
  overflow: hidden !important;
  isolation: isolate !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.header-background + .header-row .term-grade-badge::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.7), transparent 60%) !important;
  opacity: 0.85;
  z-index: 0;
}

.header-background + .header-row .term-grade-tooltip {
  position: absolute !important;
  top: calc(100% + 12px) !important;
  left: 50% !important;
  transform: translate(-50%, -6px) !important;
  padding: 10px 16px !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.98) !important;
  border: 1px solid rgba(102, 126, 234, 0.35) !important;
  box-shadow: 0 12px 30px rgba(27, 37, 75, 0.18) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #1b254b !important;
  white-space: nowrap !important;
  z-index: 10 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease !important;
}

.header-background + .header-row .term-grade-tooltip::before {
  content: '' !important;
  position: absolute !important;
  bottom: 100% !important;
  left: 50% !important;
  transform: translateX(-50%) rotate(45deg) !important;
  width: 12px !important;
  height: 12px !important;
  background: inherit !important;
  border-left: 1px solid rgba(102, 126, 234, 0.35) !important;
  border-top: 1px solid rgba(102, 126, 234, 0.35) !important;
  transform-origin: center !important;
  box-shadow: inherit !important;
}

.header-background + .header-row .term-grade-badge:hover .term-grade-tooltip,
.header-background + .header-row .term-grade-badge:focus-within .term-grade-tooltip {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translate(-50%, 0) !important;
}

.dashboard .tooltip-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  outline: none;
}

.dashboard .tooltip-container:focus {
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.35);
  border-radius: 12px;
}

.dashboard .tooltip-container .image-tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translate(-50%, 8px);
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(102, 126, 234, 0.35);
  box-shadow: 0 12px 30px rgba(27, 37, 75, 0.18);
  font-size: 12px;
  font-weight: 600;
  color: #1b254b;
  text-align: center;
  white-space: nowrap;
  z-index: 5;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.dashboard .tooltip-container .image-tooltip::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: inherit;
  border-right: 1px solid rgba(102, 126, 234, 0.35);
  border-bottom: 1px solid rgba(102, 126, 234, 0.35);
}

.dashboard .tooltip-container:hover .image-tooltip,
.dashboard .tooltip-container:focus .image-tooltip,
.dashboard .tooltip-container:focus-within .image-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.header-background + .header-row .term-grade-badge:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 16px 35px rgba(102, 126, 234, 0.28) !important;
}

.header-background + .header-row .term-grade-label {
  position: relative !important;
  z-index: 1 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 1px !important;
  color: #4c63d2 !important;
  text-transform: uppercase !important;
  opacity: 0.85 !important;
}

.header-background + .header-row .term-grade-value {
  position: relative !important;
  z-index: 1 !important;
  font-size: 24px !important;
  font-weight: 800 !important;
  color: #1b254b !important;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.65) !important;
  line-height: 1.1 !important;
}

@media (max-width: 820px) {
  .header-background + .header-row .general-progress-wrapper {
    grid-template-columns: 1fr !important;
  }

  .header-background + .header-row .general-progress-label,
  .header-background + .header-row .general-progress-bar,
  .header-background + .header-row .term-grade-badge {
    grid-column: 1 / -1 !important;
  }

  .header-background + .header-row .term-grade-badge {
    justify-self: stretch !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    text-align: left !important;
    gap: 12px !important;
    padding: 16px 20px !important;
  }

  .header-background + .header-row .general-progress-label {
    white-space: normal !important;
  }

  .header-background + .header-row .term-grade-badge::before {
    background: radial-gradient(circle at 95% 10%, rgba(255, 255, 255, 0.75), transparent 65%) !important;
  }

  .header-background + .header-row .term-grade-label {
    font-size: 10px !important;
    letter-spacing: 0.8px !important;
  }

  .header-background + .header-row .term-grade-value {
    font-size: 22px !important;
  }
}

/* Target ONLY form box in the specific header-row after header-background */
.header-background + .header-row .form-box {
  background: rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: blur(15px) !important;
  padding: 20px !important;
  border-radius: 14px !important;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  min-width: 300px !important;
  max-height: 120px !important;
}

.header-background + .header-row .login-row {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
}

.header-background + .header-row .login-row input {
  flex: 1 !important;
  min-width: 140px !important;
  padding: 12px 16px !important;
  border: 2px solid #e2e8f0 !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  transition: all 0.3s ease !important;
  background: rgba(255, 255, 255, 0.9) !important;
  font-family: inherit !important;
}

.header-background + .header-row .login-row input:focus {
  outline: none !important;
  border-color: #667eea !important;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
  background: white !important;
  transform: translateY(-1px) !important;
}

.header-background + .header-row .login-row input::placeholder {
  color: #94a3b8 !important;
}

/* Target ONLY login button in the specific header-row after header-background */
.header-background + .header-row #login-btn.styled-button {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: white !important;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25) !important;
  border: none !important;
  padding: 12px 20px !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
}

.header-background + .header-row #login-btn.styled-button:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35) !important;
}

/* Target ONLY logout button in the specific header-row after header-background */
.header-background + .header-row #logout-btn.styled-button.logout {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  color: white !important;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.25) !important;
  border: none !important;
  padding: 12px 20px !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
}

.header-background + .header-row #logout-btn.styled-button.logout:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35) !important;
}

.header-background + .header-row .contact-info {
  margin-top: 12px !important;
  padding-top: 8px !important;
  border-top: 1px solid rgba(226, 232, 240, 0.5) !important;
  font-size: 13px !important;
  color: #64748b !important;
  text-align: center !important;
}

.header-background + .header-row .contact-info a {
  color: #667eea !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  transition: color 0.3s ease !important;
}

.header-background + .header-row .contact-info a:hover {
  color: #764ba2 !important;
}

/* ================================ */
/* ALL ORIGINAL STYLES PRESERVED   */
/* ================================ */

/* Status Bar - Original */
.status-bar {
  display: flex;
  justify-content: space-between;
  padding: 10px 20px;
  font-size: 1em;
  font-weight: bold;
  background-color: #ffffff;
  border-bottom: 1px solid #ccc;
}

.left-status {
  color: #2c3e50;
  font-size: 1.1em;
}

.right-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.right-status input {
  padding: 6px;
  font-size: 0.95em;
}

.right-status button {
  padding: 6px 10px;
  font-size: 0.9em;
  cursor: pointer;
}

/* Action buttons section - Original */
.actions {
  text-align: center !important;
  margin: 30px auto !important;
  padding: 20px !important;
  border: 2px solid transparent !important;
  border-radius: 12px !important;
  width: fit-content !important;
  background: linear-gradient(#ffffff, #ffffff) padding-box,
              linear-gradient(135deg, #00bfff, #003366) border-box !important;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
}

#video-section {
  padding-top: 20px;
}

.right-status div {
  margin-left: 10px;
  font-size: 0.8em;
  color: #444;
}

/* Dashboard - Original */
.dashboard {
  display: flex;
  justify-content: space-between;
  padding: 20px 40px;
  gap: 30px;
  border-top: 1px solid #ddd;
}

.theory-column, .levels-column {
  width: 48%;
}

.section-header {
  text-align: center;
  margin-bottom: 20px;
}

.section-title {
  max-width: 260px;
  height: auto;
}

/* Modern divider between question and answer columns - Original */
.qa-heading div:first-child,
.qa-question {
  position: relative;
}

.qa-heading div:first-child::after,
.qa-question::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.2), rgba(0,0,0,0));
}

.footer-image, .certificate-image {
  display: block;
  margin: 30px auto 0;
  width: 50%;
}

.centered-check {
  text-align: center;
  margin-top: 40px;
}

.centered-check img {
  width: 150px;
  height: auto;
}

.theory-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.point-box {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.08);
  padding: 15px 20px;
  transition: 0.3s ease;
  text-decoration: none;
}

.point-box:hover {
  transform: scale(1.02);
}

.point-box h4 {
  margin: 0 0 10px;
  font-size: 1.05em;
  color: #2c3e50;
}

.progress-bar {
  display: flex;
  align-items: center;
  height: 14px;
  background: #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar div {
  height: 100%;
  flex: 1;
  margin-right: 1px;
}

.progress-bar .done {
  background: #4CAF50;
}

.progress-bar .not-done {
  background: #ccc;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.6em;
  color: #666;
  margin-top: 5px;
  padding: 0 2px;
}

.progress-bar::after {
  content: "✅";
  font-size: 1.1em;
  padding-left: 8px;
  line-height: 14px;
  display: inline-block;
}

.levels-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.level-box {
  background: #e0e0e0;
  width: min(100%, 340px);
  padding: 16px 18px;
  border-radius: 12px;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.level-box .level-line {
  display: block;
  width: 100%;
}

.level-box .level-status {
  font-size: 1.8rem;
  line-height: 1;
}

.level-box .level-number {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.level-box .level-title {
  font-size: 0.9rem;
  line-height: 1.35;
}

.level-box.locked {
  background: #f2f2f2;
  color: #444;
}

.level-box.unlocked {
  background: #4CAF50;
  color: white;
  cursor: pointer;
}

.level-box[data-status]::before {
  content: attr(data-status);
  position: absolute;
  left: -30px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2em;
}

.arrow-down svg {
  width: 30px;
  height: 30px;
  transform: rotate(90deg);
}

/* Better student name display - Original (for other parts) */
#student-name-bar:not(.header-background + .header-row #student-name-bar) {
  font-size: 1.3em;
  font-weight: bold;
  color: #2c3e50;
}

/* Contact info and mail link - Original (for other parts) */
.contact-info:not(.header-background + .header-row .contact-info) {
  font-size: 0.9em;
  color: #444;
  margin-top: 5px;
}

.contact-info:not(.header-background + .header-row .contact-info) a {
  color: #0077cc;
  text-decoration: none;
}

.contact-info:not(.header-background + .header-row .contact-info) a:hover {
  text-decoration: underline;
}

/* Stylish login/logout buttons - Original (for other parts) */
.styled-button:not(.header-background + .header-row .styled-button) {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 5px;
  font-size: 0.9em;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.styled-button:not(.header-background + .header-row .styled-button):hover {
  background-color: #388E3C;
}

.styled-button.logout:not(.header-background + .header-row .styled-button.logout) {
  background-color: #e53935;
}

.styled-button.logout:not(.header-background + .header-row .styled-button.logout):hover {
  background-color: #c62828;
}

.styled-button.home:not(.header-background + .header-row .styled-button.home) {
  background-color: #2196F3;
}

.styled-button.home:not(.header-background + .header-row .styled-button.home):hover {
  background-color: #1976D2;
}

/* Left Cluster Styling - Original */
.left-cluster {
  display: flex;
  align-items: center;
  gap: 15px;
}

.student-label {
  font-size: 1.3em;
  font-weight: bold;
  color: #2c3e50;
  background: #e3f2fd;
  padding: 6px 12px;
  border-radius: 8px;
  box-shadow: 0 0 5px rgba(0,0,0,0.08);
}

.form-box:not(.header-background + .header-row .form-box) {
  background: #f8f9fa;
  padding: 10px 15px;
  border-radius: 8px;
  box-shadow: 0 0 6px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.login-row:not(.header-background + .header-row .login-row) {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.theory-clickable {
  cursor: pointer;
  border: 2px solid #ddd;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 20px;
  transition: transform 0.2s;
}

.theory-clickable:hover {
  transform: scale(1.02);
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-top: 5px;
  color: #666;
}

.segment {
  height: 10px;
  flex: 1;
  margin: 2px;
  background-color: grey;
  border-radius: 3px;
}

/* LEFT SIDE THEORY POINTS - Original */
.theory-clickable {
  cursor: pointer;
  border: 2px solid #ccc;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 20px;
  background-color: #f5f5f5;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.theory-clickable:hover {
  transform: scale(1.02);
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.progress-bar {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.segment {
  height: 12px;
  flex: 1;
  margin: 2px;
  background-color: grey;
  border-radius: 4px;
}

.segment.green {
  background-color: #4CAF50;
}

.segment.light-green {
  background-color: #b2fab4;
}

.labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-top: 6px;
  color: #444;
}

.labels span {
  flex: 1;
  text-align: center;
}

/* RIGHT SIDE LEVELS - Original */
.level-box {
  background-color: #e0e0e0;
  border-radius: 10px;
  padding: 12px;
  margin: 10px auto;
  width: 64%;
  transition: transform 0.2s ease;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.level-box:hover {
  transform: scale(1.02);
}

.level-box.locked {
  background-color: #d3d3d3;
}

.level-box.unlocked {
  background-color: #c8e6c9;
}

.level-box.passed {
  background-color: #4CAF50;
  color: white;
}

.level-icon {
  font-size: 1.2em;
}

.level-text {
  line-height: 1.2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.arrow-img {
  width: 20px;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Divider between left and right */
.dashboard {
  display: flex;
  gap: 10px;
  position: relative;
}

.dashboard::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background-color: #ccc;
}

/* General Progress Bar - Original (for other parts) */
.general-progress-container {
  width: 100%;
  padding: 10px 30px;
  box-sizing: border-box;
  margin-bottom: 20px;
}

.general-progress-label:not(.header-background + .header-row .general-progress-label) {
  font-weight: bold;
  margin-bottom: 5px;
  font-size: 14px;
}

.general-progress-bar:not(.header-background + .header-row .general-progress-bar) {
  background-color: #e0e0e0;
  height: 18px;
  border-radius: 10px;
  overflow: hidden;
}

.general-progress-fill:not(.header-background + .header-row .general-progress-fill) {
  height: 100%;
  background-color: #4CAF50;
  width: 0%;
  border-radius: 10px 0 0 10px;
}

/* Clean and Correct General Progress Wrapper - Original (for other parts) */
.general-progress-wrapper:not(.header-background + .header-row .general-progress-wrapper) {
  width: 50%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 15px;
  justify-content: center;
}

.general-progress-max:not(.header-background + .header-row .general-progress-max) {
  position: absolute;
  right: 8px;
  top: 0;
  font-size: 11px;
  color: #333;
  line-height: 18px;
}

/* Navigation buttons shared across layers */
.nav-btn {
  padding: 10px 20px;
  background: #007bff;
  color: #ffffff;
  text-decoration: none;
  border-radius: 6px;
  margin-right: 10px;
  transition: background 0.3s ease;
}

.nav-btn:hover {
  background: #0056b3;
}

/* Footer */
footer {
  width: 100%;
  text-align: center;
  font-size: 12px;
  padding: 12px 0;
  background-color: #f1f1f1;
  color: #333;
  margin-top: 40px;
  border-top: 1px solid #ccc;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-background + .header-row {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 20px !important;
    margin: 10px !important;
  }

  .header-background + .header-row .general-progress-wrapper {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .header-background + .header-row .general-progress-bar {
    min-width: auto !important;
  }

  .header-background + .header-row .login-row {
    flex-direction: column !important;
    gap: 10px !important;
  }

  .header-background + .header-row .login-row input {
    min-width: auto !important;
    width: 100% !important;
  }

  .dashboard {
    flex-direction: column;
    padding: 20px;
  }

  .dashboard::before {
    display: none;
  }

  .theory-column, .levels-column {
    width: 100%;
  }

  .level-box {
    width: 90%;
  }
}

@media (max-width: 480px) {
  .header-background + .header-row {
    padding: 15px !important;
  }

  .header-background + .header-row .styled-button {
    padding: 10px 16px !important;
    font-size: 13px !important;
  }

  .header-background + .header-row .form-box {
    padding: 20px !important;
    min-width: auto !important;
  }

  .header-background + .header-row #student-name-bar {
    font-size: 14px !important;
    padding: 10px 20px !important;
  }
}
/* === Progress bar: filled portion is green; width driven by JS === */
.general-progress-bar {
  position: relative;              /* ensures inner fill lays out correctly */
  overflow: hidden;                /* clip rounded corners if any */
}

.general-progress-fill {
  background: #10b981 !important;  /* solid green */
  background-image: none !important;
  transition: width 300ms ease;    /* smooth change when updated */
  height: 100%;
  border-radius: inherit;          /* keep rounded corners if parent has them */
}



/* === FINAL OVERRIDES (progress cluster, badge, divider, images, tooltip) === */

/* Grid layout: label on one line above the bar; badge on the right */
.header-background + .header-row .general-progress-wrapper{
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important; /* bar | badge */
  grid-template-rows: auto auto !important;               /* label row, bar row */
  gap: 10px 18px !important;
  align-items: center !important;
}

/* Label spans the first row and stays on a single line */
.header-background + .header-row .general-progress-label{
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;
  white-space: nowrap !important;
  align-self: end !important;
}

/* Progress bar on row 2, left column */
.header-background + .header-row .general-progress-bar{
  grid-column: 1 / 2 !important;
  grid-row: 2 !important;
  position: relative !important; /* for the vertical divider */
}

/* Vertical divider between bar and badge (hidden on mobile) */
.header-background + .header-row .general-progress-bar::after{
  content: "" !important;
  position: absolute !important;
  right: -9px !important;          /* half of 18px column gap */
  top: -6px !important;
  bottom: -6px !important;
  width: 2px !important;
  background: linear-gradient(180deg, rgba(27,37,75,0), rgba(27,37,75,0.25), rgba(27,37,75,0)) !important;
  border-radius: 2px !important;
}

/* Compact TERM 1 GRADE badge; sits higher */
.header-background + .header-row .term-grade-badge{
  grid-column: 2 / 3 !important;
  grid-row: 1 / 3 !important;      /* span both rows */
  align-self: start !important;
  padding: 10px 12px !important;   /* smaller */
  min-width: 110px !important;
  border-radius: 14px !important;
  overflow: visible !important;    /* allow tooltip to escape */
}

/* Smaller texts inside the badge */
.header-background + .header-row .term-grade-label{
  font-size: 10px !important;
  letter-spacing: 0.8px !important;
}
.header-background + .header-row .term-grade-value{
  font-size: 20px !important;
  line-height: 1.05 !important;
}

/* Tooltip stacking */
.header-background + .header-row .term-grade-tooltip{
  z-index: 100 !important;   /* ensure above neighbors */
}

/* Mobile: stacked layout; remove divider and avoid crowding */
@media (max-width: 820px){
  .header-background + .header-row .general-progress-wrapper{
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto !important;
    gap: 8px 0 !important;
  }
  .header-background + .header-row .general-progress-bar::after{
    display: none !important;
  }
  .header-background + .header-row .term-grade-badge{
    grid-row: auto !important;
    grid-column: 1 / -1 !important;
    align-self: stretch !important;
  }
}

/* Center the two section header images reliably */
.dashboard .section-header.tooltip-container{
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}
.dashboard .section-header img{
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* === END FINAL OVERRIDES === */
