/* css/components/tests.css */
/* Tests section: exam/practice mode cards and grade evolution chart */

/* ── Row 1: Top row (Summit · Ascent) ── */
.bento-top-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  grid-template-rows: auto;
  gap: 14px;
}

/* ── SUMMIT card (exam mode) ── */
.bento-card-summit {
  background: var(--card-summit);
  color: #5c3a1e;
  cursor: pointer;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.bento-card-summit .bento-card-title {
  color: #80350E;
}

/* Summit PNG illustration */
.bento-card-summit::after {
content: '';
    position: absolute;
    bottom: -30px;
    right: -10px;
    width: 240px;
    height: 300px;
    opacity: 1;
    background-image: url(../../Assets/images/Summit.png);
    background-repeat: no-repeat;
    background-size: contain;
    background-position: bottom right;
    pointer-events: none;
}

/* Ground effect for illustration cards */
.bento-card-summit::before,
.bento-card-ascent::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20%;
    opacity: 0.1;
    background: black;
    border-radius: 0 0 var(--bento-radius) var(--bento-radius);
    pointer-events: none;
    z-index: 0;
}
/* ── ASCENT card (practice mode) ── */
.bento-card-ascent {
  background: var(--card-ascent);
  color: #6b5a10;
  cursor: pointer;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.bento-card-ascent .bento-card-title {
  color: #826900;
}

/* Ascent PNG illustration */
.bento-card-ascent::after {
content: '';
    position: absolute;
    bottom: -80px;
    right: -20px;
    width: 300px;
    height: 300px;
    opacity: 1;
    background-image: url(../../Assets/images/Ascent.png);
    background-repeat: no-repeat;
    background-size: contain;
    background-position: bottom right;
    pointer-events: none;
}


/* ── MIXED (Random Mix) row ── */
.bento-mixed-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.bento-card-mixed {
  background: linear-gradient(135deg, #e0f0ff 0%, #d8e8ff 60%, #ddd8ff 100%);
  color: #2a3a6a;
  cursor: pointer;
  min-height: 80px;
  display: flex;
  align-items: center;
}

.bento-card-mixed .bento-card-title {
  color: #2a3a9a;
  display: flex;
  align-items: center;
}

/* ── Per-card hover: darker text tones ── */
.bento-card-summit:hover .bento-card-title   { color: #6a2508; }
.bento-card-summit:hover                     { color: #4a1a08; }
.bento-card-summit:hover .bento-card-hover-info { color: #7a2a10; }

.bento-card-ascent:hover .bento-card-title   { color: #6a5500; }
.bento-card-ascent:hover                     { color: #4a3a08; }
.bento-card-ascent:hover .bento-card-hover-info { color: #7a6000; }

.bento-card-mixed:hover .bento-card-title    { color: #6878c8; }
.bento-card-mixed:hover                      { color: #6878a0; }
.bento-card-mixed:hover .bento-card-hover-info { color: #7080b8; }

.bento-card-mixed.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 768px), (max-height: 520px) and (orientation: landscape) and (max-width: 1024px) {
  .bento-top-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .bento-card-summit,
  .bento-card-ascent {
    min-height: 70px !important;
  }

  .bento-card-summit::before,
  .bento-card-ascent::before,
  .bento-card-summit::after,
  .bento-card-ascent::after {
    display: none !important;
  }
}

/* ── Grade Evolution Section (rendered in main-content) ──────────────── */
.grade-evolution-section {
  width: 100%;
}
.grade-evolution-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.grade-evolution-expand-btn {
  order: -1;
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid rgba(45, 46, 95, 0.12);
  background: rgba(255, 255, 255, 0.95);
  color: #334155;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  margin: 0 0 -8px 0;
}
.grade-evolution-expand-btn .material-symbols-outlined {
  font-size: 1.1rem;
}
@media (hover: hover) and (pointer: fine) {
  .grade-evolution-expand-btn:hover {
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(239, 246, 255, 0.95);
    color: #1e3a8a;
  }
}
.grade-evolution-body-inner {
  width: 100%;
}
.grade-evolution-section.grade-evolution-expanded .grade-evolution-body-inner {
  position: fixed;
  z-index: 2200;
  inset: max(10px, env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
  background: rgba(255, 255, 255, 0.98);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.28);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 14px 18px;
  box-sizing: border-box;
}
.grade-evolution-section.grade-evolution-expanded .grade-evolution-expand-btn {
  position: fixed;
  z-index: 2201;
  top: max(14px, calc(env(safe-area-inset-top, 0px) + 8px));
  right: max(14px, calc(env(safe-area-inset-right, 0px) + 8px));
  margin: 0;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}
.grade-evolution-section.grade-evolution-expanded .ge-chart-svg {
  width: 100%;
  height: auto;
  max-height: min(88vh, 88vw);
}
@media (orientation: landscape) and (max-height: 520px) {
  .grade-evolution-section.grade-evolution-expanded .ge-chart-svg {
    max-height: min(92vh, 96vw);
  }
}
.grade-evo-no-data {
  font-size: 0.85rem;
  color: var(--text-light);
  padding: 32px 0;
  text-align: center;
}
.grade-evo-no-data i {
  margin-right: 6px;
  opacity: 0.5;
}
/* ── Grade Evolution dot chart ───────────────────────────────────────── */
.ge-chart-card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 20px;
  padding: 20px 24px;
  box-shadow: 0 4px 20px rgba(45, 46, 95, 0.08);
  border: 1px solid rgba(45, 46, 95, 0.08);
}
.ge-chart-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.ge-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}
.ge-legend-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border: 1.5px solid var(--ge-color, #6366f1);
  border-radius: 100px;
  background: transparent;
  color: var(--text-dark);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  opacity: 0.45;
}
.ge-legend-btn.active {
  background: rgba(99, 102, 241, 0.12);
  background: color-mix(in srgb, var(--ge-color, #6366f1) 14%, transparent);
  opacity: 1;
}
.ge-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.ge-legend-dash {
  width: 16px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
}
/* ── Grade Evolution floating tooltip ───────────────────────────────── */
.ge-tip {
  position: fixed;
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  pointer-events: none;
  z-index: 9999;
  display: none;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border-left: 3px solid var(--ge-tip-color, #6366f1);
}

@media (max-width: 480px) {
  .ge-tip {
    max-width: calc(100vw - 24px);
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

