/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #072329 0%, #0a3d47 50%, #072329 100%);
  min-height: 100vh;
  color: #333;
  line-height: 1.6;
}

/* Container styles */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Header styles */
h1 {
  color: white;
  font-size: 2.5rem;
  margin-bottom: 2rem;
  text-align: center;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  font-weight: 700;
}

h2 {
  color: white;
  font-size: 1.8rem;
  margin-bottom: 1rem;
  text-align: center;
}

h3 {
  color: white;
  font-size: 1.4rem;
  margin-bottom: 1rem;
  margin-top: 1.5rem;
}

/* Card styles */
.card {
  background: white;
  border-radius: 15px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  margin-bottom: 2rem;
  width: 100%;
  max-width: 600px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

/* Button styles */
button {
  background: linear-gradient(45deg, #ff6b6b, #ee5a52);
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  margin: 0.5rem;
  min-width: 120px;
}

button:hover {
  background: linear-gradient(45deg, #ee5a52, #ff6b6b);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Primary button variant */
.btn-primary {
  background: linear-gradient(45deg, #4ecdc4, #44a08d);
}

.btn-primary:hover {
  background: linear-gradient(45deg, #44a08d, #4ecdc4);
  box-shadow: 0 5px 15px rgba(78, 205, 196, 0.4);
}

/* Secondary button variant */
.btn-secondary {
  background: linear-gradient(45deg, #667eea, #764ba2);
}

.btn-secondary:hover {
  background: linear-gradient(45deg, #764ba2, #667eea);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Input styles */
input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background: white;
}

input[type="text"]:focus,
input[type="number"]:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input::placeholder {
  color: #999;
}

/* Form styles */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #555;
}

/* Game panel styles */
#hostPanel {
  background: white;
  border-radius: 15px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  margin-top: 2rem;
  width: 100%;
  max-width: 800px;
}

/* Game ID display */
#gameIdDisplay {
  font-family: "Courier New", monospace;
  font-weight: bold;
  font-size: 1.5rem;
  color: #667eea;
  background: #f0f4ff;
  padding: 8px 16px;
  border-radius: 8px;
  border: 2px solid #667eea;
}

/* Question display styles */
#currentQuestion,
#questionBox,
#displayQuestion {
  background: linear-gradient(135deg, #e7231a 0%, #ff4136 50%, #e7231a 100%);
  color: white;
  padding: 1.5rem;
  border-radius: 12px;
  margin: 1rem 0;
  font-size: 1.3rem;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Answer styles */
#answers,
#answerButtons,
#displayAnswers {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

#answers li,
#answerButtons li,
#displayAnswers li {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  font-weight: 500;
}

#answers li:hover,
#answerButtons li:hover,
#displayAnswers li:hover {
  background: #e9ecef;
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Answer button specific styles */
#answerButtons button {
  width: 100%;
  margin: 0;
  padding: 1.5rem;
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(45deg, #667eea, #764ba2);
  border-radius: 10px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#answerButtons button:hover {
  background: linear-gradient(45deg, #764ba2, #667eea);
}

#answerButtons button:disabled {
  background: linear-gradient(45deg, #667eea, #764ba2);
  cursor: default;
  transform: none;
  opacity: 0.7;
}

/* Player list styles */
#playerList {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

#playerList li {
  background: linear-gradient(45deg, #4ecdc4, #44a08d);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 500;
  font-size: 0.9rem;
}

/* Status message styles */
#hostStatus,
#waitingMessage {
  text-align: center;
  padding: 1rem;
  border-radius: 8px;
  font-weight: 500;
  margin: 1rem 0;
}

#hostStatus {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

#waitingMessage {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
  font-size: 1.2rem;
}

/* Player header styles */
#playerHeader {
  background: linear-gradient(45deg, #4ecdc4, #44a08d);
  color: white;
  padding: 1rem 2rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Display screen specific styles */
.display-container {
  text-align: center;
  padding: 2rem;
  color: white;
}

#displayQuestion {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  padding: 2rem;
  color: white;
}

#displayAnswers {
  font-size: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  gap: 2rem;
}

#displayAnswers li {
  padding: 3rem 2rem;
  font-size: 2.5rem;
  font-weight: 700;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 20px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  transform: scale(1);
  transition: all 0.4s ease;
}

/* Display standings specific styles */
#displayStandings {
  margin-top: 3rem;
  text-align: center;
}

#displayStandings h2 {
  color: white;
  font-size: 2rem;
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

#standingsList {
  list-style: none;
  max-width: 800px;
  margin: 0 auto;
  padding: 0;
}

#standingsList li {
  margin: 0.8rem 0;
  padding: 1.2rem;
  border-radius: 12px;
  font-size: 1.3rem;
  text-align: center;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

/* Score display when time is up */
.score-display {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  margin: 1rem 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.6s ease-out;
}

.score-display h3 {
  color: white;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.score-display p {
  margin: 0.5rem 0;
  line-height: 1.4;
}

/* Answer option color styles - A=Blue, B=Red, C=Yellow, D=Green */
.answer-option-a {
  background: linear-gradient(45deg, #2196f3, #1976d2) !important;
  color: white !important;
}

.answer-option-a:hover {
  background: linear-gradient(45deg, #1976d2, #2196f3) !important;
  box-shadow: 0 5px 15px rgba(33, 150, 243, 0.4) !important;
}

.answer-option-b {
  background: linear-gradient(45deg, #f44336, #d32f2f) !important;
  color: white !important;
}

.answer-option-b:hover {
  background: linear-gradient(45deg, #d32f2f, #f44336) !important;
  box-shadow: 0 5px 15px rgba(244, 67, 54, 0.4) !important;
}

.answer-option-c {
  background: linear-gradient(45deg, #ffc107, #ff8f00) !important;
  color: white !important;
}

.answer-option-c:hover {
  background: linear-gradient(45deg, #ff8f00, #ffc107) !important;
  box-shadow: 0 5px 15px rgba(255, 193, 7, 0.4) !important;
}

.answer-option-d {
  background: linear-gradient(45deg, #4caf50, #388e3c) !important;
  color: white !important;
}

.answer-option-d:hover {
  background: linear-gradient(45deg, #388e3c, #4caf50) !important;
  box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4) !important;
}

/* Override for disabled states while maintaining colors */
.answer-option-a:disabled {
  background: linear-gradient(45deg, #2196f3, #1976d2) !important;
  opacity: 0.7;
}

.answer-option-b:disabled {
  background: linear-gradient(45deg, #f44336, #d32f2f) !important;
  opacity: 0.7;
}

.answer-option-c:disabled {
  background: linear-gradient(45deg, #ffc107, #ff8f00) !important;
  opacity: 0.7;
}

.answer-option-d:disabled {
  background: linear-gradient(45deg, #4caf50, #388e3c) !important;
  opacity: 0.7;
}

/* Timer progress bar styles */
.timer-container {
  margin: 20px 0;
  padding: 15px;
  border-radius: 15px;
  background-color: #fff5f5;
  border: 3px solid #ff6b6b;
  text-align: center;
}

.timer-label {
  font-size: 1.2rem;
  font-weight: bold;
  color: #ff6b6b;
  margin-bottom: 10px;
}

.progress-bar-container {
  width: 100%;
  height: 20px;
  background-color: #f0f0f0;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #ddd;
  margin-bottom: 10px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(45deg, #4caf50, #45a049);
  border-radius: 8px;
  transition: width 0.1s ease-out;
  position: relative;
}

.progress-bar.warning {
  background: linear-gradient(45deg, #ff8800, #ff6600);
}

.progress-bar.danger {
  background: linear-gradient(45deg, #ff0000, #cc0000);
}

.time-text {
  font-size: 1rem;
  font-weight: 600;
  color: #666;
  margin-top: 5px;
}

/* Answered state styles */
.timer-container.answered-correct {
  border-color: #4caf50;
  background-color: #f0fff0;
}

.timer-container.answered-correct .timer-label {
  color: #4caf50;
}

.timer-container.answered-incorrect {
  border-color: #ff6600;
  background-color: #fff8f0;
}

.timer-container.answered-incorrect .timer-label {
  color: #ff6600;
}

.timer-container.time-up {
  border-color: #ff0000;
  background-color: #ffe6e6;
}

.timer-container.time-up .timer-label {
  color: #ff0000;
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  h1 {
    font-size: 2rem;
  }

  .card {
    padding: 1.5rem;
  }

  button {
    min-width: 100px;
    padding: 10px 20px;
  }

  #answers,
  #answerButtons,
  #displayAnswers {
    grid-template-columns: 1fr 1fr;
  }

  #displayQuestion {
    font-size: 2rem;
    padding: 1.5rem;
    color: white;
  }

  #displayAnswers {
    font-size: 1.8rem;
    gap: 1.5rem;
  }

  #displayAnswers li {
    padding: 2rem 1rem;
    font-size: 2rem;
    min-height: 100px;
  }

  #displayStandings h2 {
    font-size: 1.5rem;
  }

  #standingsList li {
    font-size: 1.1rem;
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.8rem;
  }

  .card {
    padding: 1rem;
  }

  button {
    width: 100%;
    margin: 0.25rem 0;
  }

  #gameIdDisplay {
    font-size: 1.2rem;
  }

  #displayQuestion {
    font-size: 1.8rem;
    color: white;
  }

  #displayAnswers {
    font-size: 1.5rem;
    gap: 1rem;
  }

  #displayAnswers li {
    padding: 1.5rem 0.5rem;
    font-size: 1.6rem;
    min-height: 80px;
  }

  #answers,
  #displayAnswers {
    grid-template-columns: 1fr;
  }

  /* Keep answer buttons in 2 columns on mobile since they're just letters */
  #answerButtons {
    grid-template-columns: 1fr 1fr;
  }

  #answerButtons button {
    font-size: 1.5rem;
    padding: 1rem;
    min-height: 70px;
  }
}

/* Animation keyframes */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* Loading spinner */
.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Success/Error message styles */
.success-message {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
  text-align: center;
}

.error-message {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
  text-align: center;
}

/* Special styles for correct answers */
.correct-answer {
  background: linear-gradient(45deg, #28a745, #20c997) !important;
  color: white !important;
  border-color: #28a745 !important;
}

.wrong-answer {
  background: linear-gradient(45deg, #dc3545, #fd7e14) !important;
  color: white !important;
  border-color: #dc3545 !important;
}

/* Style for selected answer (neutral indication) */
.selected-answer {
  background: linear-gradient(45deg, #667eea, #764ba2) !important;
  color: white !important;
  border: 4px solid #ff6f00 !important;
  box-shadow: 0 0 15px rgba(255, 193, 7, 0.6) !important;
}
