/* ==========================================================================
   EcrioniX Central Resource Explorer Styles
   ========================================================================== */

.explorer-page {
  min-height: 100vh;
  background-color: var(--bg-primary, #0a0e17);
  color: var(--text-primary, #f8fafc);
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
}

/* Hero Section */
.exp-hero {
  padding: 3.5rem 1.5rem 2.5rem;
  background: radial-gradient(ellipse at 50% 0%, rgba(0, 229, 255, 0.12) 0%, rgba(15, 23, 42, 0) 70%),
              linear-gradient(180deg, rgba(15, 23, 42, 0.6) 0%, rgba(10, 14, 23, 0.95) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}
:root[data-theme="light"] .exp-hero {
  background: radial-gradient(ellipse at 50% 0%, rgba(2, 132, 199, 0.12) 0%, rgba(241, 245, 249, 0) 70%),
              linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  border-bottom-color: rgba(15, 23, 42, 0.1);
}

.exp-hero-container {
  max-width: 960px;
  margin: 0 auto;
}

.exp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ecx-primary, #00e5ff);
  margin-bottom: 1.25rem;
  letter-spacing: 0.3px;
}
:root[data-theme="light"] .exp-badge {
  background: rgba(2, 132, 199, 0.1);
  border-color: rgba(2, 132, 199, 0.3);
  color: #0284c7;
}

.exp-title {
  font-family: 'Orbitron', 'Outfit', sans-serif;
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 1rem;
  letter-spacing: -0.5px;
}
.exp-title span {
  background: linear-gradient(135deg, #00e5ff 0%, #38bdf8 50%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
:root[data-theme="light"] .exp-title span {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.exp-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted, #94a3b8);
  max-width: 720px;
  margin: 0 auto 1.85rem;
  line-height: 1.6;
}

/* Search Bar in Hero */
.exp-search-box {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
}
.exp-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 1rem 3rem 1rem 3.25rem;
  font-size: 1.05rem;
  font-family: inherit;
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  color: var(--text-primary, #f8fafc);
  outline: none;
  transition: all 0.2s ease;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35);
}
.exp-search-input:focus {
  border-color: var(--ecx-primary, #00e5ff);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.25), 0 12px 30px -5px rgba(0, 0, 0, 0.4);
}
:root[data-theme="light"] .exp-search-input {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.2);
  color: #0f172a;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}
:root[data-theme="light"] .exp-search-input:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

.exp-search-icon {
  position: absolute;
  left: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted, #94a3b8);
  pointer-events: none;
  font-size: 1.25rem;
}
.exp-search-clear {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}
.exp-search-clear:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* Quick Topic Chips */
.exp-quick-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
}
.exp-chip {
  padding: 0.35rem 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  font-size: 0.82rem;
  color: var(--text-muted, #cbd5e1);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.exp-chip:hover,
.exp-chip.is-active {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--ecx-primary, #00e5ff);
  color: var(--ecx-primary, #00e5ff);
  transform: translateY(-1px);
}
:root[data-theme="light"] .exp-chip {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  color: #475569;
}
:root[data-theme="light"] .exp-chip:hover,
:root[data-theme="light"] .exp-chip.is-active {
  background: rgba(2, 132, 199, 0.1);
  border-color: #0284c7;
  color: #0284c7;
}

/* Main Layout (Sidebar + Results) */
.exp-main {
  max-width: 1360px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  box-sizing: border-box;
}

/* Left Filter Sidebar */
.exp-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.exp-filter-card {
  background: var(--bg-card, #0f172a);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
:root[data-theme="light"] .exp-filter-card {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.exp-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}
.exp-filter-title {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-primary, #f8fafc);
  margin: 0;
}
.exp-btn-reset {
  background: transparent;
  border: none;
  color: var(--ecx-primary, #00e5ff);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
:root[data-theme="light"] .exp-btn-reset {
  color: #0284c7;
}

.exp-filter-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.exp-filter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-muted, #94a3b8);
  transition: all 0.15s ease;
  user-select: none;
}
.exp-filter-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary, #f8fafc);
}
.exp-filter-item.is-selected {
  background: rgba(0, 229, 255, 0.12);
  color: var(--ecx-primary, #00e5ff);
  font-weight: 600;
}
:root[data-theme="light"] .exp-filter-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}
:root[data-theme="light"] .exp-filter-item.is-selected {
  background: rgba(2, 132, 199, 0.1);
  color: #0284c7;
}

.exp-count-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted, #94a3b8);
}
.exp-filter-item.is-selected .exp-count-badge {
  background: rgba(0, 229, 255, 0.2);
  color: var(--ecx-primary, #00e5ff);
}
:root[data-theme="light"] .exp-filter-item.is-selected .exp-count-badge {
  background: rgba(2, 132, 199, 0.2);
  color: #0284c7;
}

/* Results Content Area */
.exp-results-pane {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Control Bar (Counter, Active Chips, Sort, Mobile Filter Button) */
.exp-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: var(--bg-card, #0f172a);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}
:root[data-theme="light"] .exp-control-bar {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.1);
}

.exp-status-counter {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary, #f8fafc);
}
.exp-status-counter span {
  color: var(--ecx-primary, #00e5ff);
}
:root[data-theme="light"] .exp-status-counter span {
  color: #0284c7;
}

.exp-control-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.exp-btn-mobile-filter {
  display: none;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.5rem 1rem;
  background: var(--ecx-surface-hover-dark, #1e293b);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: var(--text-primary, #f8fafc);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
:root[data-theme="light"] .exp-btn-mobile-filter {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.15);
  color: #0f172a;
}

.exp-sort-select {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: var(--text-primary, #f8fafc);
  font-size: 0.88rem;
  outline: none;
  cursor: pointer;
  font-family: inherit;
}
:root[data-theme="light"] .exp-sort-select {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.15);
  color: #0f172a;
}

/* Active Filter Badges */
.exp-active-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.exp-active-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 9999px;
  font-size: 0.78rem;
  color: var(--ecx-primary, #00e5ff);
}
:root[data-theme="light"] .exp-active-pill {
  background: rgba(2, 132, 199, 0.1);
  border-color: rgba(2, 132, 199, 0.3);
  color: #0284c7;
}
.exp-active-pill-remove {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0;
}

/* Results Grid */
.exp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

/* Resource Card */
.exp-card {
  background: var(--bg-card, #0f172a);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}
.exp-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 229, 255, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
:root[data-theme="light"] .exp-card {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.09);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}
:root[data-theme="light"] .exp-card:hover {
  border-color: #0284c7;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.12);
}

.exp-card-top {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.exp-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* Category & Type Badges */
.exp-badge-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.exp-cat-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.exp-type-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(0, 229, 255, 0.1);
  color: var(--ecx-primary, #00e5ff);
}
:root[data-theme="light"] .exp-type-badge {
  background: rgba(2, 132, 199, 0.1);
  color: #0284c7;
}

/* Difficulty Badges */
.exp-diff-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
}
.exp-diff-beginner {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.exp-diff-intermediate {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.exp-diff-advanced {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}
.exp-diff-all-levels {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.exp-card-title {
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  color: var(--text-primary, #f8fafc);
}
.exp-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}
.exp-card-title a:hover {
  color: var(--ecx-primary, #00e5ff);
}
:root[data-theme="light"] .exp-card-title a:hover {
  color: #0284c7;
}

.exp-card-desc {
  font-size: 0.88rem;
  color: var(--text-muted, #94a3b8);
  line-height: 1.5;
  margin: 0;
}

/* Card Bottom */
.exp-card-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.85rem;
}
:root[data-theme="light"] .exp-card-bottom {
  border-top-color: rgba(15, 23, 42, 0.06);
}

.exp-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.exp-card-tag {
  font-size: 0.73rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  transition: background 0.15s ease;
}
.exp-card-tag:hover {
  background: rgba(0, 229, 255, 0.15);
  color: var(--ecx-primary, #00e5ff);
}
:root[data-theme="light"] .exp-card-tag {
  background: #f1f5f9;
  color: #475569;
}
:root[data-theme="light"] .exp-card-tag:hover {
  background: rgba(2, 132, 199, 0.12);
  color: #0284c7;
}

.exp-card-action {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ecx-primary, #00e5ff);
  text-decoration: none;
  transition: gap 0.2s ease;
}
.exp-card-action:hover {
  color: #ffffff;
}
:root[data-theme="light"] .exp-card-action {
  color: #0284c7;
}
:root[data-theme="light"] .exp-card-action:hover {
  color: #0369a1;
}

/* Empty State */
.exp-empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  background: var(--bg-card, #0f172a);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 14px;
}
.exp-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}
.exp-empty-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}
.exp-empty-desc {
  font-size: 0.95rem;
  color: var(--text-muted, #94a3b8);
  max-width: 480px;
  margin: 0 auto 1.5rem;
  line-height: 1.5;
}

/* Load More Button */
.exp-load-more-container {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}
.exp-btn-load-more {
  padding: 0.85rem 2.25rem;
  background: var(--ecx-surface-hover-dark, #1e293b);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 9999px;
  color: var(--ecx-primary, #00e5ff);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.exp-btn-load-more:hover {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--ecx-primary, #00e5ff);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 229, 255, 0.2);
}
:root[data-theme="light"] .exp-btn-load-more {
  background: #ffffff;
  border-color: rgba(2, 132, 199, 0.3);
  color: #0284c7;
}

/* Mobile Filter Drawer */
.exp-mobile-filter-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1100;
  display: none;
  align-items: flex-end;
}
.exp-mobile-filter-modal.is-open {
  display: flex;
}
.exp-mobile-filter-sheet {
  width: 100%;
  max-height: 85vh;
  background: var(--bg-card, #0f172a);
  border-radius: 20px 20px 0 0;
  padding: 1.25rem 1.25rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: auto;
  box-sizing: border-box;
}
:root[data-theme="light"] .exp-mobile-filter-sheet {
  background: #ffffff;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .exp-main {
    grid-template-columns: 1fr;
  }
  .exp-sidebar {
    display: none; /* In mobile, replaced by filter drawer */
  }
  .exp-btn-mobile-filter {
    display: inline-flex;
  }
}
