/* trivia-custom.css - Custom styling for trivia game with Bootstrap integration */

/* Screen behavior */
.screen {
    display: none;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 30px;
  }
  
  .screen.active {
    display: block;
  }
  
  /* Hide elements by default */
  #hostGameSetup,
  #player-select-container,
  #bailout-notification,
  #results-notification,
  #wager-info,
  #host-controls,
  #player-waiting,
  #host-next-controls,
  #player-waiting-next,
  #next-question-info {
    display: none;
  }
  
  /* Game code display */
  .game-code {
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 2px;
    color: #3a86ff;
  }
  
  /* Timer styling */
.timer {
  width: 70px;
  height: 70px;
  border: 3px solid #3a86ff;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: #e7f1ff;
  box-shadow: 0 0 15px rgba(58, 134, 255, 0.3);
  position: relative;
  animation: pulse 2s infinite;
}

.timer #timer-value {
  font-size: 1.8rem;
  font-weight: bold;
  color: #3a86ff;
}

.timer.urgent {
  border-color: #dc3545;
  background-color: #fff5f5;
  box-shadow: 0 0 15px rgba(220, 53, 69, 0.4);
  animation: urgent-pulse 1s infinite;
}

.timer.urgent #timer-value {
  color: #dc3545;
}

.timer-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 4px;
  background-color: #3a86ff;
  transition: width 1s linear;
}

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

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

/* Make the timer responsive */
@media (max-width: 768px) {
  .timer {
    width: 60px;
    height: 60px;
  }
  
  .timer #timer-value {
    font-size: 1.5rem;
  }
}
  
  /* Rules display */
  .rules-content.hidden {
    display: none;
  }
  
/* Answer option styling */
  #options-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
  }
  
  @media (max-width: 768px) {
    #options-container {
      grid-template-columns: 1fr; /* Stack on mobile */
    }
  }
  
  .option-btn {
    position: relative;
    transition: all 0.2s ease;
    padding: 15px 15px 15px 40px; /* Extra padding on left for letter */
    border-radius: 10px;
    border: 2px solid #dee2e6;
    background-color: #fff;
    font-size: 1.1rem;
    text-align: left;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    min-height: 60px;
    display: flex;
    align-items: center;
  }
  
  .option-btn:before {
    content: attr(data-letter);
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #f0f0f0;
    color: #495057;
    width: 24px;
    height: 24px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* For image options */
  .option-btn.image-option {
    padding: 10px;
    text-align: center;
    justify-content: center;
    height: auto;
  }
  
  .option-btn.image-option:before {
    top: 10px;
    left: 10px;
    transform: none;
  }
  
  .option-btn.image-option img {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
    margin-top: 20px; /* Space for the letter marker */
  }
  
  .option-btn:hover {
    transform: translateY(-2px);
    border-color: #3a86ff;
    box-shadow: 0 4px 8px rgba(58, 134, 255, 0.15);
  }
  
  .option-btn:active {
    transform: translateY(0);
  }
  
  .option-btn.selected {
    border-color: #3a86ff;
    background-color: rgba(58, 134, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(58, 134, 255, 0.2);
  }
  
  .option-btn.correct {
    border-color: #28a745;
    background-color: rgba(40, 167, 69, 0.1);
  }
  
  .option-btn.incorrect {
    border-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
  }
  
  /* Animation for correct answer feedback */
  @keyframes correct-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
  }
  
  .correct-feedback {
    animation: correct-pulse 0.5s ease;
  }
  
/* Bailout section styling */
 .bailouts-section {
    margin: 25px auto;
    background: linear-gradient(to right, #f8f9fa, #e9ecef);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid #dee2e6;
    max-width: 500px;
    text-align: center; 
  }
  
  .bailouts-header {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6c757d;
    margin-bottom: 10px;
    font-weight: 600;
  }
  
  .bailouts-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
  }
  
  .bailout-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: none;
    background-color: white;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    padding: 12px 15px;
    min-width: 100px;
    transition: all 0.3s ease;
    color: #495057;
  }
  
  .bailout-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 12px rgba(0,0,0,0.15);
  }
  
  .bailout-icon {
    font-size: 24px;
    margin-bottom: 5px;
  }
  
  .bailout-label {
    font-size: 0.8rem;
    font-weight: 600;
  }
  
  /* Color variations for different bailout types */
  .bailout-btn.fifty-fifty {
    background-color: #e7f5ff;
    color: #0d6efd;
  }
  
  .bailout-btn.copycat {
    background-color: #fff3cd;
    color: #ffc107;
  }
  
  .bailout-btn:disabled {
    opacity: 0.5;
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
  }
  
  /* Player icons styling */
  .player-icon {
    display: inline-block;
    margin-left: 8px;
    font-size: 1rem;
  }
  
  /* Table column widths for results table */
  .rank-column {
    width: 60px;
  }
  
  .player-column {
    width: 25%;
    text-align: left !important;
  }
  
  .answer-column {
    width: 15%;
    text-align: center !important;
  }
  
  .points-change-column {
    width: 20%;
    text-align: right !important;
  }
  
  .round-points-column, 
  .total-points-column {
    width: 15%;
    text-align: right !important;
  }

 .table-responsive {
    overflow-x: auto;
  }
  
  .table th,
  .table td {
    text-align: center;
    vertical-align: middle;
  }
  
  .table th.text-start,
  .table td.text-start {
    text-align: left;
  }
  
  /* Notification styling */
  .toast {
    position: relative;
    min-width: 300px;
    max-width: 350px;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.9);
    border-left: 5px solid #3a86ff;
  }

  #notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: white;
    padding: 10px 15px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    max-width: 300px;
    z-index: 1000;
  }

  #notification.show {
    opacity: 1;
    transform: translateY(0);
  }

  #notification.info {
    border-left: 4px solid #0d6efd;
  }

  #notification.success {
    border-left: 4px solid #198754;
  }

  #notification.warning {
    border-left: 4px solid #ffc107;
  }

  #notification.error {
    border-left: 4px solid #dc3545;
  }
  
  /* Host vs player view */
  .host-view .player-only {
    display: none !important;
  }
  
  .player-view .host-only {
    display: none !important;
  }

  /* Player list styling */
.player-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
  }
  
  .list-group-item {
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
  }
  
  .list-group-item:hover {
    background-color: rgba(0, 123, 255, 0.05);
    border-left-color: #007bff;
  }

  /* Basic styling for the rules button on welcome screen */
  #rules-btn {
    display: inline-block;
    transition: all 0.2s ease;
  }
  
  #rules-btn:hover {
    transform: translateY(-2px);
  }
  
  /* Modal styling */
  .modal-body ul {
    padding-left: 0;
  }
  
  .modal-body strong {
    color: #3a86ff;
  }
  
  /* Animation for new players joining */
  @keyframes playerJoin {
    0% { transform: translateY(-10px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
  }
  
  .list-group-item {
    animation: playerJoin 0.3s ease-out;
  }
  
  /* Player status badges */
  .player-status {
    font-size: 0.8rem;
  }

  .hidden {
    display: none !important;
  }

  /* Enhanced correct answer section */
.card-header h2.h5 {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .card-header h2.h5::before {
    display: inline-block;
    width: 24px;
    height: 24px;
    background-color: #28a745;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-size: 14px;
  }
  
  .correct-answer-card {
    border-left: 4px solid #28a745;
    margin-bottom: 1.5rem;
    background-color: #f8f9fa;
  }
  
  .correct-answer-card .card-header {
    background-color: rgba(40, 167, 69, 0.1);
    border-bottom: 1px solid rgba(40, 167, 69, 0.2);
  }
  
  #correct-answer {
    font-size: 1.1rem;
  }

  /* Wager container */
  #wager-container {
    max-width: 500px;
    margin: 0 auto 1.5rem;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  }
  
  #wager-container .card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
  }
  
  #wager-message {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.1rem;
  }
  
  #place-wager-btn {
    min-width: 150px;
  }
  
  #wager-form {
    width: 100%;
    max-width: 300px;
  }

  /* Upcoming question card */
  #next-question-info {
    max-width: 500px;
    margin: 0 auto 1.5rem;
    border-radius: 12px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  }
  
  #next-question-info .card-header {
    background-color: #f0f0f0;
    border-bottom: 1px solid #dee2e6;
    border-radius: 12px 12px 0 0;
  }
  
  #next-question-info .card-body {
    padding: 1rem;
  }
  
  #next-category, #next-difficulty {
    font-weight: 500;
    color: #495057;
  }
  
  #next-difficulty:first-letter {
    text-transform: uppercase;
  }

  #host-next-controls {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
  }
  
  #next-question-btn {
    min-width: 150px;
  }
  
/* Distinctive Correct Answer card */
.correct-answer-card {
    border-radius: 8px;
    background-color: #fff;
    border-left: 5px solid #28a745;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto 24px;
  }
  
  .correct-answer-header {
    padding: 12px 16px;
    background-color: rgba(40, 167, 69, 0.1);
    border-bottom: 1px solid rgba(40, 167, 69, 0.2);
  }
  
  .correct-answer-body {
    padding: 16px;
    font-size: 1.25rem;
    font-weight: 500;
  }
  
  /* Category and difficulty styling */
  .category-badge, .difficulty-badge {
    display: inline-block;
    text-transform: capitalize;
    font-weight: 500;
  }
  
  .category-badge {
    color: #0d6efd;
  }
  
  .difficulty-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
  }
  
  .difficulty-badge.easy {
    background-color: #d1e7dd;
    color: #0f5132;
  }
  
  .difficulty-badge.medium {
    background-color: #fff3cd;
    color: #664d03;
  }
  
  .difficulty-badge.hard {
    background-color: #f8d7da;
    color: #842029;
  }
  
  /* Next question button positioning */
  #host-next-controls {
    margin: 0 auto;
  }
  
  #next-question-btn {
    min-width: 180px;
    font-weight: 500;
  }
  
  /* Next question info and wager card styling */
  #next-question-info,
  #wager-container {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 8px;
  }
  
  /* Table alignment */
  .table th.text-start,
  .table td.text-start {
    text-align: left !important;
  }
  
  .table th.text-center,
  .table td.text-center {
    text-align: center !important;
  }
  
  .table th.text-end,
  .table td.text-end {
    text-align: right !important;
  }

  .points-main {
    font-size: 1.1rem;
    font-weight: bold;
    display: block;
  }

  .points-tier {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: normal;
  }

  .points-bonuses {
    display: block;
    font-size: 0.85rem;
    margin-top: 2px;
  }

  .bonus-speed {
    color: #fd7e14; /* Orange for speed bonus */
  }

  .bonus-streak {
    color: #dc3545; /* Red for streak bonus */
  }

  .bonus-bet {
    color: #6f42c1; /* Purple for bet bonus */
  }

  /* Streak indicator styling */
  .streak-indicator {
    font-size: 0.9rem;
    white-space: nowrap;
  }

  /* Add to styles.css */
.reconnecting-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.reconnecting-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.reconnecting-content {
  background-color: white;
  padding: 20px 30px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-width: 80%;
}

.reconnecting-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  margin-bottom: 15px;
  border: 4px solid rgba(0, 123, 255, 0.25);
  border-top-color: #0d6efd;
  border-radius: 50%;
  animation: reconnect-spin 1s linear infinite;
}

.reconnecting-message {
  font-size: 1.1rem;
  color: #343a40;
}

/* Question metadata (category and difficulty) styling */
.question-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: #6c757d;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.question-category {
  font-weight: 500;
  color: #495057;
  text-transform: capitalize;
}

.meta-separator {
  color: #adb5bd;
  font-weight: 300;
}

.question-difficulty {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

/* Difficulty color coding */
.question-difficulty.easy {
  background-color: rgba(40, 167, 69, 0.1);
  color: #28a745;
  border: 1px solid rgba(40, 167, 69, 0.2);
}

.question-difficulty.medium {
  background-color: rgba(255, 193, 7, 0.1);
  color: #e39c00;
  border: 1px solid rgba(255, 193, 7, 0.2);
}

.question-difficulty.hard {
  background-color: rgba(220, 53, 69, 0.1);
  color: #dc3545;
  border: 1px solid rgba(220, 53, 69, 0.2);
}

/* Subtle animation when question loads */
@keyframes fadeInMeta {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 0.8;
    transform: translateY(0);
  }
}

.question-meta {
  animation: fadeInMeta 0.5s ease-out forwards;
}

/* Mobile responsiveness */
@media (max-width: 576px) {
  .question-meta {
    font-size: 0.8rem;
    margin-bottom: 12px;
  }
  
  .question-difficulty {
    font-size: 0.75rem;
    padding: 1px 6px;
  }
}

/* Countdown overlay */
.countdown-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.countdown-overlay.active {
  opacity: 1;
  visibility: visible;
}

.countdown-container {
  text-align: center;
}

.countdown-number {
  font-size: 8rem;
  font-weight: bold;
  color: #fff;
  margin-bottom: 1rem;
  animation: pulse 1s infinite;
}

.countdown-text {
  font-size: 2rem;
  color: #fff;
}

/* Disabled options */
.option-btn.disabled,
.option-btn:disabled {
  opacity: 0.6;
  transform: none;
  cursor: not-allowed;
}

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

  /* Media queries for responsive design */
  @media (max-width: 768px) {
    .timer {
      width: 50px;
      height: 50px;
    }
    
    .game-code {
      font-size: 1.5rem;
    }
    
    .table th, 
    .table td {
      padding: 0.5rem;
      font-size: 0.9rem;
    }
    
    .rank-column {
      width: 40px;
    }
  }
  
  @media (max-width: 576px) {
    .player-column {
      width: 30%;
    }
    
    .answer-column {
      width: 20%;
    }
    
    .points-change-column {
      width: 15%;
    }
    
    .round-points-column, 
    .total-points-column {
      width: 12.5%;
    }
  }