/* ===== ANECDOTES UNIQUE STYLES ===== */

/* Anecdotes Hero */
.anecdotes-hero {
  text-align: center;
  padding: 3rem 1rem;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
}

.anecdotes-hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.anecdotes-hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Anecdotes Link */

.anecdote-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.anecdote-link .anecdote-card {
  transition: all 0.3s ease;
  cursor: pointer;
}

.anecdote-link:hover .anecdote-card {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.anecdote-link:hover .anecdote-card::before {
  opacity: 1;
}

.anecdote-link .read-more {
  display: inline-flex;
  align-items: center;
  color: var(--primary-color);
  font-weight: 600;
  transition: gap 0.3s ease;
}

/* Anecdotes Grid */
.anecdotes-grid {
  display: grid;
  gap: 1.5rem;
  padding: 1rem 0 2rem;
}

.anecdote-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.anecdote-card:nth-child(1) {
  animation-delay: 0.05s;
}

.anecdote-card:nth-child(2) {
  animation-delay: 0.10s;
}

.anecdote-card:nth-child(3) {
  animation-delay: 0.15s;
}

.anecdote-card:nth-child(4) {
  animation-delay: 0.20s;
}

.anecdote-card:nth-child(5) {
  animation-delay: 0.25s;
}

.anecdote-card:nth-child(6) {
  animation-delay: 0.30s;
}

.anecdote-card:nth-child(7) {
  animation-delay: 0.35s;
}

.anecdote-card:nth-child(8) {
  animation-delay: 0.40s;
}

.anecdote-card:nth-child(9) {
  animation-delay: 0.45s;
}

.anecdote-card:nth-child(10) {
  animation-delay: 0.50s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.anecdote-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.anecdote-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.anecdote-card:hover::before {
  opacity: 1;
}

.anecdote-card .anecdote-preview {
  color: var(--text-primary);
  line-height: 1.8;
  font-size: 1rem;
}

.anecdote-card .anecdote-preview .highlight {
  color: var(--primary-color);
  font-weight: 600;
}

.anecdote-card .read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  transition: gap 0.3s ease;
}

.anecdote-card .anecdote-number {
  position: absolute;
  top: 0.75rem;
  right: 1.25rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  opacity: 0.5;
  font-weight: 600;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 1.5rem 0;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.pagination a:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.pagination .active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.pagination .prev-next {
  min-width: 60px;
}

/* Anecdote Detail Page */


.anecdote-detail .anecdote-text {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  font-size: 1.1rem;
  color: var(--text-primary);
  word-wrap: break-word;
}

.anecdote-detail .anecdote-text p {
  margin: 0.75rem;
}

.anecdote-detail .anecdote-meaning {
  font-style: italic;
  color: var(--text-secondary);
}

/* Translation Toggle */
.translation-container {
  margin-top: 1.5rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.translation-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 1.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  transition: background 0.2s ease;
  gap: 0.75rem;
}

.translation-toggle:hover {
  background: var(--bg-tertiary);
}

.translation-toggle .toggle-icon {
  transition: transform 0.3s ease;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.translation-toggle .toggle-icon.open {
  transform: rotate(180deg);
}

.translation-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
  padding: 0 1.5rem;
}

.translation-content.open {
  max-height: 2000px;
  padding: 0 1.5rem 1.5rem;
}

.translation-content .translation-text {
  color: var(--text-secondary);
  line-height: 1.8;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  font-size: 1rem;
}

.translation-content .translation-text p {
  margin-bottom: 0.75rem;
}

/* Navigation between anecdotes */
.anecdote-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.anecdote-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.anecdote-nav a:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.anecdote-nav .back-link {
  background: transparent;
  border: none;
  color: var(--text-secondary);
}

.anecdote-nav .back-link:hover {
  background: transparent;
  color: var(--primary-color);
  transform: none;
}

.anecdote-nav div {
  display: flex;
  gap: 0.5rem;
}

/* Description section */
.section-description .content-card {
  padding: 2rem;
  margin-top: 2rem;
}

.section-description .content-card h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.section-description .content-card p {
  color: var(--text-secondary);
  line-height: 1.8;
}

/* Share section */
.anecdote-share-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.anecdote-share-section span {
  color: var(--text-secondary);
  font-weight: 500;
}

.anecdote-share-section button {
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
}

/* Search highlight in anecdotes */
.search-highlight {
  background: var(--warning-color);
  padding: 0 0.25rem;
  border-radius: 2px;
}

[data-theme="dark"] .search-highlight {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Share button */
.share-btn {
  cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
  .anecdotes-hero h1 {
    font-size: 1.75rem;
  }

  .anecdotes-hero p {
    font-size: 1rem;
  }

  .anecdote-card {
    padding: 1.25rem;
  }

  .anecdote-card .anecdote-preview {
    font-size: 0.95rem;
  }

  .anecdote-detail .anecdote-text {
    padding: 1.5rem;
    font-size: 1rem;
  }

  .translation-toggle {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  .translation-content {
    padding: 0 1rem;
  }

  .translation-content.open {
    padding: 0 1rem 1rem;
  }

  .anecdote-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .anecdote-nav a {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
  }

  .pagination a,
  .pagination span {
    min-width: 36px;
    height: 36px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .anecdotes-hero h1 {
    font-size: 1.5rem;
  }

  .anecdote-card {
    padding: 1rem;
  }

  .anecdote-card .anecdote-number {
    display: none;
  }

  .anecdote-detail .anecdote-text {
    padding: 1rem;
    font-size: 0.95rem;
    line-height: 1.8;
  }
}

/* Print Styles for Anecdotes */
@media print {

  .anecdote-card .read-more,
  .anecdote-nav,
  .translation-toggle,
  .share-btn {
    display: none !important;
  }

  .translation-content {
    max-height: none !important;
    padding: 1rem 0 !important;
  }

  .translation-content .translation-text {
    border-top: 1px solid #ccc;
    padding-top: 1rem;
  }

  .anecdote-card {
    break-inside: avoid;
    border: 1px solid #ccc !important;
    animation: none !important;
    opacity: 1 !important;
  }

  .pagination {
    display: none !important;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

  .anecdote-card,
  .anecdote-card::before,
  .anecdote-card .read-more,
  .translation-content,
  .translation-toggle .toggle-icon,
  .pagination a,
  .anecdote-nav a {
    transition: none !important;
    animation: none !important;
  }

  .anecdote-card {
    opacity: 1 !important;
  }
}