/* Gospel Hall Hub - Extras Page Styles */
/* Jokes, Memes, Trivia, and Games */

/* ========== CONTAINER ========== */
.extras-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px 20px 100px 20px;
  min-height: 100vh;
}

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

.extras-title {
  font-size: 32px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 8px;
}

.extras-subtitle {
  color: #6b7280;
  font-size: 16px;
}

/* ========== NAVIGATION ========== */
.extras-nav {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.extras-nav-btn {
  padding: 12px 24px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: white;
  color: #6b7280;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.extras-nav-btn:hover {
  border-color: #3b82f6;
  color: #3b82f6;
  transform: translateY(-2px);
}

.extras-nav-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* ========== SECTIONS ========== */
.extras-section {
  display: none;
}

.extras-section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.extras-section.hidden {
  display: none;
}

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

.section-header h2 {
  font-size: 24px;
  color: #1f2937;
  margin-bottom: 15px;
}

/* ========== JOKES ========== */
.joke-filters {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.joke-filter-btn {
  padding: 8px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  background: white;
  color: #6b7280;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.joke-filter-btn:hover {
  border-color: #3b82f6;
  color: #3b82f6;
}

.joke-filter-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

.jokes-container {
  max-width: 600px;
  margin: 0 auto;
}

.joke-card {
  background: white;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  text-align: center;
  margin-bottom: 20px;
}

.joke-category {
  display: inline-block;
  padding: 4px 12px;
  background: #dbeafe;
  color: #1e40af;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.joke-setup {
  font-size: 22px;
  color: #1f2937;
  margin-bottom: 20px;
  line-height: 1.4;
}

.joke-punchline {
  font-size: 20px;
  color: #3b82f6;
  font-weight: 600;
  margin-top: 20px;
  padding: 20px;
  background: #f0f9ff;
  border-radius: 12px;
  opacity: 1;
  transition: all 0.3s ease;
}

.joke-punchline.hidden {
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.reveal-joke-btn {
  padding: 12px 30px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 10px;
}

.reveal-joke-btn:hover {
  background: #2563eb;
  transform: translateY(-2px);
}

.next-joke-btn {
  display: block;
  margin: 20px auto;
  padding: 14px 32px;
  background: #10b981;
  color: white;
  border: none;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.next-joke-btn:hover {
  background: #059669;
  transform: translateY(-2px);
}

/* ========== MEMES ========== */
.meme-filters {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.meme-filter-btn {
  padding: 8px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  background: white;
  color: #6b7280;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.meme-filter-btn:hover {
  border-color: #8b5cf6;
  color: #8b5cf6;
}

.meme-filter-btn.active {
  background: #8b5cf6;
  border-color: #8b5cf6;
  color: white;
}

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

.meme-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.meme-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.meme-image {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
}

.meme-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.meme-card:hover .meme-image img {
  transform: scale(1.05);
}

.meme-info {
  padding: 15px;
}

.meme-category {
  display: inline-block;
  padding: 3px 10px;
  background: #ede9fe;
  color: #7c3aed;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.meme-info h4 {
  font-size: 15px;
  color: #1f2937;
  margin: 0;
  line-height: 1.3;
}

/* Meme Modal */
.meme-full img {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  border-radius: 12px;
}

.meme-details {
  padding: 20px;
  text-align: center;
}

.meme-details h2 {
  margin-top: 15px;
  color: #1f2937;
}

.meme-details p {
  color: #6b7280;
  margin-top: 10px;
}

/* ========== TRIVIA ========== */
.trivia-subtitle {
  color: #6b7280;
  font-size: 14px;
}

.trivia-container {
  max-width: 600px;
  margin: 0 auto;
}

.trivia-start {
  text-align: center;
  padding: 40px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.trivia-icon {
  font-size: 60px;
  margin-bottom: 20px;
}

.trivia-start h3 {
  font-size: 22px;
  color: #1f2937;
  margin-bottom: 10px;
}

.trivia-start p {
  color: #6b7280;
  margin-bottom: 25px;
}

.start-trivia-btn {
  padding: 14px 40px;
  background: #f59e0b;
  color: white;
  border: none;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.start-trivia-btn:hover {
  background: #d97706;
  transform: translateY(-2px);
}

.trivia-question {
  background: white;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.question-number {
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 20px;
  text-align: center;
}

.question-text {
  font-size: 20px;
  color: #1f2937;
  font-weight: 600;
  margin-bottom: 25px;
  line-height: 1.5;
  text-align: center;
}

.answer-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trivia-option {
  padding: 15px 20px;
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 15px;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.trivia-option:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}

.trivia-option.correct {
  background: #d1fae5;
  border-color: #10b981;
  color: #065f46;
}

.trivia-option.incorrect {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}

.trivia-option:disabled {
  cursor: not-allowed;
}

.trivia-feedback {
  text-align: center;
  padding: 15px;
  border-radius: 12px;
  margin-top: 20px;
  font-weight: 600;
}

.trivia-feedback.correct-feedback {
  background: #d1fae5;
  color: #065f46;
}

.trivia-feedback.incorrect-feedback {
  background: #fee2e2;
  color: #991b1b;
}

.next-question-btn {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.next-question-btn:hover {
  background: #2563eb;
}

.trivia-results {
  text-align: center;
  padding: 40px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.results-icon {
  font-size: 60px;
  margin-bottom: 20px;
}

.trivia-results h3 {
  font-size: 24px;
  color: #1f2937;
  margin-bottom: 20px;
}

.score-display {
  font-size: 28px;
  color: #3b82f6;
  font-weight: 700;
  margin-bottom: 15px;
}

.score-message {
  font-size: 18px;
  color: #6b7280;
  margin-bottom: 25px;
}

.restart-trivia-btn {
  padding: 14px 40px;
  background: #10b981;
  color: white;
  border: none;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.restart-trivia-btn:hover {
  background: #059669;
  transform: translateY(-2px);
}

/* ========== GAMES ========== */
.games-subtitle {
  color: #6b7280;
  font-size: 14px;
}

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

.game-card {
  background: white;
  border-radius: 16px;
  padding: 25px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.game-icon {
  font-size: 50px;
  margin-bottom: 15px;
}

.game-card h3 {
  font-size: 18px;
  color: #1f2937;
  margin-bottom: 8px;
}

.game-card p {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 15px;
}

.play-game-btn {
  padding: 10px 25px;
  background: #8b5cf6;
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.play-game-btn:hover {
  background: #7c3aed;
  transform: translateY(-2px);
}

/* ========== GAME MODAL ========== */
.game-modal-content {
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
}

.game-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
}

.game-modal-header h3 {
  margin: 0;
  color: #1f2937;
}

.game-modal-body {
  padding: 20px;
}

/* Tic-Tac-Toe */
.tic-tac-toe {
  text-align: center;
}

.game-status {
  font-size: 18px;
  font-weight: 600;
  color: #3b82f6;
  margin-bottom: 20px;
}

.tictactoe-grid {
  display: grid;
  grid-template-columns: repeat(3, 100px);
  gap: 8px;
  margin: 0 auto 20px;
  justify-content: center;
}

.tictactoe-cell {
  width: 100px;
  height: 100px;
  background: #f3f4f6;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tictactoe-cell:hover {
  background: #e5e7eb;
}

.tictactoe-cell.x {
  color: #3b82f6;
  background: #dbeafe;
}

.tictactoe-cell.o {
  color: #ef4444;
  background: #fee2e2;
}

/* Memory Game */
.memory-game {
  text-align: center;
}

.memory-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 0 20px;
}

.memory-moves,
.memory-timer {
  font-size: 16px;
  font-weight: 600;
  color: #6b7280;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 80px);
  gap: 10px;
  margin: 0 auto 20px;
  justify-content: center;
}

.memory-card {
  width: 80px;
  height: 80px;
  position: relative;
  cursor: pointer;
  perspective: 1000px;
}

.memory-card-front,
.memory-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  transition: transform 0.3s ease;
}

.memory-card-front {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
  font-weight: bold;
}

.memory-card-back {
  background: white;
  border: 2px solid #e5e7eb;
  transform: rotateY(180deg);
}

.memory-card.flipped .memory-card-front {
  transform: rotateY(180deg);
}

.memory-card.flipped .memory-card-back {
  transform: rotateY(0);
}

.restart-game-btn {
  padding: 12px 30px;
  background: #6b7280;
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.restart-game-btn:hover {
  background: #4b5563;
}

/* ========== MODALS ========== */
.extras-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.extras-modal.hidden {
  display: none;
}

.extras-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

.extras-modal-content {
  position: relative;
  background: white;
  border-radius: 20px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  z-index: 1;
  animation: modalSlideIn 0.3s ease;
}

.joke-modal-content {
  max-width: 600px;
}

.meme-modal-content {
  max-width: 700px;
}

.extras-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.extras-modal-close:hover {
  background: #e5e7eb;
  color: #1f2937;
}

.joke-modal-body {
  padding: 40px;
  text-align: center;
}

/* ========== EMPTY STATE ========== */
.extras-empty {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  font-size: 60px;
  margin-bottom: 20px;
}

.extras-empty h3 {
  font-size: 20px;
  color: #1f2937;
  margin-bottom: 10px;
}

.extras-empty p {
  color: #6b7280;
}

/* ========== LOADING ========== */
.extras-loading {
  text-align: center;
  padding: 60px 20px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

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

@keyframes modalSlideIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ========== THEME SUPPORT ========== */

/* Dark Theme - White text on dark backgrounds */
body.dark-theme .extras-container {
  background: #12181f;
}

body.dark-theme .extras-title,
body.dark-theme .section-header h2,
body.dark-theme .joke-setup,
body.dark-theme .game-card h3,
body.dark-theme .trivia-question,
body.dark-theme .extras-empty h3,
body.dark-theme .game-status,
body.dark-theme .memory-moves,
body.dark-theme .memory-timer,
body.dark-theme .meme-card-title {
  color: #ffffff;
}

body.dark-theme .extras-subtitle,
body.dark-theme .game-card p,
body.dark-theme .trivia-progress,
body.dark-theme .extras-empty p,
body.dark-theme .joke-category,
body.dark-theme .meme-card-category {
  color: #e8e8e8;
}

body.dark-theme .extras-nav-btn {
  background: #2d2d2d;
  border-color: #3d3d3d;
  color: #e8e8e8;
}

body.dark-theme .extras-nav-btn:hover {
  border-color: #3b82f6;
  color: #ffffff;
}

body.dark-theme .joke-card,
body.dark-theme .meme-card,
body.dark-theme .game-card,
body.dark-theme .trivia-container,
body.dark-theme .extras-modal-content {
  background: #1e1e1e;
  border: 1px solid #3d3d3d;
}

body.dark-theme .joke-punchline {
  background: #2d2d2d;
  color: #60a5fa;
}

body.dark-theme .joke-filter-btn,
body.dark-theme .meme-filter-btn {
  background: #2d2d2d;
  border-color: #3d3d3d;
  color: #e8e8e8;
}

body.dark-theme .tictactoe-cell {
  background: #2d2d2d;
}

body.dark-theme .tictactoe-cell:hover {
  background: #3d3d3d;
}

body.dark-theme .memory-card-front {
  background: #2d2d2d;
  color: #e8e8e8;
}

body.dark-theme .extras-modal-close {
  color: #e8e8e8;
}

body.dark-theme .extras-modal-close:hover {
  background: #3d3d3d;
  color: #ffffff;
}

/* Parchment Theme - Black text on parchment background */
body.parchment-theme .extras-container {
  background: #f5e6c8;
}

body.parchment-theme .extras-title,
body.parchment-theme .section-header h2,
body.parchment-theme .joke-setup,
body.parchment-theme .game-card h3,
body.parchment-theme .trivia-question,
body.parchment-theme .extras-empty h3,
body.parchment-theme .game-status,
body.parchment-theme .memory-moves,
body.parchment-theme .memory-timer,
body.parchment-theme .meme-card-title {
  color: #1a1a1a;
}

body.parchment-theme .extras-subtitle,
body.parchment-theme .game-card p,
body.parchment-theme .trivia-progress,
body.parchment-theme .extras-empty p,
body.parchment-theme .joke-category,
body.parchment-theme .meme-card-category {
  color: #3d2914;
}

body.parchment-theme .extras-nav-btn {
  background: #fff8e7;
  border-color: #d4c4a8;
  color: #3d2914;
}

body.parchment-theme .extras-nav-btn:hover {
  border-color: #8b7355;
  color: #1a1a1a;
}

body.parchment-theme .joke-card,
body.parchment-theme .meme-card,
body.parchment-theme .game-card,
body.parchment-theme .trivia-container,
body.parchment-theme .extras-modal-content {
  background: #fff8e7;
  border: 1px solid #d4c4a8;
}

body.parchment-theme .joke-punchline {
  background: #f0e6d0;
  color: #3b82f6;
}

body.parchment-theme .joke-filter-btn,
body.parchment-theme .meme-filter-btn {
  background: #fff8e7;
  border-color: #d4c4a8;
  color: #3d2914;
}

body.parchment-theme .tictactoe-cell {
  background: #f0e6d0;
}

body.parchment-theme .tictactoe-cell:hover {
  background: #e6d9b8;
}

body.parchment-theme .memory-card-front {
  background: #f0e6d0;
  color: #3d2914;
}

body.parchment-theme .extras-modal-close {
  color: #3d2914;
}

body.parchment-theme .extras-modal-close:hover {
  background: #f0e6d0;
  color: #1a1a1a;
}

/* Light Theme - Dark text on light backgrounds (default) */
body.light-theme .extras-container {
  background: #f8fafc;
}

/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 640px) {
  .extras-container {
    padding: 15px 15px 100px 15px;
  }
  
  .extras-title {
    font-size: 26px;
  }
  
  .extras-nav {
    gap: 8px;
  }
  
  .extras-nav-btn {
    padding: 10px 16px;
    font-size: 13px;
  }
  
  .tictactoe-grid {
    grid-template-columns: repeat(3, 80px);
  }
  
  .tictactoe-cell {
    width: 80px;
    height: 80px;
    font-size: 28px;
  }
  
  .memory-grid {
    grid-template-columns: repeat(4, 65px);
    gap: 8px;
  }
  
  .memory-card {
    width: 65px;
    height: 65px;
  }
  
  .memes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
