/* ============================================================
   SIDEBAR — Exam Selector
   ============================================================ */

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  background: var(--grad-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding-bottom: 24px;
}

/* Sidebar Header */
.sidebar-header {
  padding: 20px 16px 12px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

/* Search Input */
.sidebar-search {
  position: relative;
}

.sidebar-search input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  outline: none;
}

.sidebar-search input:focus {
  border-color: var(--primary);
  background: rgba(14, 165, 233, 0.06);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.sidebar-search input::placeholder { color: var(--text-muted); }

.sidebar-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

/* Category List */
.category-list {
  padding: 8px 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Category Item (accordion) */
.category-item {
  border-radius: 10px;
  overflow: hidden;
}

.category-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.category-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border);
}

.category-btn.open {
  background: rgba(14, 165, 233, 0.1);
  color: var(--primary-dark);
  border-color: rgba(14, 165, 233, 0.25);
}

.category-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.category-name { flex: 1; }

.category-count {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  background: rgba(0,0,0,0.05);
  border-radius: 100px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.category-btn.open .category-count {
  background: rgba(14, 165, 233, 0.15);
  color: var(--primary-dark);
}

.category-arrow {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.category-btn.open .category-arrow {
  transform: rotate(90deg);
  color: var(--primary);
}

/* Exam Dropdown */
.exam-dropdown {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  padding-left: 12px;
}

.exam-dropdown.open {
  max-height: 600px;
}

.exam-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0 8px;
}

.exam-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.83rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.exam-btn::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  transition: var(--transition);
}

.exam-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border);
}

.exam-btn:hover::before { background: var(--primary); }

.exam-btn.active {
  background: rgba(14, 165, 233, 0.12);
  color: var(--primary-dark);
  border-color: rgba(14, 165, 233, 0.3);
  font-weight: 600;
}

.exam-btn.active::before {
  background: var(--primary);
  box-shadow: 0 0 8px rgba(14, 165, 233, 0.6);
}

.exam-btn-name { flex: 1; line-height: 1.3; }

.exam-btn-cycle {
  font-size: 0.68rem;
  color: var(--text-muted);
  flex-shrink: 0;
  background: rgba(0,0,0,0.04);
  padding: 1px 6px;
  border-radius: 4px;
}

.exam-btn.active .exam-btn-cycle {
  color: var(--primary-dark);
  background: rgba(14, 165, 233, 0.12);
}

/* No-results message */
.sidebar-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.sidebar-empty .empty-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  display: block;
}

/* Sidebar Footer (stats) */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.sidebar-stats {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.sidebar-stat {
  text-align: center;
  flex: 1;
}

.sidebar-stat-val {
  font-size: 1.1rem;
  font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}
