/* ================== Base exam cards ================== */
#exams-list {
  position: relative;
}

/* Card base: softer + more depth */
#exams-list .card {
  position: relative;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
  padding: 16px 18px 18px;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    opacity 0.25s ease,
    filter 0.25s ease;
}

/* Hover feel for all cards */
#exams-list .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

/* When focused, dim and slightly blur others */
#exams-list.exam-focused .card.exam-dimmed {
  opacity: 0.3;
  filter: blur(1px);
  pointer-events: none;
}

/* Focused card: lift + slight scale */
#exams-list.exam-focused .card.exam-focused-card {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.22);
  z-index: 2;
}

/* ================== Light modal + overlay ================== */

/* Light overlay behind modal (tap/click to close) */
.exam-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.25);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
  z-index: 9998;
}

.exam-overlay.visible {
  opacity: 1;
  visibility: visible;
}

/* Centered modal panel (light theme) */
.exam-topics-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(1100px, 94vw);
  height: min(80vh, 780px);
  transform: translate(-50%, -50%) scale(0.98);
  opacity: 0;
  visibility: hidden;

  z-index: 9999;
  display: flex;
  flex-direction: column;

  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.22);

  transition:
    opacity 0.22s ease,
    visibility 0.22s ease,
    transform 0.22s ease;
}

/* Visible state */
.exam-topics-panel.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* ================== Modal header ================== */

.exam-topics-panel .panel-header {
  padding: 14px 16px;
  background: rgba(248, 250, 252, 0.96);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px 16px 0 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.exam-topics-panel .panel-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  flex: 1;
}

.exam-topics-panel .close-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  color: #0f172a;
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.exam-topics-panel .close-btn:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
}

/* ================== Modal content ================== */

.exam-topics-panel .panel-content {
  padding: 36px;
  overflow: auto;
}

.exam-topics-panel .panel-content > p {
  margin: 0 0 14px 0;
  color: rgba(15, 23, 42, 0.7);
  font-size: 0.94rem;
}

/* Responsive grid for topics (works well up to 20+) */
.exam-topics-panel .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

/* ================== Topic cards inside modal ================== */

.exam-topics-panel .quick-card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.exam-topics-panel .quick-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
  border-color: rgba(37, 99, 235, 0.45);
}

.exam-topics-panel .quick-card strong {
  display: block;
  margin-bottom: 8px;
  color: #0f172a;
  font-size: 1.02rem;
  font-weight: 600;
}

.exam-topics-panel .quick-card p {
  margin: 0 0 12px 0;
  color: rgba(15, 23, 42, 0.65);
  font-size: 0.9rem;
}

.exam-topics-panel .quick-card .btn-row {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

/* You can adapt these if you already have .btn, .btn.primary, .btn.light */
.exam-topics-panel .quick-card .btn {
  flex: 1;
  font-size: 0.9rem;
  border-radius: 8px;
}

/* ================== Responsive tweaks ================== */

@media (max-width: 768px) {
  .exam-topics-panel {
    width: 96vw;
    height: min(86vh, 760px);
    border-radius: 14px;
  }

  .exam-topics-panel .panel-header {
    padding: 12px 14px;
  }

  .exam-topics-panel .panel-content {
    padding: 12px;
  }

  .exam-topics-panel .grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
  }
}
