/**
 * Daily Answers Pages Styles
 * Styles for hint pages, answer reveals, and related components
 */

/* ==========================================================================
   Variables
   ========================================================================== */

:root {
  --hint-bg: #f8f9fa;
  --hint-border: #e9ecef;
  --hint-text: #495057;
  --answer-bg: #fff3cd;
  --answer-border: #ffc107;
  --spoiler-bg: #dc3545;
  --spoiler-text: #fff;

  /* Connections colors */
  --connections-yellow: #f9df6d;
  --connections-green: #a0c35a;
  --connections-blue: #b0c4ef;
  --connections-purple: #ba81c5;

  /* Difficulty colors */
  --difficulty-1: #28a745;
  --difficulty-2: #5cb85c;
  --difficulty-3: #f0ad4e;
  --difficulty-4: #fd7e14;
  --difficulty-5: #dc3545;
}

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

.daily-answer-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

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

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

.page-subtitle {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 5px;
}

.puzzle-number {
  font-size: 0.95rem;
  color: #888;
}

/* Breadcrumb */
.breadcrumb {
  padding: 10px 0;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

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

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

.breadcrumb span {
  color: #888;
  margin: 0 8px;
}

/* ==========================================================================
   Answer Box / Card
   ========================================================================== */

.answer-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 25px;
  margin-bottom: 25px;
}

.answer-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.answer-card-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #333;
}

.difficulty-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.difficulty-1 { background: var(--difficulty-1); color: white; }
.difficulty-2 { background: var(--difficulty-2); color: white; }
.difficulty-3 { background: var(--difficulty-3); color: #333; }
.difficulty-4 { background: var(--difficulty-4); color: white; }
.difficulty-5 { background: var(--difficulty-5); color: white; }

/* ==========================================================================
   Hint System
   ========================================================================== */

.hints-section {
  margin-bottom: 25px;
}

.hints-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: #333;
}

.hint-item {
  margin-bottom: 10px;
}

.hint-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--hint-bg);
  border: 1px solid var(--hint-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.hint-button:hover {
  background: #e9ecef;
  border-color: #dee2e6;
}

.hint-button.small {
  padding: 8px 12px;
  font-size: 0.85rem;
}

.hint-label {
  font-weight: 500;
  color: #333;
}

.hint-icon {
  color: #667eea;
  font-size: 0.9rem;
}

.hint-revealed {
  padding: 12px 16px;
  background: #e8f4fd;
  border: 1px solid #b8daff;
  border-radius: 8px;
}

.hint-revealed .hint-label {
  color: #004085;
  margin-right: 8px;
}

.hint-revealed .hint-content {
  color: #004085;
}

.hint-just-revealed {
  animation: fadeIn 0.3s ease;
}

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

/* ==========================================================================
   Answer Reveal
   ========================================================================== */

.answer-reveal-container {
  margin: 20px 0;
}

.answer-hidden {
  text-align: center;
}

.answer-reveal-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 40px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin: 0 auto;
}

.answer-reveal-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.spoiler-warning {
  display: block;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  margin-bottom: 5px;
}

.reveal-text {
  display: block;
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
}

.answer-revealed {
  text-align: center;
  padding: 25px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  border: 2px solid #667eea;
}

.answer-label {
  display: block;
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 8px;
}

.answer-text {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: #333;
  letter-spacing: 0.1em;
  font-family: 'Courier New', monospace;
}

.answer-definition {
  margin-top: 15px;
  font-size: 0.95rem;
  color: #666;
  font-style: italic;
}

.answer-just-revealed {
  animation: answerReveal 0.5s ease;
}

@keyframes answerReveal {
  0% { opacity: 0; transform: scale(0.8); }
  50% { transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   Connections Specific
   ========================================================================== */

.connections-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.connections-word {
  background: #e9ecef;
  padding: 12px 8px;
  text-align: center;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
}

.connections-categories {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.connections-category {
  padding: 15px;
  border-radius: 10px;
  border: 2px solid transparent;
}

.connections-yellow { background: var(--connections-yellow); border-color: #e6c85c; }
.connections-green { background: var(--connections-green); border-color: #8fb34a; }
.connections-blue { background: var(--connections-blue); border-color: #9bb3e0; }
.connections-purple { background: var(--connections-purple); border-color: #a870b5; }

.category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.category-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.category-difficulty {
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
}

.category-hint {
  margin-bottom: 10px;
}

.category-title {
  font-weight: 700;
  font-size: 1rem;
  color: #333;
  margin-bottom: 5px;
}

.category-words {
  font-size: 0.9rem;
  color: #555;
}

/* ==========================================================================
   Strands Specific
   ========================================================================== */

.strands-theme-clue {
  background: #f0f4ff;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  margin-bottom: 20px;
  border-left: 4px solid #667eea;
}

.strands-theme-clue p {
  font-size: 1.2rem;
  font-style: italic;
  color: #333;
  margin: 0;
}

.strands-stats {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 20px;
}

.strands-stat {
  text-align: center;
}

.strands-stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #667eea;
}

.strands-stat-label {
  font-size: 0.85rem;
  color: #666;
}

.strands-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  max-width: 300px;
  margin: 0 auto 20px;
}

.strands-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e9ecef;
  border-radius: 4px;
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
}

.strands-cell.spangram {
  background: #ffd700;
}

.strands-cell.theme-word {
  background: #90EE90;
}

/* ==========================================================================
   Mini Crossword Specific
   ========================================================================== */

.mini-grid-preview {
  display: grid;
  gap: 2px;
  max-width: 250px;
  margin: 0 auto 20px;
  background: #333;
  padding: 2px;
  border-radius: 4px;
}

.mini-grid-preview.size-5 {
  grid-template-columns: repeat(5, 1fr);
}

.mini-grid-preview.size-7 {
  grid-template-columns: repeat(7, 1fr);
}

.mini-cell {
  aspect-ratio: 1;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.2rem;
  position: relative;
}

.mini-cell.black {
  background: #333;
}

.mini-cell .cell-number {
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 0.6rem;
  font-weight: 400;
}

.clues-section {
  margin-bottom: 25px;
}

.clues-section h3 {
  font-size: 1.1rem;
  margin-bottom: 15px;
  color: #333;
  border-bottom: 2px solid #667eea;
  padding-bottom: 8px;
}

.clue-item {
  display: flex;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.clue-number {
  min-width: 30px;
  font-weight: 600;
  color: #667eea;
}

.clue-text {
  flex: 1;
  color: #333;
}

.clue-answer {
  font-family: monospace;
  font-weight: 600;
  color: #28a745;
  margin-left: 10px;
}

.clue-answer.hidden {
  color: #999;
  cursor: pointer;
}

/* ==========================================================================
   Share Component
   ========================================================================== */

.share-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
}

.share-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.2s ease;
}

.share-button:hover {
  background: #5a6fd6;
}

.share-feedback {
  color: #28a745;
  font-size: 0.9rem;
  animation: fadeIn 0.3s ease;
}

.social-share-links {
  display: flex;
  gap: 10px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.2s ease;
}

.social-link:hover {
  transform: scale(1.1);
}

.social-link.twitter {
  background: #000;
  color: white;
}

.social-link.facebook {
  background: #1877f2;
  color: white;
}

.social-link.reddit {
  background: #ff4500;
  color: white;
}

/* ==========================================================================
   Yesterday Section
   ========================================================================== */

.yesterday-section {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 10px;
  margin: 25px 0;
}

.yesterday-section h3 {
  font-size: 1rem;
  color: #666;
  margin-bottom: 15px;
}

.yesterday-answer {
  font-size: 1.3rem;
  font-weight: 600;
  color: #333;
}

.yesterday-link {
  display: inline-block;
  margin-top: 10px;
  color: #667eea;
  text-decoration: none;
}

.yesterday-link:hover {
  text-decoration: underline;
}

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

.seo-content {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid #eee;
}

.seo-content h2 {
  font-size: 1.5rem;
  color: #333;
  margin: 30px 0 15px;
}

.seo-content h3 {
  font-size: 1.2rem;
  color: #444;
  margin: 25px 0 12px;
}

.seo-content p {
  color: #555;
  line-height: 1.7;
  margin-bottom: 15px;
}

.seo-content ul, .seo-content ol {
  margin: 15px 0;
  padding-left: 25px;
}

.seo-content li {
  color: #555;
  line-height: 1.6;
  margin-bottom: 8px;
}

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

.faq-section {
  margin-top: 40px;
}

.faq-section h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.faq-item {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: #f8f9fa;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 1rem;
  font-weight: 500;
  color: #333;
}

.faq-question:hover {
  background: #e9ecef;
}

.faq-icon {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  display: none;
  padding: 15px 20px;
  color: #555;
  line-height: 1.6;
}

.faq-item.open .faq-answer {
  display: block;
}

/* ==========================================================================
   Related Games
   ========================================================================== */

.related-games {
  margin-top: 30px;
}

.related-games h3 {
  font-size: 1.2rem;
  margin-bottom: 15px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.game-card {
  display: block;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 10px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.game-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.game-card-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
}

.game-card-desc {
  font-size: 0.85rem;
  color: #666;
}

/* ==========================================================================
   Loading & Error States
   ========================================================================== */

.loading-state {
  text-align: center;
  padding: 40px;
  color: #666;
}

.loading-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.error-state {
  text-align: center;
  padding: 40px;
  background: #fff5f5;
  border-radius: 10px;
  color: #c53030;
}

.error-state h3 {
  margin-bottom: 10px;
}

.retry-button {
  margin-top: 15px;
  padding: 10px 25px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

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

@media (max-width: 768px) {
  .daily-answer-page {
    padding: 15px;
  }

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

  .answer-text {
    font-size: 2rem;
  }

  .connections-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
  }

  .connections-word {
    padding: 8px 4px;
    font-size: 0.75rem;
  }

  .strands-grid {
    max-width: 250px;
  }

  .strands-stats {
    gap: 20px;
  }

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

@media (max-width: 480px) {
  .answer-card {
    padding: 15px;
  }

  .answer-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .connections-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .mini-grid-preview {
    max-width: 200px;
  }
}
