/* ============================================================
   test-your-skills.css
   Page: test-your-skills.php
   Prefix: tys-  (Test Your Skills)
   ============================================================ */

/* ---------- Top intro / tagline ---------- */
.tys-hero {
  padding: 70px 20px 40px;
}

.tys-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--primary);
  background: rgba(108, 99, 255, 0.1);
  border: 1px solid rgba(108, 99, 255, 0.25);
  margin-bottom: 18px;
}

.tys-title {
  font-size: clamp(1.9rem, 5vw, 2.7rem);
  font-weight: 800;
  color: var(--text-primary);
  max-width: 760px;
  margin: 0 auto 16px;
  line-height: 1.25;
}

.tys-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 24px;
  line-height: 1.7;
}

.tys-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.tys-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

.tys-chip i {
  color: var(--primary);
}

/* ---------- Cards grid ---------- */
.tys-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 576px) {
  .tys-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .tys-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Card (small, simple) ---------- */
.tys-card {
  position: relative;
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  text-decoration: none;
  transition: var(--transition);
}

.tys-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.tys-card-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
  border-radius: 12px;
  background: var(--gradient-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.tys-card-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.tys-card-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* ---------- Locked state ---------- */
.tys-card--locked {
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.65;
}

.tys-card--locked .tys-card-icon {
  background: var(--text-muted);
}

.tys-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #fff;
  background: var(--secondary);
  padding: 3px 9px;
  border-radius: 999px;
}

/* ============================================================
   RULES MODAL — before starting a test (Core Java card etc.)
   Themed with the same global tokens so it matches light/dark.
============================================================ */
#tysRulesModal .modal-content {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

#tysRulesModal .modal-header,
#tysRulesModal .modal-footer {
  border-color: var(--border-color);
}

#tysRulesModal .modal-title {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

#tysRulesModal .modal-title i {
  color: var(--primary);
  margin-right: 6px;
}

#tysRulesModal .btn-close {
  filter: var(--tys-btn-close-filter, none);
}

[data-theme="dark"] #tysRulesModal .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

.tys-rules-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.9;
}

.tys-rules-list li::marker {
  color: var(--primary);
}

#tysRulesModal .btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}

#tysRulesModal .btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

#tysRulesModal .btn-outline-secondary {
  color: var(--text-secondary);
  border-color: var(--border-color);
}

#tysRulesModal .btn-outline-secondary:hover {
  background: var(--bg-section);
  color: var(--text-primary);
}

/* ============================================================
   FULL SCREEN TEST OVERLAY — holds the start-test.php iframe.
   Kept as a fixed, full-viewport layer so it visually covers the
   entire screen even in the rare case the browser blocks the
   real Fullscreen API call.
============================================================ */
.tys-test-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  background: #000;
}

.tys-test-overlay.active {
  display: block;
}

.tys-test-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Lock background scroll while the test overlay is open */
body.tys-locked {
  overflow: hidden;
  height: 100vh;
}

/* ============================================================
   CARD WRAPPER + PROGRESS BAR (below each topic card)
============================================================ */
.tys-card-wrap {
  display: flex;
  flex-direction: column;
}

.tys-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 0 2px;
}

.tys-progress-info {
  flex: 1;
  min-width: 0;
}

.tys-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-section);
  overflow: hidden;
  transition: background 0.3s ease;
}

.tys-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--text-muted);
  transition: width 0.3s ease, background 0.3s ease;
}

/* Once a test has been started: completed portion (the fill) is
   green, and the rest of the track (pending / not yet solved) is red. */
.tys-progress-started .tys-progress-track {
  background: var(--secondary);
}

.tys-progress-started .tys-progress-fill {
  background: var(--success);
}

.tys-progress-text {
  display: block;
  margin-top: 5px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.tys-progress-started .tys-progress-text {
  color: var(--success);
  font-weight: 600;
}

/* Reset button — only shown once there's something to reset */
.tys-reset-btn {
  flex-shrink: 0;
  display: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tys-reset-btn:hover {
  border-color: var(--secondary);
  color: var(--secondary);
  background: rgba(255, 107, 107, 0.08);
}

.tys-progress-started .tys-reset-btn {
  display: inline-flex;
}

/* Decorative-only progress bar shown under locked / "Coming Soon"
   cards — always flat and light, never wired to any JS logic. */
.tys-progress--disabled {
  opacity: 0.45;
}

.tys-progress--disabled .tys-progress-fill {
  width: 0%;
  background: var(--text-muted);
}

.tys-progress--disabled .tys-progress-text {
  color: var(--text-muted);
}
