/**
 * 5-Letter Words Pages Styles
 */

/* ==========================================================================
   Page Layout
   ========================================================================== */

.word-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

.word-page-header {
  text-align: center;
  margin-bottom: 30px;
}

.word-page-header h1 {
  font-size: 2rem;
  color: #333;
  margin-bottom: 8px;
}

.word-page-header .page-intro {
  font-size: 1.05rem;
  color: #666;
  max-width: 650px;
  margin: 0 auto;
}

.word-count-badge {
  display: inline-block;
  background: #667eea;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 20px;
  margin-top: 10px;
}

/* ==========================================================================
   Breadcrumb
   ========================================================================== */

.word-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 20px;
}

.word-breadcrumb a {
  color: #667eea;
  text-decoration: none;
}

.word-breadcrumb a:hover {
  text-decoration: underline;
}

.word-breadcrumb .sep {
  color: #ccc;
}

/* ==========================================================================
   Wordle-Style Word Finder
   ========================================================================== */

.word-finder-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid #e9ecef;
}

.word-finder-card h2 {
  font-size: 1.25rem;
  margin-bottom: 6px;
  color: #333;
  text-align: center;
}

.word-finder-card .wf-instructions {
  text-align: center;
  color: #888;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

/* Wordle Grid */
#wordle-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.wf-row {
  display: flex;
  gap: 6px;
}

.wf-cell {
  width: 56px;
  height: 56px;
  border: 2px solid #d3d6da;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  font-family: 'Inter', -apple-system, sans-serif;
  text-transform: uppercase;
  color: #333;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.1s, background 0.15s, color 0.15s;
}

.wf-cell.wf-filled {
  border-color: #888;
}

.wf-cell.wf-active {
  border-color: #333;
}

.wf-cell.wf-green {
  background: #6aaa64;
  border-color: #6aaa64;
  color: #fff;
}

.wf-cell.wf-yellow {
  background: #c9b458;
  border-color: #c9b458;
  color: #fff;
}

.wf-cell.wf-gray {
  background: #787c7e;
  border-color: #787c7e;
  color: #fff;
}

.wf-actions {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.wf-reset-btn {
  padding: 8px 24px;
  background: #f1f3f5;
  color: #666;
  border: 1px solid #d3d6da;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.wf-reset-btn:hover {
  background: #e9ecef;
}

/* Keyboard */
#wordle-keyboard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}

.wf-kb-row {
  display: flex;
  gap: 5px;
}

.wf-kb-key {
  min-width: 36px;
  height: 52px;
  border: none;
  border-radius: 4px;
  background: #d3d6da;
  color: #333;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: 'Inter', -apple-system, sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  user-select: none;
  transition: background 0.1s, color 0.1s;
}

.wf-kb-key:hover {
  background: #c0c3c6;
}

.wf-kb-key:active {
  transform: scale(0.95);
}

.wf-kb-key.wf-kb-wide {
  min-width: 58px;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
}

.wf-kb-key.wf-green {
  background: #6aaa64;
  color: #fff;
}

.wf-kb-key.wf-yellow {
  background: #c9b458;
  color: #fff;
}

.wf-kb-key.wf-gray {
  background: #787c7e;
  color: #fff;
}

.finder-result-count {
  font-size: 0.9rem;
  color: #888;
  margin-top: 12px;
  text-align: center;
}

.finder-result-count strong {
  color: #667eea;
}

/* ==========================================================================
   Word Grid
   ========================================================================== */

.word-grid-section {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid #e9ecef;
}

.word-grid-section h2 {
  font-size: 1.25rem;
  margin-bottom: 16px;
  color: #333;
}

.word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}

.word-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all 0.15s;
  cursor: default;
}

.word-chip:hover {
  background: #667eea;
  color: #fff;
  border-color: #667eea;
}

.word-grid-more {
  text-align: center;
  margin-top: 16px;
}

.show-more-btn {
  display: inline-block;
  padding: 10px 28px;
  background: #f1f3f5;
  color: #667eea;
  border: 2px solid #667eea;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}

.show-more-btn:hover {
  background: #667eea;
  color: #fff;
}

/* ==========================================================================
   Letter Navigation
   ========================================================================== */

.letter-nav-section {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid #e9ecef;
}

.letter-nav-section h2 {
  font-size: 1.15rem;
  margin-bottom: 14px;
  color: #333;
}

.letter-nav-group {
  margin-bottom: 16px;
}

.letter-nav-group h3 {
  font-size: 0.85rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.letter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.letter-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  color: #667eea;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.15s;
}

.letter-nav a:hover,
.letter-nav a.active {
  background: #667eea;
  color: #fff;
  border-color: #667eea;
}

.letter-nav a .count {
  display: none;
}

/* ==========================================================================
   SEO Content
   ========================================================================== */

.word-content-section {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid #e9ecef;
}

.word-content-section h2 {
  font-size: 1.3rem;
  color: #333;
  margin-bottom: 12px;
}

.word-content-section h3 {
  font-size: 1.1rem;
  color: #444;
  margin: 18px 0 8px;
}

.word-content-section p {
  color: #555;
  margin-bottom: 12px;
}

.word-content-section ul,
.word-content-section ol {
  margin: 8px 0 16px 24px;
  color: #555;
}

.word-content-section li {
  margin-bottom: 6px;
}

.wordle-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  margin-top: 12px;
  transition: opacity 0.2s;
}

.wordle-cta:hover {
  opacity: 0.9;
}

/* ==========================================================================
   FAQ
   ========================================================================== */

.word-faq {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid #e9ecef;
}

.word-faq h2 {
  font-size: 1.3rem;
  margin-bottom: 16px;
}

.faq-item {
  border-bottom: 1px solid #eee;
  padding: 14px 0;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item h3 {
  font-size: 1rem;
  color: #333;
  margin-bottom: 6px;
  cursor: pointer;
}

.faq-item p {
  color: #555;
  font-size: 0.95rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
  .word-page {
    padding: 14px;
  }

  .word-page-header h1 {
    font-size: 1.5rem;
  }

  .word-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  }

  .letter-nav a {
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
  }

  .word-content-section,
  .word-faq {
    padding: 20px;
  }

  /* Wordle grid responsive */
  .wf-cell {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }

  .wf-kb-key {
    min-width: 30px;
    height: 46px;
    font-size: 0.75rem;
  }

  .wf-kb-key.wf-kb-wide {
    min-width: 48px;
    font-size: 0.6rem;
  }
}

@media (max-width: 480px) {
  .word-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .word-chip {
    font-size: 0.8rem;
    padding: 6px 4px;
    letter-spacing: 1px;
  }

  .wf-cell {
    width: 42px;
    height: 42px;
    font-size: 1.3rem;
  }

  .wf-row {
    gap: 4px;
  }

  .wf-kb-row {
    gap: 3px;
  }

  .wf-kb-key {
    min-width: 26px;
    height: 42px;
    font-size: 0.7rem;
  }

  .wf-kb-key.wf-kb-wide {
    min-width: 42px;
  }
}
