/* =============================================================================
   QUIZ PACKS CSS STYLES
   Extends existing quest card styles with quiz pack support
   ============================================================================= */

/* Quiz Pack Card Styling - Uses existing quest-card structure with different colors */
.quest-card.quiz-pack {
  background: linear-gradient(145deg, #667eea, #764ba2);
  border: 2px solid #ff6b6b;
}

.quiz-pack-toast-host {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transform: translateX(-50%);
}

.quiz-pack-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.95);
  color: #e5e7eb;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.quiz-pack-toast-actions {
  display: flex;
  gap: 8px;
}

.quiz-pack-toast-btn {
  padding: 6px 10px;
  border: 1px solid #374151;
  border-radius: 6px;
  background: #111827;
  color: #e5e7eb;
  cursor: pointer;
}

.quiz-pack-toast-btn.primary {
  background: #2563eb;
  color: #fff;
}

.quest-card.has-claimed-badge {
  position: relative;
}

.quest-card .claimed-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.9);
  color: #052e16;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.quest-card.quiz-pack .card-back {
  background: linear-gradient(145deg, #764ba2, #667eea);
}

.quiz-pack-back-title {
  margin-bottom: 15px;
  color: #ffd700;
}

.quiz-pack-back-description {
  margin-bottom: 15px;
  color: #e3f2fd;
  font-size: 0.9em;
}

/* Quiz Pack Badge */
.quiz-pack-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: linear-gradient(45deg, #ff6b6b, #ee5a24);
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8em;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 8px rgba(238, 90, 36, 0.3);
  z-index: 10;
}

/* Pack Purchase Button Styling */
.pack-purchase-btn {
  background: linear-gradient(45deg, #ff6b6b, #ee5a24);
  border: none;
  color: white;
  padding: 12px 20px;
  border-radius: 25px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pack-purchase-btn:hover {
  background: linear-gradient(45deg, #ee5a24, #ff6b6b);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(238, 90, 36, 0.4);
}
.pack-status {
  position: absolute;
  top: 15px;
  left: 15px;
  font-size: 2em;
  z-index: 10;
  filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}

/* Pack Badge */
.pack-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: linear-gradient(45deg, #ff6b6b, #ee5a24);
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8em;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 8px rgba(238, 90, 36, 0.3);
  z-index: 10;
}

/* Discount Badge */
.discount-badge {
  position: absolute;
  top: 50px;
  right: 15px;
  background: linear-gradient(45deg, #00d2ff, #3a7bd5);
  color: white;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 0.75em;
  font-weight: bold;
  animation: pulse 2s infinite;
  box-shadow: 0 4px 8px rgba(58, 123, 213, 0.3);
  z-index: 10;
}

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

/* Pack Info Section */
.pack-info {
  position: absolute;
  top: 70px;
  left: 15px;
  right: 15px;
  color: white;
}

.pack-info h4 {
  margin: 0 0 15px 0;
  font-size: 1.3em;
  font-weight: 600;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  line-height: 1.2;
}

/* Pack Stats */
.pack-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.pack-stats span {
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: 500;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Access Badges for Individual Quizzes */
.access-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.pack-badge {
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: white;
}

.individual-badge {
  background: linear-gradient(45deg, #56ab2f, #a8e6cf);
  color: white;
}

.free-badge {
  background: linear-gradient(45deg, #ffd89b, #19547b);
  color: white;
}

/* Pack Contents (Back Side) */
.pack-contents {
  margin: 15px 0;
}

.pack-contents h5 {
  margin: 0 0 10px 0;
  color: #ffd700;
  font-size: 1em;
  font-weight: 600;
}

.quiz-list {
  list-style: none;
  padding: 0;
  margin: 0 0 15px 0;
}

.quiz-list li {
  padding: 4px 0;
  font-size: 0.85em;
  color: #e3f2fd;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.quiz-list li:last-child {
  border-bottom: none;
}

/* Pack Savings Display */
.pack-savings {
  background: rgba(255, 255, 255, 0.1);
  padding: 10px;
  border-radius: 8px;
  margin-top: 10px;
  backdrop-filter: blur(10px);
}

.pack-savings span {
  display: block;
  font-size: 0.85em;
  margin: 2px 0;
}

.original-price {
  color: #ffcccb;
  text-decoration: line-through;
}

.pack-price {
  color: #90ee90;
  font-weight: 600;
  font-size: 0.9em;
}

.savings {
  color: #ffd700;
  font-weight: bold;
  font-size: 0.9em;
}

/* Pack Action Buttons */
.pack-action-btn {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #333;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
  width: 100%;
}

.pack-action-btn:hover {
  background: linear-gradient(135deg, #ffed4e 0%, #ffd700 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.pack-action-btn:active {
  transform: translateY(0);
}

/* Front Action Container for Packs */
.quiz-pack-card .front-action-container {
  position: absolute;
  bottom: 15px;
  left: 15px;
  right: 15px;
}

/* Back Action Container for Packs */
.quiz-pack-card .back-action-container {
  position: absolute;
  bottom: 15px;
  left: 15px;
  right: 15px;
}

/* Pack Narrative (Back Side) */
.pack-narrative {
  position: absolute;
  top: 15px;
  left: 15px;
  right: 15px;
  bottom: 70px;
  overflow-y: auto;
  color: white;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.pack-narrative h4 {
  margin: 0 0 10px 0;
  color: #ffd700;
}

.pack-narrative p {
  margin: 0 0 10px 0;
  line-height: 1.4;
}

/* Responsive Design for Quiz Packs */
@media (max-width: 768px) {
  .quiz-pack-card {
    height: 260px;
  }
  
  .pack-info h4 {
    font-size: 1.1em;
  }
  
  .pack-stats {
    gap: 6px;
  }
  
  .pack-stats span {
    font-size: 0.8em;
    padding: 3px 6px;
  }
  
  .pack-action-btn {
    padding: 10px 20px;
    font-size: 0.85em;
  }
  
  .pack-contents {
    margin: 10px 0;
  }
  
  .quiz-list li {
    font-size: 0.8em;
  }
}

/* Grid Layout Enhancements */
.forging-ahead-quests {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding: 20px 0;
}

.forging-section-header {
  grid-column: 1 / -1;
}

.forging-section-header h4 {
  margin: 0;
  color: #e0f2fe;
}

.forging-section-header p {
  margin: 4px 0 0;
  color: #94a3b8;
  font-size: 0.75rem;
}

.forging-market-empty {
  padding: 38px 24px;
  text-align: center;
}

.forging-market-empty-icon {
  margin-bottom: 10px;
  font-size: 2.4rem;
}

.forging-market-empty h3 {
  margin: 0 0 8px;
}

.forging-market-empty p {
  margin: 0 0 18px;
  color: #94a3b8;
}

.forging-market-empty-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 12px;
  background: rgba(251, 191, 36, 0.12);
  color: #fde68a;
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 600px) {
  .forging-ahead-quests {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

/* Enhanced Card Flip Hints for Packs */
.quiz-pack-card .card-flip-hint {
  position: absolute;
  bottom: 60px;
  left: 15px;
  right: 15px;
  text-align: center;
  font-size: 0.75em;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.quiz-pack-card .desktop-hint {
  display: block;
}

.quiz-pack-card .mobile-hint {
  display: none;
}

@media (max-width: 768px) {
  .quiz-pack-card .desktop-hint {
    display: none;
  }
  
  .quiz-pack-card .mobile-hint {
    display: block;
  }
}

/* Animation for pack loading */
.quiz-pack-container {
  animation: fadeInUp 0.6s ease-out;
}

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

/* Loading states */
.quiz-pack-loading {
  background: linear-gradient(90deg, #f0f0f0 25%, transparent 37%, #f0f0f0 63%);
  background-size: 400% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}