/* ── Explore / Endless Voting ── */

body.explore-page {
  overflow: hidden;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

body.explore-page .subnav,
body.explore-page .subcategories-nav {
  display: none;
}

.explore-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  flex: 1;
  min-height: 0;
  position: relative;
}

/* ── Filter pills ── */

.explore-filters {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}


.explore-filter-pill {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary, #c5c6c7);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  font-family: inherit;
}

.explore-filter-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.explore-filter-pill.active {
  background: var(--text-secondary, #66fcf1);
  color: var(--bg-primary, #0b0c10);
  border-color: var(--text-secondary, #66fcf1);
  font-weight: 600;
}

/* ── Viewport (scrollable feed) ── */

.explore-viewport {
  position: relative;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.explore-viewport::-webkit-scrollbar {
  display: none;
}

/* ── Card wrapper (normal flow) ── */

.explore-card-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 8px 12px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* ── Card ── */

.explore-card {
  display: flex;
  flex-direction: column;
  background: #1a2332;
  border: 2px solid rgba(69, 162, 158, 0.35);
  border-radius: 12px;
  overflow: hidden;
}

/* ── Media ── */

.explore-media {
  width: 100%;
  max-height: 45vh;
  min-height: 180px;
  overflow: hidden;
  background: var(--bg-secondary, #1f2833);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.explore-media img {
  width: 100%;
  height: 100%;
  max-height: 45vh;
  object-fit: contain;
  display: block;
}

.explore-media video {
  width: 100%;
  max-height: 45vh;
  display: block;
}

.explore-media-yt {
  position: relative;
  padding-bottom: 56.25%;
  min-height: 0;
  max-height: none;
  height: 0;
}

.explore-media-yt iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── No-media card ── */

.explore-card.no-media .explore-info {
  padding-top: 20px;
}

.explore-card.no-media .explore-title {
  font-size: 22px;
  margin-bottom: 8px;
}

.explore-card.no-media .explore-description {
  font-size: 15px;
  line-height: 1.6;
  opacity: 0.8;
  white-space: pre-line;
}

/* ── Info ── */

.explore-info {
  padding: 14px 16px 6px;
  flex-shrink: 0;
}

.explore-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.explore-category,
.explore-subcategory {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: #9e9e9e;
}

.explore-subcategory {
  background: rgba(255, 255, 255, 0.05);
  color: #888;
}

.explore-votes {
  font-size: 12px;
  color: var(--text-primary, #c5c6c7);
  opacity: 0.6;
  margin-left: auto;
}

.explore-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary, #c5c6c7);
  margin: 0 0 4px;
  line-height: 1.3;
}

.explore-submitted {
  font-size: 13px;
  color: var(--text-primary, #c5c6c7);
  opacity: 0.55;
  margin-bottom: 4px;
}

.explore-description {
  font-size: 13px;
  color: var(--text-primary, #c5c6c7);
  opacity: 0.7;
  line-height: 1.4;
  margin-top: 4px;
  white-space: pre-line;
  word-break: break-word;
}

.explore-desc-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.explore-desc-toggle {
  background: none;
  border: none;
  color: var(--accent, #5ce1e6);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 0 0;
  opacity: 0.8;
}
.explore-desc-toggle:hover {
  opacity: 1;
  text-decoration: underline;
}

/* ── Voting / Sliders ── */

.explore-voting {
  padding: 10px 16px 20px;
  flex-shrink: 0;
}

.explore-slider-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.explore-legend {
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: var(--text-primary, #c5c6c7);
  opacity: 0.6;
  margin-bottom: 4px;
}

.explore-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.explore-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--text-secondary, #66fcf1);
  box-sizing: border-box;
  flex-shrink: 0;
}

.explore-legend-bar {
  display: inline-block;
  width: 16px;
  height: 6px;
  border-radius: 3px;
  background: var(--text-secondary, #66fcf1);
  opacity: 0.45;
  flex-shrink: 0;
}

.explore-slider-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.explore-slider-group.yesno .explore-slider-row {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.explore-slider-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.explore-slider-label {
  font-size: 13px;
  color: var(--text-primary, #c5c6c7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.explore-slider-group.yesno .explore-slider-label {
  flex-shrink: 0;
}

.explore-slider-track {
  position: relative;
  width: 100%;
  height: 24px;
  background: var(--bg-tertiary, #424242);
  border-radius: 6px;
}

.explore-slider-group.yesno .explore-slider-track {
  flex: 1;
}

.explore-slider-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--text-secondary, #66fcf1);
  border-radius: 6px;
  opacity: 0.45;
  transition: width 0.4s ease;
}

.explore-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  outline: none;
  cursor: pointer;
  z-index: 1;
}

.explore-slider::-webkit-slider-runnable-track {
  -webkit-appearance: none;
  height: 24px;
  background: transparent;
  border: none;
}

.explore-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--text-secondary, #66fcf1);
  cursor: grab;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  margin-top: 2px;
  transition: transform 0.1s ease;
}

.explore-slider::-moz-range-track {
  height: 24px;
  background: transparent;
  border: none;
}

.explore-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--text-secondary, #66fcf1);
  cursor: grab;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.explore-slider:active::-webkit-slider-thumb {
  cursor: grabbing;
  transform: scale(1.15);
}

.explore-slider:active::-moz-range-thumb {
  cursor: grabbing;
  transform: scale(1.15);
}

.explore-slider:disabled {
  cursor: default;
}

.explore-slider:disabled::-webkit-slider-thumb {
  cursor: default;
  border-color: rgba(255, 255, 255, 0.6);
}

.explore-slider:disabled::-moz-range-thumb {
  cursor: default;
  border-color: rgba(255, 255, 255, 0.6);
}

.explore-slider-value {
  font-size: 13px;
  font-weight: 600;
  color: #e0e0e0;
  flex-shrink: 0;
}

.explore-slider-group.yesno .explore-slider-value {
  min-width: 42px;
  text-align: right;
}

/* ── Action buttons ── */

.explore-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.explore-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  transition: all 0.15s ease;
  font-family: inherit;
}

.explore-btn-primary {
  background: var(--text-secondary, #66fcf1);
  color: var(--bg-primary, #0b0c10);
  flex: 1;
  min-width: 100px;
}

.explore-btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.explore-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.explore-btn-secondary {
  background: var(--bg-secondary, #1f2833);
  color: var(--text-primary, #c5c6c7);
  border: 1px solid rgba(69, 162, 158, 0.25);
  flex: 1;
  min-width: 80px;
}

.explore-btn-secondary:hover {
  background: var(--bg-tertiary, #424242);
}

.explore-btn-link {
  background: none;
  color: #9e9e9e;
  padding: 10px 12px;
  font-weight: 500;
  flex-shrink: 0;
}

.explore-btn-link:hover {
  color: #c5c6c7;
  text-decoration: underline;
}

/* ── Results (inline after voting) ── */

.explore-results {
  animation: fadeInResults 0.3s ease;
}

@keyframes fadeInResults {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.explore-results-header {
  font-size: 14px;
  font-weight: 600;
  color: #e0e0e0;
  margin-bottom: 10px;
}

.explore-result-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 10px;
}

.explore-result-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.explore-result-label {
  font-size: 13px;
  color: var(--text-primary, #c5c6c7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.explore-result-bar-bg {
  width: 100%;
  height: 22px;
  background: var(--bg-tertiary, #424242);
  border-radius: 5px;
  overflow: hidden;
}

.explore-result-bar {
  height: 100%;
  background: #4a8a85;
  border-radius: 5px;
  transition: width 0.5s ease;
  min-width: 2px;
}

.explore-result-value {
  font-size: 13px;
  font-weight: 600;
  color: #e0e0e0;
  flex-shrink: 0;
}

/* ── Loading / Empty ── */

.explore-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 0;
  color: var(--text-primary, #c5c6c7);
  font-size: 14px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

.explore-loading.initial {
  position: absolute;
  inset: 0;
}

.explore-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--bg-tertiary, #424242);
  border-top-color: #c5c6c7;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.explore-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-primary, #c5c6c7);
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

.explore-empty-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.explore-empty-icon {
  font-size: 48px;
  opacity: 0.5;
}

.explore-empty p {
  font-size: 16px;
  opacity: 0.7;
  margin: 0;
}

/* ── End of feed ── */

.explore-end {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 20px 80px;
  color: var(--text-primary, #c5c6c7);
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

.explore-end-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border-top: 1px solid rgba(197, 198, 199, 0.15);
  padding-top: 32px;
  width: 100%;
  max-width: 420px;
}

.explore-end-icon {
  font-size: 40px;
  margin-bottom: 4px;
}

.explore-end-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.explore-end-subtitle {
  font-size: 14px;
  opacity: 0.6;
  margin: 0 0 8px;
  line-height: 1.4;
}

.explore-end-coffee {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 13px;
  color: #c5c6c7;
  opacity: 0.5;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.explore-end-coffee:hover {
  opacity: 0.85;
}

.explore-end-coffee svg {
  flex-shrink: 0;
}

/* ── Light mode ── */

body.light-mode .explore-filter-pill {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.03);
  color: #444;
}

body.light-mode .explore-filter-pill:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.2);
}

body.light-mode .explore-filter-pill.active {
  background: #45a29e;
  color: #fff;
  border-color: #45a29e;
}

body.light-mode .explore-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
}

body.light-mode .explore-legend-dot {
  background: #f5f5f5;
  border-color: #45a29e;
}

body.light-mode .explore-legend-bar {
  background: #45a29e;
}

body.light-mode .explore-slider-fill {
  background: #45a29e;
}

body.light-mode .explore-slider::-webkit-slider-thumb {
  border-color: #45a29e;
}

body.light-mode .explore-slider::-moz-range-thumb {
  border-color: #45a29e;
}

body.light-mode .explore-slider-value {
  color: #444;
}

body.light-mode .explore-btn-primary {
  background: #45a29e;
  color: #fff;
}

body.light-mode .explore-results-header,
body.light-mode .explore-result-value {
  color: #444;
}

body.light-mode .explore-result-bar {
  background: #7ab5b0;
}

body.light-mode .explore-category,
body.light-mode .explore-subcategory {
  color: #666;
  background: rgba(0, 0, 0, 0.06);
}

body.light-mode .explore-btn-link {
  color: #777;
}

body.light-mode .explore-btn-link:hover {
  color: #444;
}

body.light-mode .explore-end {
  color: #333;
}

body.light-mode .explore-end-coffee {
  color: #555;
}

body.light-mode .explore-end-content {
  border-top-color: rgba(0, 0, 0, 0.1);
}

/* ── Responsive ── */

@media (max-width: 768px) {
  .explore-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .explore-filters::-webkit-scrollbar {
    display: none;
  }

  .explore-title {
    font-size: 16px;
  }

  .explore-slider-label {
    font-size: 12px;
  }

  .explore-result-label {
    font-size: 12px;
  }

  .explore-info {
    padding: 10px 12px 4px;
  }

  .explore-voting {
    padding: 8px 12px 16px;
  }
}

@media (max-width: 480px) {
  .explore-media {
    max-height: 35vh;
  }

  .explore-media img {
    max-height: 35vh;
  }

  .explore-slider-label {
    font-size: 11px;
  }

  .explore-result-label {
    font-size: 11px;
  }

  .explore-actions {
    gap: 8px;
  }

  .explore-btn {
    padding: 10px 14px;
    font-size: 13px;
  }
}

