/* PYQs specific minimal styling; reuses index.css grid/card look */

.pyqs-container {
  padding-top: 4rem;
  /* Smooth in-page scrolling for anchor/jumps inside PYQs */
  scroll-behavior: smooth;
}

/* Page transition similar to index */
body .pyqs-container { transition: opacity 120ms ease; }
body.page-leave .pyqs-container { opacity: 0.0; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  body .pyqs-container { transition: none !important; }
}

/* Chapters layout (sidebar + main) */
.pyqs-layout {
  display: flex;
  gap: 1rem;
}
.pyqs-sidenav {
  width: 260px;
  flex: 0 0 260px;
}

/* Horizontal subject tabs */
.pyqs-tabs-wrap { margin-top: .25rem; }
#pyqs-subject-tabs { border-bottom: 1px solid rgba(255,255,255,0.12); }
#pyqs-subject-tabs .nav-link {
  color: #cbd3dc;
  background: transparent;
  border: 0 !important;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: .5rem .75rem;
  transition: color 140ms ease, border-bottom-color 140ms ease, background-color 140ms ease;
}
#pyqs-subject-tabs .nav-link:hover { color: #ffffff; border-bottom-color: rgba(255,255,255,0.12); }
#pyqs-subject-tabs .nav-link.active {
  color: #ffffff;
  font-weight: 600;
  background: rgba(255,255,255,0.12);
  border-bottom-color: var(--bs-primary);
}
#pyqs-subject-tabs .ico {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(255,255,255,.04);
  display:flex;
  align-items:center;
  justify-content:center;
}

.topbar-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: #fff;
  text-decoration: none !important;
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
  border-radius: 999px;
  transition: background-color 140ms ease, transform 100ms ease;
}

.questions-list {
  background-color: #41454913;
}

.dropdown-item .active{
  background-color: white !important;
}

/* Year headers within the question list */
.q-year-header {
  font-weight: 600;
  color: #dfe6ee;
  position: sticky;
  top: 0; /* stick to viewport top */
  z-index: 3;
  background-color: rgba(20, 22, 26, 0.92); /* reduce transparency for readability */
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar-back i { font-size: 1.1rem; }
.topbar-back:hover { background: rgba(255, 255, 255, 0.08); }
.topbar-back:active { transform: scale(0.94); }


.diff-bg-success{
  background-color: rgba(0, 128, 0, 0.432);
}

.diff-bg-warning{
  background-color: rgba(218, 165, 32, 0.459);
}

.diff-bg-danger{
  background-color: rgba(165, 42, 42, 0.459);
}

.diff-bg-info{
  display: none;
}

.pyqs-exam-icon { width: 24px; height: 24px; object-fit: contain; }
.pyqs-side-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem .75rem;
  border-radius: 10px;
  color: #dfe6ee;
  cursor: pointer;
  margin-bottom: .4rem;
  transition: background-color 140ms ease, color 140ms ease;
}
.pyqs-side-item.active, .pyqs-side-item:hover {
  background: rgba(255,255,255,.06);
}
.pyqs-side-item .ico { width: 22px; height: 22px; object-fit: contain; border-radius: 6px; background: rgba(255,255,255,.04); display:flex; align-items:center; justify-content:center; }
.pyqs-side-item .name { flex: 1 1 auto; }
.pyqs-side-item .chev { opacity: .7; }

.pyqs-toolbar {
  margin-bottom: 1rem;
}

#pyqs-content {
  margin-top: 0.25rem;
}

#pyqs-count-line { margin: .25rem 0 .5rem; }

#questionText{
  background-color: #15171B;
}

.pyqs-card .card-body {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.pyqs-icon-wrap {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.pyqs-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.pyqs-title {
  font-size: 1.05rem;
  margin: 0;
}
.pyqs-sub {
  color: #9aa3ac;
  font-size: 0.9rem;
}

.pyqs-toolbar .input-group-text,
.pyqs-toolbar .form-control,
.pyqs-toolbar .form-select {
  background-color: rgba(20, 22, 26, 0.65);
  color: #dfe6ee;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pyq-viewer-body {
  overflow: auto;
}

.pyq-qtext {
  font-size: 1.05rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap; /* preserve newlines without injecting <br> */
}
.pyq-options .pyq-option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}
.pyq-options .pyq-option:last-child {
  border-bottom: 0;
}
.pyq-badge {
  gap: 0.5rem;
}

.clickable {
  cursor: pointer;
}

/* Subtle fade-in for content swaps */
.fade-in { animation: fadeIn 160ms ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }

/* Generic enter animations for items/cards */
.anim-enter { animation: fadeInUp 220ms ease-out both; }
.anim-enter-fast { animation: fadeInUp 140ms ease-out both; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Exit animation for moving items */
.anim-out { animation: fadeOutDown 160ms ease-in forwards; }
@keyframes fadeOutDown { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(6px); } }

/* List items hover/active feedback */
.pyqs-list .list-group-item { transition: background-color 140ms ease, border-color 140ms ease; }
.pyqs-list .list-group-item:hover { background-color: rgba(255,255,255,0.04); }
.pyqs-list .list-group-item:active { background-color: rgba(255,255,255,0.08); }

/* Star button micro-interactions */
.as-star-btn .bi { transition: transform 140ms ease, color 160ms ease; transform-origin: center; }
.as-star-btn:active .bi { transform: scale(0.85); }
.as-star-btn.star-animate .bi { animation: starPop 320ms cubic-bezier(.2,.8,.2,1) both; }
@keyframes starPop {
  0% { transform: scale(0.6) rotate(-15deg); }
  60% { transform: scale(1.15) rotate(10deg); }
  100% { transform: scale(1) rotate(0); }
}

/* Slight lift for PYQs cards (piggybacks on .as-card transitions) */
.pyqs-card { will-change: transform, box-shadow; }
.pyqs-card:hover { transform: translateY(-3px); }

/* Skeleton shimmer primitives */
.sk-skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
}
.sk-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.18) 50%, rgba(255,255,255,0) 100%);
  animation: sk-shimmer 1.15s infinite;
}
@keyframes sk-shimmer { 100% { transform: translateX(100%); } }

.sk-line { height: 14px; border-radius: 6px; }
.sk-w-60 { width: 60%; }
.sk-w-30 { width: 30%; }
.pyqs-icon-wrap .sk-ico { width: 44px; height: 44px; border-radius: 8px; }

/* Space between Starred header and grid */
#pyqs-starred-chapters-wrap .as-header { margin-bottom: 0.75rem; }

.pyqs-year-range {
  min-width: 260px;
}

.pyqs-year-range-values {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
  font-weight: 600;
  color: #dfe6ee;
}

.pyqs-year-value-input {
  width: 5.5rem;
  text-align: center;
  font-weight: 600;
}

.pyqs-year-slider-wrap {
  position: relative;
  height: 28px;
}

.pyqs-year-slider-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  z-index: 1;
}

.pyqs-year-slider-fill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--bs-primary);
  z-index: 2;
}

.pyqs-year-range-input {
  position: absolute;
  inset: 0;
  width: 100%;
  background: transparent;
  pointer-events: none;
  z-index: 3;
  margin: 0;
  --bs-form-range-track-bg: transparent;
  --bs-form-range-track-height: 4px;
}

.pyqs-year-range-input::-webkit-slider-thumb {
  pointer-events: auto;
}

.pyqs-year-range-input::-moz-range-thumb {
  pointer-events: auto;
}

.pyqs-year-range-input::-webkit-slider-runnable-track {
  background: transparent;
}

.pyqs-year-range-input::-moz-range-track {
  background: transparent;
}

/* Chapter progress bar (bottom of cards) */
.pyqs-chapbar {
  height: 6px;
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}
.pyqs-chapbar .seg { height: 100%; transition: width 200ms ease; }
.pyqs-chapbar .seg-green { background-color: #198754; }
.pyqs-chapbar .seg-red { background-color: #dc3545; }
.pyqs-chapbar .seg-grey { background-color: rgba(255, 255, 255, 0.2); }

/* Reduce motion when requested */
@media (prefers-reduced-motion: reduce) {
  .fade-in, .anim-enter, .anim-enter-fast { animation: none !important; }
  .pyqs-card, .as-card.card { transition: none !important; }
  .as-star-btn .bi { transition: none !important; }
}

.qbookmark-dialog {
  display: grid;
  gap: 1rem;
}

.qbookmark-tag-field {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-height: 46px;
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.5rem;
  background-color: rgba(20, 22, 26, 0.65);
  color: #dfe6ee;
}

.qbookmark-tag-field:focus-within {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.qbookmark-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.qbookmark-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: rgba(13, 110, 253, 0.18);
  border: 1px solid rgba(13, 110, 253, 0.28);
  color: #dfe6ee;
  font-size: 0.9rem;
}

.qbookmark-tag-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
}

.qbookmark-tag-chip-remove:hover {
  background: rgba(255, 255, 255, 0.1);
}

.qbookmark-tag-chip-remove .bi {
  font-size: 0.72rem;
}

.qbookmark-tag-input {
  flex: 1 1 160px;
  min-width: 140px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
}

.qbookmark-tag-input::placeholder {
  color: #9aa3ac;
}

.qbookmark-tag-suggestions {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.5rem;
  padding: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(20, 22, 26, 0.95);
}

.qbookmark-tag-suggestion {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #dfe6ee;
  text-align: left;
}

.qbookmark-tag-suggestion:hover,
.qbookmark-tag-suggestion.active {
  background: rgba(255, 255, 255, 0.08);
}
