/* ===== Tags Overview ===== */
.page-tags {
  padding: 2rem 4rem 4rem;
  overflow: visible;
}

.page-tags .tags-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  text-align: center;
}

.page-tags .tags-overview {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0;
  padding-top: 1rem;
}

.page-tags .tag-card {
  padding: 1.25rem 1.5rem;
  border-radius: 0.75rem;
  cursor: pointer;
  color: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.658);
  transition: transform 0.12s ease, filter 0.12s ease;
  max-width: 20rem;
  text-align: left;
  margin: 1rem 0;
}

.page-tags .tag-card h3 {
  margin: 0 0 0.35rem 0;
  font-size: 1.2rem;
}

.page-tags .tag-card p {
  margin-top: 1rem;
  font-size: 1rem;
  opacity: 0.9;
}

.page-tags .tag-card:hover {
  transform: scale(1.1);
  filter: brightness(1.2);
  z-index: 10;
}

/* ===== Tag Detail Page ===== */
.page-tag-detail {
  padding: 3rem 4rem;
  background-color: var(--tag-color, var(--color-surface));
  min-height: 100vh;
  border-radius: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-sizing: border-box;
  max-width: 1200px;
  margin: 0 auto;
}

/* Header */
.page-tag-detail .tag-detail-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--color-on-primary);
}

.page-tag-detail .back-button {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: none;
  background-color: rgba(255, 255, 255, 0.25);
  color: white;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s ease;
  margin-bottom: 0.5rem;
}

.page-tag-detail .back-button:hover {
  background-color: rgba(255, 255, 255, 0.4);
}

.page-tag-detail .tag-title {
  margin: 0 0 1rem 0;
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
}

.page-tag-detail .tag-info-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-left: 1rem;
}

.page-tag-detail .tag-desc {
  margin: 0;
  padding: 1.25rem 1.5rem;
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--color-on-background);
  background-color: var(--color-background);
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.page-tag-detail .tag-bonus {
  margin: 0;
  padding: 1rem 1.5rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-on-background);
  background-color: var(--color-background);
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.page-tag-detail .tag-score::before {
  font-size: 1.3rem;
}

/* Levels container (scrollable) */
.page-tag-detail .levels-container {
  background-color: var(--color-background);
  color: var(--color-on-background);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  max-height: 60vh;
  overflow-y: auto;
}

.page-tag-detail .levels-container::-webkit-scrollbar {
  width: 10px;
}

.page-tag-detail .levels-container::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
}

.page-tag-detail .levels-container::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.5);
}

.page-tag-detail .levels-container h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  font-weight: 700;
}

/* Levels table */
.page-tag-detail .list.tag-detail-list {
  width: 100%;
  border-collapse: collapse;
}

.page-tag-detail .list.tag-detail-list tr {
  transition: background-color 0.15s ease;
}

.page-tag-detail .list.tag-detail-list tr:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

.page-tag-detail .list.tag-detail-list tr td {
  padding: 1rem 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  vertical-align: middle;
}

.page-tag-detail .list.tag-detail-list tr:last-child td {
  border-bottom: none;
}

.page-tag-detail .list.tag-detail-list td.level {
  width: 70%;
}

.page-tag-detail .list.tag-detail-list td.author {
  font-size: 1rem;
  color: var(--color-text-secondary, #666);
  font-weight: 500;
}

.page-tag-detail .list-level-btn {
  display: block;
  width: 100%;
  text-align: start;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: none;
  background-color: transparent;
  color: var(--color-on-background);
  cursor: pointer;
  font-weight: 600;
  font-size: 1.1rem;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.page-tag-detail .list-level-btn:hover {
  background-color: var(--color-background-hover, rgba(0, 0, 0, 0.05));
  transform: translateX(4px);
}

.page-tag-detail .list-level-btn:active {
  transform: translateX(4px) scale(0.98);
}

/* Responsive */
@media (max-width: 900px) {
  .page-tags {
    padding: 1.5rem;
  }

  .page-tags .tags-header {
    margin-bottom: 1.5rem;
  }

  .page-tags .tags-overview {
    padding-top: 1rem;
  }

  .page-tag-detail {
    padding: 2rem;
    border-radius: 0;
  }

  .page-tag-detail .tag-title {
    font-size: 2rem;
  }

  .page-tag-detail .tag-desc,
  .page-tag-detail .tag-score {
    font-size: 1rem;
    padding: 1rem;
  }

  .page-tag-detail .levels-container {
    padding: 1.5rem;
    max-height: 50vh;
  }

  .page-tag-detail .list.tag-detail-list tr td {
    padding: 0.75rem 0.5rem;
  }

  .page-tag-detail .list-level-btn {
    font-size: 1rem;
    padding: 0.6rem 0.8rem;
  }

  .page-tag-detail .list.tag-detail-list td.author {
    font-size: 0.9rem;
  }
}