/* ==========================================================================
   🌐 Explore Page — Lateral Menu Layout + Unified Card/Table Styles
   ========================================================================== */

/* ============================================
   📐 Main Layout
   ============================================ */
.explore-wrapper {
  display: flex;
  gap: var(--space-lg);
  align-items: flex-start;
}

/* ── Left sidebar ── */
.explore-sidebar {
  flex-shrink: 0;
  width: 240px;
  position: sticky;
  top: 86px;
  z-index: 10;
}

/* ── Right content area ── */
.explore-content {
  flex: 1;
  min-width: 0;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  /* Note: animation and backdrop-filter are avoided here because they create
     containing blocks for position:fixed (modals), breaking Bootstrap modals. */
}

/* ============================================
   🗂️ Sidebar Navigation
   ============================================ */
.explore-nav {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-sm);
  box-shadow: var(--shadow-md);
}

.explore-nav-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.6rem 1rem 0.8rem;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 4px;
}

/* ── Toggle button for collapsing sidebar ── */
.explore-sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  padding: 0.25rem 0.4rem;
  margin: 0 auto 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  opacity: 0.5;
}
.explore-sidebar-toggle:hover {
  background: var(--primary-light);
  color: var(--primary);
  opacity: 1;
}
.explore-sidebar-toggle .collapse-icon {
  transition: transform var(--transition-base);
}

/* ── Collapsed sidebar state ── */
.explore-sidebar.explore-sidebar-collapsed {
  width: 62px;
}
.explore-sidebar.explore-sidebar-collapsed .explore-nav-header {
  display: none;
}
.explore-sidebar.explore-sidebar-collapsed .explore-nav-item {
  justify-content: center;
  padding: 0.65rem 0;
  gap: 0;
}
.explore-sidebar.explore-sidebar-collapsed .explore-nav-item .explore-nav-label {
  display: none;
}
.explore-sidebar.explore-sidebar-collapsed .explore-nav-item .explore-nav-count {
  display: none;
}
.explore-sidebar.explore-sidebar-collapsed .explore-nav-item .explore-nav-icon {
  width: auto;
  font-size: 1.25rem;
}
.explore-sidebar.explore-sidebar-collapsed .explore-sidebar-toggle .collapse-icon {
  transform: rotate(180deg);
}

.explore-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  border: none;
  background: transparent;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.explore-nav-item:hover {
  background: var(--primary-light);
  transform: translateX(4px);
}

.explore-nav-item.active {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 2px 12px rgba(0, 123, 255, 0.3);
  transform: translateX(4px);
}

.explore-nav-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.explore-nav-icon {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.explore-nav-label {
  flex: 1;
}

.explore-nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.explore-nav-item.active .explore-nav-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.explore-nav-item:hover .explore-nav-count {
  background: rgba(0, 0, 0, 0.12);
}

/* ============================================
   🃏 Unified Card & Table Design (Explore)
   All resource types share the same look:
   same hover border, shadow, translateY effect
   ============================================ */

/* ── Card-list inside explore content ── */
.explore-content .card-list {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  cursor: pointer;
  height: 100%;
}

.explore-content .card-list:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: var(--primary);
}

.explore-content .card-list:active {
  transform: translateY(-2px);
}

.explore-content .card-list .card-body {
  padding: var(--space-lg);
}

/* ── Card title bar with badges ── */
.explore-content .card-list .card-title-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.explore-content .card-list .card-word {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
}

.explore-content .card-list .card-translation {
  font-size: 1rem;
  font-weight: 500;
  color: var(--bs-secondary-color, #6c757d);
  line-height: 1.4;
}

/* ── Resource card (alphabet uses this inside .card-list) ── */
.explore-content .resource-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: all var(--transition-base);
  backdrop-filter: blur(4px);
  height: 100%;
}
.explore-content .resource-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.explore-content .resource-card .resource-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.explore-content .resource-card .resource-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── Link wrapping card-list ── */
.explore-content .card-list-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.explore-content .card-list-link:hover {
  color: inherit;
}

/* ── Table rows in explore ── */
.explore-content .table-modern tbody tr {
  transition: all var(--transition-fast);
  cursor: pointer;
}

.explore-content .table-modern tbody tr:hover {
  background: rgba(0, 123, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(0, 123, 255, 0.15);
}

.dark-mode .explore-content .table-modern tbody tr:hover {
  background: rgba(0, 123, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(0, 123, 255, 0.2);
}

/* ── Locked card state ── */
.explore-content .lesson-locked-card,
.explore-content .dialogue-locked-card {
  opacity: 0.75;
}

/* ── Pagination inside explore ── */
.explore-content .pagination {
  margin-bottom: 0;
}

/* ============================================
   🔍 Explore Search Bar  (redesigned)
   ============================================ */
.explore-search-form {
  margin-bottom: 1rem;
}

.explore-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--glass-bg);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 3px 3px 3px 4px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.explore-search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15), var(--shadow-md);
}

/* ── Input wrapper (icon + input + clear + hint) ── */
.explore-search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  position: relative;
  min-width: 0;
}

.explore-search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color var(--transition-fast);
}

.explore-search-bar:focus-within .explore-search-icon {
  color: var(--primary);
}

.explore-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0.5rem 0.25rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
}

.explore-search-input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

/* ── Clear button ── */
.explore-search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 0.55rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  padding: 0;
  line-height: 1;
}

.explore-search-clear:hover {
  background: rgba(0, 0, 0, 0.15);
  color: var(--text-primary);
}

.dark-mode .explore-search-clear {
  background: rgba(255, 255, 255, 0.1);
}

.dark-mode .explore-search-clear:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ── Keyboard shortcut badge ── */
.explore-search-shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  flex-shrink: 0;
  margin-right: 2px;
  font-family: inherit;
  transition: opacity var(--transition-fast);
}

.explore-search-bar:focus-within .explore-search-shortcut {
  opacity: 0.3;
}

.dark-mode .explore-search-shortcut {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

/* ── Loading spinner ── */
.explore-search-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* ── Searching state: show spinner, hide hint and icon ── */
.explore-search-bar.is-searching .explore-search-shortcut {
  display: none !important;
}
.explore-search-bar.is-searching .explore-search-icon {
  display: none;
}
.explore-search-bar.is-searching .explore-search-spinner {
  display: flex !important;
}
.explore-search-bar.is-searching .explore-search-submit {
  pointer-events: none;
  opacity: 0.6;
}

/* ── Search field selector ── */
.explore-search-field-select {
  position: relative;
  flex-shrink: 0;
}

.explore-search-select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-md);
  padding: 0.4rem 1.6rem 0.4rem 0.7rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
  font-family: inherit;
  min-width: 90px;
}

.explore-search-select:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: var(--primary);
}

.explore-search-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.12);
}

.dark-mode .explore-search-select {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.dark-mode .explore-search-select:hover {
  background: rgba(255, 255, 255, 0.1);
}

.select-chevron {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.6rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: transform var(--transition-fast);
}

.explore-search-select:focus + .select-chevron {
  transform: translateY(-50%) rotate(180deg);
}

/* ── Submit button ── */
.explore-search-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  background: var(--primary-gradient);
  border-radius: 50%;
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.25);
}

.explore-search-submit:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(0, 123, 255, 0.35);
}

.explore-search-submit:active {
  transform: scale(0.95);
}

/* ── Dark mode overrides ── */
.dark-mode .explore-search-bar {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.dark-mode .explore-search-bar:focus-within {
  border-color: rgba(102, 16, 242, 0.6);
  box-shadow: 0 0 0 3px rgba(102, 16, 242, 0.15), var(--shadow-md);
}

.dark-mode .explore-search-bar:focus-within .explore-search-icon {
  color: rgba(102, 16, 242, 0.8);
}

.dark-mode .explore-search-input {
  color: var(--text-primary);
}

.dark-mode .explore-search-submit {
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  box-shadow: 0 2px 8px rgba(102, 16, 242, 0.3);
}

.dark-mode .explore-search-submit:hover {
  box-shadow: 0 4px 14px rgba(102, 16, 242, 0.4);
}

/* ── Responsive: stack search bar on small screens ── */
@media (max-width: 576px) {
  .explore-search-bar {
    flex-wrap: wrap;
    border-radius: var(--radius-lg);
    padding: 6px;
    gap: 6px;
  }
  .explore-search-input-wrap {
    width: 100%;
    order: 0;
  }
  .explore-search-field-select {
    flex: 1;
    order: 1;
  }
  .explore-search-field-select select {
    width: 100%;
  }
  .explore-search-submit {
    order: 2;
  }
  .explore-search-shortcut {
    display: none !important;
  }
}

/* ── Modal / Offcanvas search bar — handles Django {{ filter_form.search }} inputs ── */
.modal-search-bar .explore-search-input-wrap input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0.5rem 0.25rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
  box-shadow: none !important;
}
.modal-search-bar .explore-search-input-wrap input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}
.dark-mode .modal-search-bar .explore-search-input-wrap input {
  color: var(--text-primary);
  background: transparent;
}

/* ── Modal / Offcanvas footer buttons ── */
.modal-filter-form .btn.rounded-pill,
.offcanvas-filter-form .btn.rounded-pill {
  transition: all var(--transition-fast);
}
.modal-filter-form .btn.rounded-pill:hover,
.offcanvas-filter-form .btn.rounded-pill:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ============================================
   🏅 Explore Badge System — Premium Pill Design
   All resource badges (level, category, status)
   share a consistent pill look with shadows
   ============================================ */

/* ── Base table badge (level, category, open) ── */
.explore-content .table-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.3rem !important;
  padding: 0.3rem 0.75rem !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
  white-space: nowrap !important;
  border-radius: 50rem !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08) !important;
}
.explore-content .table-badge i {
  font-size: 0.75rem;
}
.explore-content .table-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.12) !important;
}

/* ── Success (Open / Unlocked) ── */
.explore-content .table-badge-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3) !important;
  border: none !important;
}
.explore-content .table-badge-success:hover {
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45) !important;
}
.dark-mode .explore-content .table-badge-success {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%) !important;
  box-shadow: 0 2px 8px rgba(52, 211, 153, 0.25) !important;
}

/* ── Danger (locked, error) ── */
.explore-content .table-badge-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3) !important;
  border: none !important;
}
.explore-content .table-badge-danger:hover {
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.45) !important;
}
.dark-mode .explore-content .table-badge-danger {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%) !important;
  box-shadow: 0 2px 8px rgba(248, 113, 113, 0.25) !important;
}

/* ── Dark (completed/neutral) ── */
.explore-content .table-badge-dark {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3) !important;
  border: none !important;
}
.explore-content .table-badge-dark:hover {
  box-shadow: 0 4px 14px rgba(107, 114, 128, 0.45) !important;
}
.dark-mode .explore-content .table-badge-dark {
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%) !important;
  box-shadow: 0 2px 8px rgba(156, 163, 175, 0.25) !important;
}

/* ── Secondary variant ── */
.explore-content .table-badge-secondary {
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(156, 163, 175, 0.3) !important;
  border: none !important;
}
.explore-content .table-badge-secondary:hover {
  box-shadow: 0 4px 14px rgba(156, 163, 175, 0.45) !important;
}

/* ── Warning (in progress) ── */
.explore-content .table-badge-warning {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
  white-space: nowrap !important;
  border-radius: 50rem !important;
  transition: all 0.2s ease !important;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3) !important;
  border: none !important;
}
.explore-content .table-badge-warning i {
  font-size: 0.75rem;
}
.explore-content .table-badge-warning:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.45) !important;
}
.dark-mode .explore-content .table-badge-warning {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.25) !important;
}

/* ── Info variant ── */
.explore-content .table-badge-info {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3) !important;
  border: none !important;
}
.explore-content .table-badge-info:hover {
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.45) !important;
}

/* ── Status badges for card views (completed, in progress) ── */
.explore-content .explore-status-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.3rem;
  padding: 0.3rem 0.8rem !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap !important;
  border-radius: 50rem !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08) !important;
  border: none !important;
  line-height: 1.4 !important;
  transition: all 0.2s ease;
}
.explore-content .explore-status-badge i {
  font-size: 0.7rem;
}
.explore-content .explore-status-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12) !important;
}
.explore-status-badge-completed {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3) !important;
}
.explore-status-badge-completed:hover {
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.45) !important;
}
.dark-mode .explore-status-badge-completed {
  background: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%) !important;
}
.explore-status-badge-progress {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3) !important;
}
.explore-status-badge-progress:hover {
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.45) !important;
}
.dark-mode .explore-status-badge-progress {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
}
.explore-status-badge-open {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3) !important;
}
.explore-status-badge-open:hover {
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45) !important;
}
.dark-mode .explore-status-badge-open {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%) !important;
}

/* ============================================
   🎨 Category Badge Theme Colors
   Each group gets its own distinct gradient
   ============================================ */

/* ── Primary (General / Meta) ── */
.explore-content .table-badge-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3) !important;
  border: none !important;
}
.explore-content .table-badge-primary:hover {
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.45) !important;
}
.dark-mode .explore-content .table-badge-primary {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%) !important;
}

/* ── Purple (Grammar / Language) ── */
.explore-content .table-badge-purple {
  background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.3) !important;
  border: none !important;
}
.explore-content .table-badge-purple:hover {
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.45) !important;
}
.dark-mode .explore-content .table-badge-purple {
  background: linear-gradient(135deg, #c084fc 0%, #a855f7 100%) !important;
}

/* ── Nature (Green) ── */
.explore-content .table-badge-nature {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3) !important;
  border: none !important;
}
.explore-content .table-badge-nature:hover {
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.45) !important;
}
.dark-mode .explore-content .table-badge-nature {
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%) !important;
}

/* ── Food (Orange) ── */
.explore-content .table-badge-food {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3) !important;
  border: none !important;
}
.explore-content .table-badge-food:hover {
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.45) !important;
}
.dark-mode .explore-content .table-badge-food {
  background: linear-gradient(135deg, #fb923c 0%, #f97316 100%) !important;
}

/* ── Home (Teal) ── */
.explore-content .table-badge-home {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.3) !important;
  border: none !important;
}
.explore-content .table-badge-home:hover {
  box-shadow: 0 4px 14px rgba(20, 184, 166, 0.45) !important;
}
.dark-mode .explore-content .table-badge-home {
  background: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 100%) !important;
}

/* ── Social (Pink) ── */
.explore-content .table-badge-social {
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3) !important;
  border: none !important;
}
.explore-content .table-badge-social:hover {
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.45) !important;
}
.dark-mode .explore-content .table-badge-social {
  background: linear-gradient(135deg, #f472b6 0%, #ec4899 100%) !important;
}

/* ── Transport (Amber) ── */
.explore-content .table-badge-transport {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3) !important;
  border: none !important;
}
.explore-content .table-badge-transport:hover {
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.45) !important;
}
.dark-mode .explore-content .table-badge-transport {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
}

/* ── City (Indigo) ── */
.explore-content .table-badge-city {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3) !important;
  border: none !important;
}
.explore-content .table-badge-city:hover {
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45) !important;
}
.dark-mode .explore-content .table-badge-city {
  background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%) !important;
}

/* ── Health (Red) ── */
.explore-content .table-badge-health {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3) !important;
  border: none !important;
}
.explore-content .table-badge-health:hover {
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.45) !important;
}
.dark-mode .explore-content .table-badge-health {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%) !important;
}

/* ── Education (Cyan) ── */
.explore-content .table-badge-edu {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3) !important;
  border: none !important;
}
.explore-content .table-badge-edu:hover {
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.45) !important;
}
.dark-mode .explore-content .table-badge-edu {
  background: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%) !important;
}

/* ── Tech (Slate/Blue-gray) ── */
.explore-content .table-badge-tech {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(100, 116, 139, 0.3) !important;
  border: none !important;
}
.explore-content .table-badge-tech:hover {
  box-shadow: 0 4px 14px rgba(100, 116, 139, 0.45) !important;
}
.dark-mode .explore-content .table-badge-tech {
  background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%) !important;
}

/* ── Time (Stone) ── */
.explore-content .table-badge-time {
  background: linear-gradient(135deg, #78716c 0%, #57534e 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(120, 113, 108, 0.3) !important;
  border: none !important;
}
.explore-content .table-badge-time:hover {
  box-shadow: 0 4px 14px rgba(120, 113, 108, 0.45) !important;
}
.dark-mode .explore-content .table-badge-time {
  background: linear-gradient(135deg, #a8a29e 0%, #78716c 100%) !important;
}

/* ── Culture (Violet) ── */
.explore-content .table-badge-culture {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3) !important;
  border: none !important;
}
.explore-content .table-badge-culture:hover {
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.45) !important;
}
.dark-mode .explore-content .table-badge-culture {
  background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%) !important;
}

/* ── Commerce (Yellow) ── */
.explore-content .table-badge-commerce {
  background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(234, 179, 8, 0.3) !important;
  border: none !important;
}
.explore-content .table-badge-commerce:hover {
  box-shadow: 0 4px 14px rgba(234, 179, 8, 0.45) !important;
}
.dark-mode .explore-content .table-badge-commerce {
  background: linear-gradient(135deg, #facc15 0%, #eab308 100%) !important;
}

/* ── Sensory (Rose) ── */
.explore-content .table-badge-sensory {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.3) !important;
  border: none !important;
}
.explore-content .table-badge-sensory:hover {
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.45) !important;
}
.dark-mode .explore-content .table-badge-sensory {
  background: linear-gradient(135deg, #fb7185 0%, #f43f5e 100%) !important;
}

/* ── Amber (Expressions / Responses) ── */
.explore-content .table-badge-amber {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3) !important;
  border: none !important;
}
.explore-content .table-badge-amber:hover {
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.45) !important;
}
.dark-mode .explore-content .table-badge-amber {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
}

/* ============================================
   🌗 Dark Mode Overrides
   ============================================ */
.dark-mode .explore-nav {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.dark-mode .explore-nav-item {
  color: var(--text-primary);
}

.dark-mode .explore-nav-item:hover {
  background: rgba(102, 16, 242, 0.2);
}

.dark-mode .explore-content {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.dark-mode .explore-nav-count {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.dark-mode .explore-nav-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

/* ── Dark mode cards ── */
.dark-mode .explore-content .card-list {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}

.dark-mode .explore-content .card-list:hover {
  border-color: rgba(102, 16, 242, 0.4);
  box-shadow: 0 8px 24px rgba(102, 16, 242, 0.15);
}

.dark-mode .explore-content .card-list .card-translation {
  color: #aaa;
}

.dark-mode .explore-content .resource-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}

.dark-mode .explore-content .resource-card:hover {
  border-color: rgba(102, 16, 242, 0.4);
}

/* ============================================
   📊 Improved Table Styles
   ============================================ */
.explore-content .table {
  margin-bottom: 0;
  font-size: 0.9rem;
}
.explore-content .table thead th {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--glass-border);
  white-space: nowrap;
}
.explore-content .table tbody tr {
  transition: background 0.15s ease;
}
.explore-content .table tbody tr:hover {
  background: rgba(102, 16, 242, 0.04);
}

/* ── Conjugation table cell ── */
.conj-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.82rem;
  line-height: 1.3;
}
.conj-affirmative {
  display: inline-flex;
  align-items: center;
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
  width: 100%;
}
.conj-negative {
  display: inline-flex;
  align-items: center;
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  font-weight: 500;
  font-size: 0.78rem;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
  width: 100%;
}
.conj-divider {
  display: none;
}
.dark-mode .conj-affirmative {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
}
.dark-mode .conj-negative {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

/* ── Conjugation card grid ── */
.conj-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.conj-card-item {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md, 0.5rem);
  padding: 6px 8px;
}
.conj-card-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted, #6c757d);
  margin-bottom: 2px;
}
.dark-mode .conj-card-item {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}

/* ============================================
   📐 Pagination Summary + Ellipsis
   ============================================ */
.explore-pagination-wrapper .pagination-summary {
  font-size: 0.8rem;
}
.explore-pagination-wrapper .page-link-ellipsis {
  border: none;
  background: transparent;
  cursor: default;
  color: var(--text-muted);
}
.explore-pagination-wrapper .page-link-text {
  font-size: 0.78rem;
}
.explore-pagination-wrapper .explore-per-page:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.15rem rgba(102, 16, 242, 0.2);
}

/* ============================================
   🎛️ Inline Filter Bar
   ============================================ */
.explore-filter-bar .explore-filter-body {
  transition: all 0.25s ease;
}
.explore-filter-bar .explore-filter-body.show {
  display: block !important;
}
.explore-filter-bar .explore-filter-body:not(.show) {
  display: none;
}
.explore-filter-bar .card {
  border-color: var(--glass-border);
  background: rgba(102, 16, 242, 0.03);
}
.explore-filter-bar select.form-select-sm,
.explore-filter-bar input.form-control-sm {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
}

/* ============================================
   🏷️ Active Filter Badges — Sleek Pill Design
   ============================================ */
.active-filter-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 0.6rem;
  margin-bottom: 0.4rem;
}

.af-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px 3px 8px;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 50rem;
  border: 1px solid;
  transition: all var(--transition-fast);
  cursor: default;
  line-height: 1.4;
}

.af-badge i {
  font-size: 0.7rem;
  opacity: 0.85;
}

.af-badge-search {
  background: rgba(13, 110, 253, 0.08);
  border-color: rgba(13, 110, 253, 0.2);
  color: var(--bs-primary, #0d6efd);
}
.af-badge-search:hover {
  background: rgba(13, 110, 253, 0.14);
}

.af-badge-kind {
  background: rgba(255, 193, 7, 0.1);
  border-color: rgba(255, 193, 7, 0.25);
  color: #b8860b;
}
.dark-mode .af-badge-kind {
  color: #f0c040;
}

.af-badge-category {
  background: rgba(25, 135, 84, 0.08);
  border-color: rgba(25, 135, 84, 0.2);
  color: var(--bs-success, #198754);
}
.af-badge-category:hover {
  background: rgba(25, 135, 84, 0.14);
}

.af-badge-level {
  background: rgba(111, 66, 193, 0.08);
  border-color: rgba(111, 66, 193, 0.2);
  color: var(--bs-purple, #6f42c1);
}
.af-badge-level:hover {
  background: rgba(111, 66, 193, 0.14);
}

.af-badge-source {
  background: rgba(108, 117, 125, 0.1);
  border-color: rgba(108, 117, 125, 0.2);
  color: var(--bs-secondary, #6c757d);
}

.af-badge-gender {
  background: rgba(13, 202, 240, 0.08);
  border-color: rgba(13, 202, 240, 0.2);
  color: var(--bs-info, #0dcaf0);
}

/* ── Remove button inside badge ── */
.af-badge-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.5;
  cursor: pointer;
  border-radius: 50%;
  transition: all var(--transition-fast);
  font-size: 0.5rem;
  line-height: 1;
  flex-shrink: 0;
}
.af-badge-remove:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.1);
}
.dark-mode .af-badge-remove:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ── Clear all button ── */
.af-badge-clear {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--bs-danger, #dc3545);
  border-radius: 50rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  opacity: 0.7;
  line-height: 1.4;
}
.af-badge-clear:hover {
  opacity: 1;
  background: rgba(220, 53, 69, 0.08);
}

.af-badge-boolean {
  background: rgba(255, 193, 7, 0.08);
  border-color: rgba(255, 193, 7, 0.2);
  color: #b8860b;
}
.dark-mode .af-badge-boolean {
  color: #f0c040;
}
.af-badge-boolean:hover {
  background: rgba(255, 193, 7, 0.14);
}

.af-badge-label {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================
   📱 Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
  .explore-wrapper {
    flex-direction: column;
  }
  .explore-sidebar {
    width: 100% !important;
    position: static;
  }
  /* Remove collapsed effect on mobile */
  .explore-sidebar.explore-sidebar-collapsed .explore-nav-header {
    display: flex;
  }
  .explore-sidebar.explore-sidebar-collapsed .explore-nav-item {
    justify-content: flex-start;
    padding: 0.4rem 0.6rem;
    gap: 10px;
  }
  .explore-sidebar.explore-sidebar-collapsed .explore-nav-item .explore-nav-label {
    display: inline;
  }
  .explore-sidebar.explore-sidebar-collapsed .explore-nav-item .explore-nav-count {
    display: inline-flex;
  }
  .explore-sidebar.explore-sidebar-collapsed .explore-nav-item .explore-nav-icon {
    width: 22px;
    font-size: 1.15rem;
  }
  .explore-sidebar.explore-sidebar-collapsed .explore-sidebar-toggle .collapse-icon {
    transform: none;
  }
  .explore-sidebar-toggle {
    width: auto;
    padding: 0.25rem 0.4rem;
    margin: 0 auto 6px;
    opacity: 0.5;
  }
  .explore-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0.5rem;
  }
  .explore-nav-header {
    width: 100%;
  }
  .explore-nav-item {
    flex: 1 0 auto;
    min-width: 0;
    padding: 0.4rem 0.6rem;
  }
  .explore-nav-label {
    font-size: 0.75rem;
  }
  .explore-nav-count {
    font-size: 0.65rem;
    min-width: 20px;
    padding: 1px 5px;
  }
}

/* ==========================================================================
   🎨 Choices.js Modern Theme — Pill-style, glassmorphism
   ========================================================================== */

/* ── Outer wrapper ── */
.choices {
  font-size: 0.88rem;
  margin-bottom: 0;
}

/* ── Inner pseudo-input ── */
.choices__inner {
  background: var(--bs-body-bg, #fff);
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: var(--radius-md, 0.5rem);
  padding: 0.35rem 0.5rem 0.1rem !important;
  min-height: 2.25rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.choices.is-focused .choices__inner {
  border-color: var(--bs-primary, #0d6efd);
  box-shadow: 0 0 0 2px var(--bs-primary-bg-subtle, #e7f1ff);
}
/* ── Search input inside ── */
.choices__input--cloned {
  font-size: 0.88rem;
  padding: 0.15rem 0 0.15rem 0.25rem !important;
}

/* ── Placeholder ── */
.choices__placeholder {
  opacity: 0.6;
}

/* ── Multi-select pills (tags) ── */
.choices__list--multiple .choices__item {
  background: var(--bs-primary, #0d6efd);
  border: 1px solid var(--bs-primary-border-subtle, #9ec5fe);
  color: #fff;
  border-radius: 50rem;
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  margin-bottom: 0.2rem;
  word-break: break-all;
}
.choices__list--multiple .choices__item[data-deletable] {
  padding-right: 0.35rem;
}
.choices__list--multiple .choices__item.is-highlighted {
  background: var(--bs-primary-text-emphasis, #084298);
  border-color: var(--bs-primary-text-emphasis, #084298);
}

/* ── Remove button X ── */
.choices__list--multiple .choices__button {
  border-left: 1px solid rgba(255,255,255,0.3);
  margin-left: 0.35rem;
  padding-left: 0.35rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3'%3E%3Cpath d='M6 6l12 12M18 6l-12 12'/%3E%3C/svg%3E");
  background-size: 8px;
  opacity: 0.8;
}
.choices__list--multiple .choices__button:hover {
  opacity: 1;
}

/* ── Single-select value ── */
.choices__list--single {
  padding: 0.2rem 0.5rem 0.2rem 0.25rem;
}

/* ── Dropdown list ── */
.choices__list--dropdown {
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: var(--radius-md, 0.5rem);
  margin-top: 2px;
  z-index: 1050;
  background: var(--bs-body-bg, #fff);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.choices__list--dropdown .choices__item {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}
.choices__list--dropdown .choices__item--selectable.is-highlighted {
  background: var(--bs-primary-bg-subtle, #e7f1ff);
}

/* ── No results / no choices ── */
.choices__list--dropdown .choices__list .choices__item--disabled {
  color: var(--bs-secondary-color, #6c757d);
  opacity: 0.7;
  font-style: italic;
}

/* ── Dark mode overrides ── */
.dark-mode .choices__inner {
  background: var(--bs-dark-bg-subtle, #2b3035);
  border-color: var(--bs-border-color, #495057);
  color: var(--bs-body-color, #dee2e6);
}
.dark-mode .choices__list--dropdown {
  background: var(--bs-dark-bg-subtle, #2b3035);
  border-color: var(--bs-border-color, #495057);
}
.dark-mode .choices__list--dropdown .choices__item--selectable.is-highlighted {
  background: var(--bs-primary-bg-subtle, #1e3a5f);
}
.dark-mode .choices__list--single {
  color: var(--bs-body-color, #dee2e6);
}
.dark-mode .choices__input--cloned {
  color: var(--bs-body-color, #dee2e6);
}

/* ── Inside filter sections, ensure Choices doesn't overflow ── */
.filter-section .choices {
  max-width: 100%;
}
.filter-section .choices__inner {
  border-radius: var(--radius-sm, 0.35rem);
}

/* ── Inside filter-grid (modal/offcanvas) — force equal height with native selects ── */
.filter-grid {
  align-items: stretch;
}
.filter-grid .filter-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.filter-grid .filter-item .form-label {
  flex-shrink: 0;
}
.filter-grid .filter-item .form-select,
.filter-grid .filter-item .form-control,
.filter-grid .filter-item .choices {
  margin-top: auto;
}
.filter-grid .choices,
.filter-grid .choices__inner,
.filter-grid .choices__list--single,
.filter-grid .choices__list--multiple {
  height: 2.1rem !important;
  min-height: 2.1rem !important;
  max-height: 2.1rem !important;
}
.filter-grid .choices {
  position: relative;
  font-size: 0.8rem !important;
}
.filter-grid .choices__inner {
  padding: 0.1rem 0.3rem 0.05rem !important;
  border-radius: 0.3rem !important;
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  align-content: center !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}
.filter-grid .choices__list--multiple .choices__item {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  line-height: 1.2 !important;
  padding: 0.05rem 0.4rem !important;
  font-size: 0.75rem !important;
}
.filter-grid .choices__list--single {
  padding: 0 0.5rem !important;
  display: flex !important;
  align-items: center !important;
  height: 100% !important;
}
.filter-grid .choices__input--cloned {
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}
.filter-grid select.choices-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.filter-grid .filter-item .form-select,
.filter-grid .filter-item .form-control {
  height: 2.1rem !important;
}

/* ==========================================================================
   🎛️ Filter Button — Premium glassmorphism pill
   ========================================================================== */

/* ── Base ── */
.explore-filter-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 50rem;
  border: 1px solid var(--bs-border-color, #dee2e6);
  background: var(--bs-body-bg, #fff);
  color: var(--bs-body-color, #212529);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.explore-filter-btn:hover {
  border-color: var(--bs-primary-border-subtle, #9ec5fe);
  background: var(--bs-primary-bg-subtle, #e7f1ff);
  color: var(--bs-primary-text-emphasis, #052c65);
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.12);
  transform: translateY(-1px);
}
.explore-filter-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(13, 110, 253, 0.1);
}
.explore-filter-btn .filter-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--bs-primary, #0d6efd);
  transition: transform 0.2s ease;
}
.explore-filter-btn:hover .filter-icon {
  transform: rotate(-8deg);
}
.explore-filter-btn .filter-label {
  line-height: 1;
}

/* ── Filter count badge ── */
.explore-filter-btn .filter-badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.3rem;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 50rem;
  background: var(--bs-primary, #0d6efd);
  color: #fff;
  line-height: 1;
  animation: badgePopIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  margin-left: 0.1rem;
}

/* ── Badge entrance animation ── */
@keyframes badgePopIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* ── "Active" variant (when filters are applied) ── */
.explore-filter-btn.is-active {
  border-color: var(--bs-primary, #0d6efd);
  background: linear-gradient(135deg, var(--bs-primary-bg-subtle, #e7f1ff), #fff 80%);
  color: var(--bs-primary-text-emphasis, #052c65);
  box-shadow: 0 0 0 1px rgba(13, 110, 253, 0.15), 0 2px 6px rgba(13, 110, 253, 0.08);
}
.explore-filter-btn.is-active .filter-icon {
  color: var(--bs-primary, #0d6efd);
}
.explore-filter-btn.is-active:hover {
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.2), 0 3px 10px rgba(13, 110, 253, 0.12);
}

/* ── Dark mode ── */
.dark-mode .explore-filter-btn {
  background: var(--bs-dark-bg-subtle, #2b3035);
  border-color: var(--bs-border-color, #495057);
  color: var(--bs-body-color, #dee2e6);
}
.dark-mode .explore-filter-btn .filter-icon {
  color: var(--bs-primary-bg-subtle, #6ea8fe);
}
.dark-mode .explore-filter-btn:hover {
  background: var(--bs-primary-bg-subtle, #1e3a5f);
  border-color: var(--bs-primary, #0d6efd);
  color: #fff;
}
.dark-mode .explore-filter-btn.is-active {
  background: linear-gradient(135deg, #1e3a5f, #2b3035 80%);
  border-color: var(--bs-primary, #0d6efd);
  color: #fff;
}

/* ── Right-aligned toolbar group ── */
.explore-toolbar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ── View toggle pills ── */
.explore-view-toggle {
  display: inline-flex;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 50rem;
  overflow: hidden;
  background: var(--bs-body-bg, #fff);
  transition: border-color 0.15s ease;
}
.explore-view-toggle .view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
  border: none;
  background: transparent;
  color: var(--bs-secondary-color, #6c757d);
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}
.explore-view-toggle .view-btn:not(:last-child) {
  border-right: 1px solid var(--bs-border-color, #dee2e6);
}
.explore-view-toggle .view-btn:hover {
  background: var(--bs-light-bg-subtle, #f8f9fa);
  color: var(--bs-body-color, #212529);
}
.explore-view-toggle .view-btn.active {
  background: var(--bs-primary, #0d6efd);
  color: #fff;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}
.explore-view-toggle .view-btn.active:hover {
  background: var(--bs-primary-text-emphasis, #084298);
}

.dark-mode .explore-view-toggle {
  background: var(--bs-dark-bg-subtle, #2b3035);
  border-color: var(--bs-border-color, #495057);
}
.dark-mode .explore-view-toggle .view-btn {
  color: var(--bs-secondary-color, #adb5bd);
}
.dark-mode .explore-view-toggle .view-btn:not(:last-child) {
  border-color: var(--bs-border-color, #495057);
}
.dark-mode .explore-view-toggle .view-btn:hover {
  background: var(--bs-dark-active-bg, #3a3a4d);
  color: #fff;
}

/* ============================================
   🔒 Locked Resource Styles (Explore v2)
   High-visibility greying + bold badges
   ============================================ */

/* ── Locked table row ── */
.explore-content .explore-locked-row {
  opacity: 0.7;
  filter: grayscale(0.35);
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}
.explore-content .explore-locked-row:hover {
  opacity: 0.85;
  filter: grayscale(0.2);
  background: rgba(255, 193, 7, 0.08) !important;
  box-shadow: inset 0 0 0 1.5px rgba(255, 193, 7, 0.25) !important;
}
.dark-mode .explore-content .explore-locked-row:hover {
  background: rgba(255, 193, 7, 0.12) !important;
  box-shadow: inset 0 0 0 1.5px rgba(255, 193, 7, 0.3) !important;
}

/* ── Locked card ── */
.explore-content .explore-locked-card {
  opacity: 0.75;
  filter: grayscale(0.35);
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}
.explore-content .explore-locked-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  opacity: 0.95;
  filter: grayscale(0.15);
}

/* ── Lock badge floating at bottom-right corner inside cards ── */
.explore-content .card-list {
  position: relative;
}
.explore-content .card-list .lock-badge-float {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 2;
}

/* ── Unified lock badge — premium pill with glow ── */
.explore-lock-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: none;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.explore-lock-badge .lock-badge-icon {
  font-size: 0.8rem;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}
.explore-lock-badge .lock-badge-text {
  position: relative;
  z-index: 1;
}

/* ── Premium (gold/amber) ── */
.lock-badge-premium {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.15) inset !important;
}
.lock-badge-premium:hover {
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.2) inset !important;
  transform: translateY(-1px);
}

/* ── Level (amber/orange-red) ── */
.lock-badge-level {
  background: linear-gradient(135deg, #f97316 0%, #dc2626 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.15) inset !important;
}
.lock-badge-level:hover {
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.2) inset !important;
  transform: translateY(-1px);
}

/* ── Login (indigo) ── */
.lock-badge-login {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.15) inset !important;
}
.lock-badge-login:hover {
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.2) inset !important;
  transform: translateY(-1px);
}

/* ── Subtle glow pulse animation for badges on hover ── */
.explore-locked-card:hover .explore-lock-badge,
.explore-locked-row:hover .explore-lock-badge {
  animation: lockBadgePulse 0.6s ease-in-out;
}
@keyframes lockBadgePulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* ── Dark mode lock badges ── */
.dark-mode .lock-badge-premium {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1) inset !important;
}
.dark-mode .lock-badge-level {
  background: linear-gradient(135deg, #fb923c 0%, #ef4444 100%) !important;
  box-shadow: 0 2px 8px rgba(251, 146, 60, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1) inset !important;
}
.dark-mode .lock-badge-login {
  background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%) !important;
  box-shadow: 0 2px 8px rgba(129, 140, 248, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1) inset !important;
}

/* ==========================================================================
   🎹 Bambara Virtual Keyboard (Search bar popup)
   ========================================================================== */

/* ── Toggle button (keyboard icon in the search bar) ── */
.explore-keyboard-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted, #6c757d);
  font-size: 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast, 0.15s ease);
  padding: 0;
  line-height: 1;
}

.explore-keyboard-toggle:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--primary, #007bff);
}

.explore-keyboard-toggle.active {
  background: var(--primary-light, #e6f0ff);
  color: var(--primary, #007bff);
}

.dark-mode .explore-keyboard-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.dark-mode .explore-keyboard-toggle.active {
  background: rgba(102, 16, 242, 0.2);
  color: #a78bfa;
}

/* ── Floating popup ── */
.explore-keyboard-popup {
  z-index: 1060;
  background: var(--modal-bg, #ffffff);
  border: 1px solid var(--glass-border, rgba(0,0,0,0.1));
  border-radius: var(--radius-lg, 12px);
  box-shadow: var(--shadow-lg, 0 10px 30px rgba(0,0,0,0.12));
  padding: 10px 12px 14px;
  min-width: 220px;
  animation: keyboardPopupIn 0.2s ease-out;
}

@keyframes keyboardPopupIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dark-mode .explore-keyboard-popup {
  background: hsl(240, 10%, 18%);
  border-color: rgba(255, 255, 255, 0.1);
}

/* ── Popup header ── */
.explore-keyboard-popup-header {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary, #6c757d);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--glass-border, rgba(0,0,0,0.06));
  text-align: center;
}

.explore-keyboard-popup-header small {
  font-weight: 400;
  opacity: 0.6;
}

/* ── Key grid ── */
.explore-keyboard-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

/* ── Individual key button ── */
.explore-keyboard-key {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--glass-border, rgba(0,0,0,0.1));
  background: var(--glass-bg, rgba(255,255,255,0.15));
  border-radius: var(--radius-sm, 8px);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary, #1a1a2e);
  cursor: pointer;
  transition: all var(--transition-fast, 0.15s ease);
  padding: 0;
  line-height: 1;
}

.explore-keyboard-key:hover {
  background: var(--primary, #007bff);
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 2px 10px rgba(0, 123, 255, 0.3);
  border-color: var(--primary, #007bff);
}

.explore-keyboard-key:active {
  transform: scale(0.95);
}

.dark-mode .explore-keyboard-key {
  color: #e8e8f0;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.dark-mode .explore-keyboard-key:hover {
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  border-color: #6a11cb;
  box-shadow: 0 2px 10px rgba(102, 16, 242, 0.35);
}

/* ── Explore MAJ (Shift) button ── */
.explore-kb-maj {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--glass-border, rgba(0,0,0,0.1));
  background: var(--glass-bg, rgba(255,255,255,0.15));
  border-radius: var(--radius-sm, 8px);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-primary, #1a1a2e);
  cursor: pointer;
  transition: all var(--transition-fast, 0.15s ease);
  padding: 0;
  line-height: 1;
  letter-spacing: 0.5px;
}

.explore-kb-maj:hover {
  background: var(--primary, #007bff);
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 2px 10px rgba(0, 123, 255, 0.3);
  border-color: var(--primary, #007bff);
}

.explore-kb-maj.active {
  background: var(--primary, #007bff);
  color: #fff;
  border-color: var(--primary, #007bff);
  box-shadow: 0 2px 10px rgba(0, 123, 255, 0.3);
}

.dark-mode .explore-kb-maj {
  color: #e8e8f0;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.dark-mode .explore-kb-maj:hover {
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  border-color: #6a11cb;
  box-shadow: 0 2px 10px rgba(102, 16, 242, 0.35);
}

.dark-mode .explore-kb-maj.active {
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  border-color: #6a11cb;
  box-shadow: 0 2px 10px rgba(102, 16, 242, 0.35);
}
