/* =========================================
   UIverse — Explore & Detail Styles
   ========================================= */

/* ═══════════════════════════════════════════
   EXPLORE HERO / SEARCH
   ═══════════════════════════════════════════ */

.explore-hero {
  position: relative;
  padding: calc(var(--header-height) + 48px) 24px 0;
  overflow: hidden;
}

.explore-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

.explore-hero__gradient {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.25;
}

.explore-hero__gradient--1 {
  width: 500px;
  height: 500px;
  background: var(--color-gradient-1);
  top: -200px;
  left: -100px;
  animation: floatBlob 12s ease-in-out infinite;
}

.explore-hero__gradient--2 {
  width: 400px;
  height: 400px;
  background: var(--color-gradient-2);
  top: -100px;
  right: -100px;
  animation: floatBlob 15s ease-in-out infinite reverse;
}

@keyframes floatBlob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

.explore-hero__content {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
}

.explore-hero__title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -1px;
  text-align: center;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fff 40%, var(--color-text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.explore-hero__subtitle {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 1rem;
  margin-bottom: 32px;
}

/* ═══════════════════════════════════════════
   SEARCH BOX
   ═══════════════════════════════════════════ */

.explore-search {
  max-width: 680px;
  margin: 0 auto 28px;
  position: relative;
}

.explore-search__box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-hover);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  transition: all 0.25s ease;
}

.explore-search__box:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(255, 45, 85, 0.15), 0 8px 30px rgba(0, 0, 0, 0.25);
}

.explore-search__icon {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  flex-shrink: 0;
}

.explore-search__input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--color-text);
  font-size: 0.95rem;
  font-family: var(--font-family);
}

.explore-search__input::placeholder {
  color: var(--color-text-muted);
}

.explore-search__shortcuts kbd {
  padding: 3px 8px;
  font-size: 0.7rem;
  font-family: var(--font-family);
  font-weight: 600;
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

.explore-search__clear {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--color-text-muted);
  transition: all 0.2s;
}

.explore-search__clear:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text);
}

/* Search Dropdown */
.explore-search__dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-hover);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  z-index: 100;
  display: none;
  overflow: hidden;
  max-height: 400px;
  overflow-y: auto;
}

.explore-search__dropdown.active {
  display: block;
  animation: dropdownIn 0.2s ease;
}

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

.search-suggestion {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: none;
}

.search-suggestion:last-child {
  border-bottom: none;
}

.search-suggestion:hover,
.search-suggestion.focused {
  background: rgba(255, 45, 85, 0.08);
}

.search-suggestion__icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.search-suggestion__icon--element {
  background: rgba(255, 45, 85, 0.12);
  color: var(--color-primary-light);
}

.search-suggestion__icon--tag {
  background: rgba(0, 212, 255, 0.12);
  color: var(--color-accent);
}

.search-suggestion__icon--category {
  background: rgba(0, 212, 255, 0.12);
  color: var(--color-secondary);
}

.search-suggestion__text {
  flex: 1;
  min-width: 0;
}

.search-suggestion__name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-suggestion__type {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: capitalize;
}

.search-suggestion__thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  background: rgba(255, 45, 85, 0.08);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   CATEGORY FILTERS
   ═══════════════════════════════════════════ */

.explore-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}

.explore-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-family);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.explore-filter:hover {
  color: #fff;
  background: rgba(255, 45, 85, 0.18);
  border-color: rgba(255, 45, 85, 0.45);
  box-shadow: 0 0 14px rgba(255, 45, 85, 0.2);
}

.explore-filter.active {
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border-color: transparent;
  box-shadow: 0 2px 12px rgba(255, 45, 85, 0.3);
}

.explore-filter i {
  font-size: 0.75rem;
}

/* ═══════════════════════════════════════════
   SORT BAR
   ═══════════════════════════════════════════ */

.explore-sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 24px;
  border-top: none;
  position: relative;
  margin-top: 8px;
}
.explore-sort-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 5%;
  width: 90%;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.08) 30%, rgba(255,255,255,0.08) 70%, transparent);
}

.explore-sort-bar__info {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.explore-sort-select {
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-family);
  outline: none;
  transition: border-color 0.2s;
}

.explore-sort-select:focus {
  border-color: var(--color-primary);
}

.explore-sort-select option {
  background: var(--color-bg-card);
  color: var(--color-text);
}

/* ═══════════════════════════════════════════
   ELEMENTS GRID
   ═══════════════════════════════════════════ */

.explore-grid-section {
  padding: 0 24px 60px;
}

.explore-grid-container {
  max-width: 1400px;
  margin: 0 auto;
}

.explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* Element Card */
.el-card {
  background: rgba(22, 22, 31, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  animation: cardFadeIn 0.4s ease forwards;
  opacity: 0;
  transform: translateY(20px);
}

@keyframes cardFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.el-card:hover {
  border-color: var(--color-border-hover);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3), 0 0 60px rgba(255, 45, 85, 0.06);
  transform: translateY(-4px);
}

.el-card__preview {
  position: relative;
  height: 220px;
  background: var(--color-bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: none;
}

.el-card__preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none;
  background: var(--color-bg);
  transition: transform 0.3s ease;
}

.el-card:hover .el-card__preview-iframe {
  pointer-events: auto;
}

.el-card__preview-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.el-card__preview-fallback {
  font-size: 3rem;
  color: rgba(255, 45, 85, 0.2);
}

.el-card__overlay {
  display: none;
}

.el-card__view-btn {
  display: none;
}

.el-card__body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.el-card__name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.el-card__desc {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.el-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: none;
}

.el-card__category {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
  color: var(--color-primary-light);
  background: rgba(255, 45, 85, 0.1);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.el-card__stats {
  display: flex;
  align-items: center;
  gap: 14px;
}

.el-card__stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.el-card__stat i {
  font-size: 0.7rem;
}

/* Loading skeleton */
.el-card--skeleton {
  animation: none;
  opacity: 1;
  transform: none;
}

.el-card--skeleton .el-card__preview {
  background: linear-gradient(90deg, var(--color-bg-card) 25%, var(--color-bg-card-hover) 50%, var(--color-bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-line {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--color-bg-card) 25%, var(--color-bg-card-hover) 50%, var(--color-bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-line--short { width: 60%; }
.skeleton-line--long { width: 90%; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════
   LOAD MORE
   ═══════════════════════════════════════════ */

.explore-load-more {
  text-align: center;
  padding: 40px 0 20px;
}

.explore-load-more__btn {
  padding: 14px 36px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-hover);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-family);
}

.explore-load-more__btn:hover {
  background: rgba(255, 45, 85, 0.08);
  border-color: var(--color-primary);
  box-shadow: 0 4px 20px rgba(255, 45, 85, 0.15);
  transform: translateY(-2px);
}

/* Scroll Loader (infinite scroll spinner) */
.explore-scroll-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.explore-scroll-loader__spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ═══════════════════════════════════════════
   SCROLL-TO-TOP BUTTON
   ═══════════════════════════════════════════ */

.scroll-top-btn {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff;
  font-size: 1rem;
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(255, 45, 85, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 999;
  border: none;
}

.scroll-top-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 28px rgba(255, 45, 85, 0.55);
}

/* ═══════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════ */

.explore-empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--color-text-muted);
}

.explore-empty i {
  font-size: 3.5rem;
  margin-bottom: 20px;
  opacity: 0.3;
}

.explore-empty h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}

.explore-empty p {
  margin-bottom: 24px;
}

.explore-empty__reset {
  padding: 10px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-family);
  transition: all 0.2s;
}

.explore-empty__reset:hover {
  box-shadow: 0 4px 20px rgba(255, 45, 85, 0.35);
  transform: translateY(-2px);
}


/* ═══════════════════════════════════════════════
   ═══════════════════════════════════════════════
   ELEMENT DETAIL PAGE
   ═══════════════════════════════════════════════
   ═══════════════════════════════════════════════ */

.detail-page {
  padding: calc(var(--header-height) + 24px) 24px 60px;
  max-width: 1280px;
  margin: 0 auto;
}

.detail-topbar {
  margin-bottom: 28px;
}

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.detail-back:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.05);
}

/* Loading */
.detail-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 24px;
  gap: 16px;
  color: var(--color-text-muted);
}

.detail-loading__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Error */
.detail-error {
  text-align: center;
  padding: 100px 24px;
  color: var(--color-text-muted);
}

.detail-error i {
  font-size: 3rem;
  margin-bottom: 16px;
  color: #ef4444;
  opacity: 0.6;
}

.detail-error h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}

.detail-error__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 10px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.detail-error__btn:hover {
  box-shadow: 0 4px 20px rgba(255, 45, 85, 0.35);
  transform: translateY(-2px);
}

/* Detail Content Animation */
.detail-content {
  animation: fadeInUp 0.5s ease;
}

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

/* Header Info */
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 32px;
}

.detail-header__info {
  flex: 1;
  min-width: 0;
}

.detail-header__title {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 900;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.detail-header__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-header__category {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: capitalize;
  color: var(--color-primary-light);
  background: rgba(255, 45, 85, 0.12);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.detail-header__author,
.detail-header__date {
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.detail-header__author i,
.detail-header__date i {
  margin-right: 4px;
}

.detail-header__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.detail-tag {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 10px;
  background: rgba(0, 212, 255, 0.08);
  color: var(--color-accent);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: var(--radius-full);
  transition: all 0.2s;
}

.detail-tag:hover {
  background: rgba(0, 212, 255, 0.15);
  border-color: rgba(0, 212, 255, 0.3);
}

.detail-header__desc {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* Stats */
.detail-header__stats {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.detail-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

button.detail-stat {
  cursor: pointer;
  font-family: var(--font-family);
}

button.detail-stat--like:hover {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.06);
}

button.detail-stat--like.liked {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.1);
  animation: likedPulse 0.4s ease;
}

@keyframes likedPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Preview + Code Side by Side */
.detail-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 32px;
}

.detail-split .detail-preview-card {
  margin-bottom: 0;
  position: sticky;
  top: calc(var(--header-height) + 20px);
}

.detail-split .detail-code-section {
  margin-bottom: 0;
  max-height: calc(100vh - var(--header-height) - 40px);
  display: flex;
  flex-direction: column;
}

.detail-split .detail-code-section .detail-code-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.detail-split .detail-code-section .detail-code {
  flex: 1;
  max-height: 400px;
  overflow-y: auto;
}

@media (max-width: 1024px) {
  .detail-split {
    grid-template-columns: 1fr;
  }
  .detail-split .detail-preview-card {
    position: static;
  }
  .detail-split .detail-code-section {
    max-height: none;
  }
  .detail-split .detail-code-section .detail-code {
    max-height: none;
  }
}

/* Preview Card */
.detail-preview-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.detail-preview-card__header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-preview-card__header h3 {
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-secondary);
}

.detail-preview-card__actions {
  display: flex;
  gap: 6px;
}

.detail-preview-card__action {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  transition: all 0.2s;
  cursor: pointer;
  background: none;
  border: 1px solid var(--color-border);
  font-family: var(--font-family);
}

.detail-preview-card__action:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--color-border-hover);
}

.detail-preview-bg-picker {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  background: none;
  border: 1px solid var(--color-border);
  position: relative;
  transition: all 0.2s;
}

.detail-preview-bg-picker:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--color-border-hover);
}

.detail-preview-bg-picker input[type="color"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  border: none;
}

.detail-preview {
  min-height: 300px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.detail-preview iframe {
  width: 100% !important;
  border: none;
  border-radius: 0;
  display: block;
}

/* Code Section */
.detail-code-section {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.detail-code-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
}

.detail-code-tab {
  padding: 12px 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  position: relative;
  font-family: var(--font-family);
  border-bottom: 2px solid transparent;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.detail-code-tab:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.03);
}

.detail-code-tab.active {
  color: var(--color-primary-light);
  border-bottom-color: var(--color-primary);
}

.detail-code-panel {
  display: none;
}

.detail-code-panel.active {
  display: block;
}

.detail-code-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(8, 8, 20, 0.9);
  border-bottom: none;
  position: relative;
}
.detail-code-panel__header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.08) 20%, rgba(255,255,255,0.08) 80%, transparent);
}

.detail-code-panel__header span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-code-copy {
  padding: 5px 12px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  font-family: var(--font-family);
  border: none;
}

.detail-code-copy:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text);
}

.detail-code {
  margin: 0;
  padding: 16px;
  background: rgba(8, 8, 20, 0.9);
  overflow-x: auto;
}

.detail-code code {
  font-family: 'Fira Code', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
  white-space: pre;
  tab-size: 2;
}

.detail-copy-all {
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.detail-copy-all__btn {
  padding: 10px 28px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary), #cc0040);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-family);
  transition: all 0.2s;
  box-shadow: 0 2px 12px rgba(255, 45, 85, 0.3);
  border: none;
}

.detail-copy-all__btn:hover {
  box-shadow: 0 4px 20px rgba(255, 45, 85, 0.45);
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════
   RELATED ELEMENTS
   ═══════════════════════════════════════════ */

.detail-related {
  margin-top: 48px;
  padding-top: 32px;
  position: relative;
}

.detail-related::before {
  content: '';
  position: absolute;
  top: 0;
  left: 5%;
  width: 90%;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255, 45, 85, 0.3) 30%, rgba(0, 212, 255, 0.3) 70%, transparent);
}

.detail-related__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.detail-related__title {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 0;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, #fff 40%, var(--color-text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.detail-related__view-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-primary-light);
  transition: all 0.2s;
}

.detail-related__view-all:hover {
  color: var(--color-primary);
  gap: 10px;
}

.detail-related__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.detail-related__grid .el-card {
  opacity: 0;
  transform: translateY(16px);
  animation: relatedCardIn 0.4s ease forwards;
}

.detail-related__grid .el-card:nth-child(1) { animation-delay: 0s; }
.detail-related__grid .el-card:nth-child(2) { animation-delay: 0.06s; }
.detail-related__grid .el-card:nth-child(3) { animation-delay: 0.12s; }
.detail-related__grid .el-card:nth-child(4) { animation-delay: 0.18s; }
.detail-related__grid .el-card:nth-child(5) { animation-delay: 0.24s; }
.detail-related__grid .el-card:nth-child(6) { animation-delay: 0.3s; }

@keyframes relatedCardIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.detail-related__grid .el-card__preview {
  height: 160px;
}

/* ═══════════════════════════════════════════
   COMMENTS SECTION
   ═══════════════════════════════════════════ */

.detail-comments-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
}

.detail-comments-header {
  margin-bottom: 24px;
}

.detail-comments-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.3px;
}

.detail-comments-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  background: rgba(255, 45, 85, 0.15);
  color: var(--color-primary);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Comment Form */
.detail-comment-form {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  animation: slideUp 0.3s ease;
}

.detail-comment-form__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.detail-comment-form__input-wrapper {
  flex: 1;
}

.detail-comment-form__input {
  width: 100%;
  padding: 12px 16px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 80px;
  transition: all 0.2s ease;
}

.detail-comment-form__input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(255, 45, 85, 0.1);
}

.detail-comment-form__input::placeholder {
  color: var(--color-text-muted);
}

.detail-comment-form__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.detail-comment-form__counter {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.detail-comment-form__btn {
  padding: 10px 20px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.detail-comment-form__btn:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 45, 85, 0.3);
}

.detail-comment-form__btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Login Prompt */
.detail-comment-login {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 32px;
  text-align: center;
  color: var(--color-text-muted);
}

.detail-comment-login i {
  font-size: 1.5rem;
  color: var(--color-primary);
}

.detail-comment-login a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

.detail-comment-login a:hover {
  text-decoration: underline;
}

/* Comments List */
.detail-comments-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-comment {
  display: flex;
  gap: 12px;
  animation: slideUp 0.3s ease;
}

.detail-comment__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.detail-comment__content {
  flex: 1;
  min-width: 0;
}

.detail-comment__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.detail-comment__author {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--color-text);
}

.detail-comment__time {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.detail-comment__edited {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-style: italic;
}

.detail-comment__text {
  color: var(--color-text-secondary);
  line-height: 1.6;
  font-size: 0.9375rem;
  margin-bottom: 8px;
  word-wrap: break-word;
}

.detail-comment__actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.detail-comment__action {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.detail-comment__action:hover {
  background: var(--color-bg-card);
  color: var(--color-primary);
}

.detail-comment__action--danger:hover {
  color: #ef4444;
}

/* Empty State */
.detail-comments-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  color: var(--color-text-muted);
  text-align: center;
}

.detail-comments-empty i {
  font-size: 3rem;
  opacity: 0.4;
}

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

/* Toast */
.detail-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 24px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-hover);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transition: all 0.35s ease;
  pointer-events: none;
}

.detail-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}


/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 900px) {
  .explore-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
  }

  .detail-header {
    flex-direction: column;
  }

  .detail-header__stats {
    width: 100%;
    justify-content: flex-start;
  }

  .detail-preview {
    min-height: 200px;
    padding: 24px;
  }

  .detail-related__grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .scroll-top-btn {
    bottom: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 600px) {
  .explore-hero {
    padding-top: calc(var(--header-height) + 28px);
  }

  .explore-grid {
    grid-template-columns: 1fr;
  }

  .explore-filters {
    gap: 6px;
  }

  .explore-filter {
    padding: 6px 12px;
    font-size: 0.78rem;
  }

  .detail-page {
    padding-left: 16px;
    padding-right: 16px;
  }

  .detail-code-tab {
    padding: 12px 14px;
    font-size: 0.8rem;
  }

  .detail-code code {
    font-size: 0.78rem;
  }

  .detail-header__stats {
    flex-wrap: wrap;
  }

  .detail-related__grid {
    grid-template-columns: 1fr;
  }
}
