/* General Body and Page Layout */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f2f5f7;
    color: #333;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none;
}

.home-button {
  display: inline-block;
  margin-bottom: 15px;
  padding: 8px 16px;
  background-color: #0066cc;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.home-button:hover {
  background-color: #004c99;
}

/* Page Heading */
h2 {
    margin-top: 40px;
    margin-bottom: 25px;
    color: #2c3e50;
    text-align: center;
}

/* Main Content Section (Card) */
#startSection,
#categorySection {
    background: white;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
    width: 90%;
    text-align: center;
}

/* Start Quiz Button */
#startBtn,
.continue-btn {
    padding: 12px 24px;
    font-size: 16px;
    background-color: #2980b9;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    transition: background-color 0.3s ease;
}

#startSection {
    max-width: 500px;
}

#categorySection {
    max-width: 600px;
}

#startBtn:hover,
.continue-btn:hover {
    background-color: #1c5980;
}

/* Form Styling */
form {
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

form input[type="text"],
form select {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 1em;
}

/* Form Submission Button */
form button[type="submit"] {
    margin-top: 25px;
    padding: 10px 22px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    transition: background-color 0.3s ease;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 200px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

form button[type="submit"]:hover {
    background-color: #1e8449;
}

/* Error Message Styling */
.error-message {
    color: #e74c3c;
    font-size: 0.85em;
    margin-top: 5px;
    display: block;
    text-align: left;
}

/* Welcome Messages */
#categorySection > p:first-of-type {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 6px;
    text-align: center;
}

#categorySection > p:nth-of-type(2) {
    font-size: 1.1rem;
    font-weight: 500;
    color: #34495e;
    margin-top: 0;
    margin-bottom: 14px;
    text-align: center;
}

#categorySection p {
    margin: 12px 0;
    font-size: 1.1em;
    color: #2c3e50;
    text-align: center;
    font-weight: 600;
}

/* Category Buttons */
.category-btn {
    padding: 12px 24px;
    font-size: 16px;
    background-color: #34495e;
    color: white;
    border: none;
    border-radius: 8px;
    margin: 8px 10px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-width: 240px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.category-btn:hover:not(:disabled) {
    background-color: #2c3e50;
}

/* Disabled button when already played */
.category-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    color: #555;
    box-shadow: none;
    opacity: 0.85;
}

/* Score text on disabled buttons */
.category-btn:disabled::after {
    content: attr(data-score);
    font-size: 14px;
    font-weight: 600;
    background-color: #27ae60;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 10px;
}

.category-btn .label {
    flex-grow: 1;
    text-align: left;
}

.category-btn .score {
    background-color: #27ae60;
    color: white;
    font-size: 14px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 14px;
    min-width: 70px;
    text-align: center;
    user-select: none;
}

/* All Played Message */
.all-played-msg {
    margin-top: 25px;
    padding: 15px 20px;
    background-color: #27ae60;
    color: white;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
    max-width: 600px;
    text-align: center;
    user-select: none;
}

/* Questions Styling */
.question-block,
.question-card {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.question-card {
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    text-align: left;
}

.question-text {
    font-weight: 600;
    font-size: 17px;
    margin-bottom: 14px;
    color: #2c3e50;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-btn {
    padding: 10px 14px;
    background-color: #ecf0f1;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.25s ease;
    text-align: left;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.option-btn:hover {
    background-color: #bdc3c7;
}

.option-btn.selected {
    background-color: #3498db !important;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.option-btn.correct {
    background-color: #2ecc71 !important;
    color: white;
    font-weight: bold;
}

.option-btn.wrong {
    background-color: #e74c3c !important;
    color: white;
    font-weight: bold;
}

/* Submit/Continue Button */
.submit-btn {
    margin-top: 30px;
    padding: 14px 28px;
    font-size: 18px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.5);
    transition: background 0.3s ease, box-shadow 0.3s ease;
    font-weight: 700;
    width: 100%;
    max-width: 280px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    user-select: none;
}

.submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    box-shadow: 0 6px 18px rgba(39, 174, 96, 0.7);
}

.submit-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.7;
}

/* Result Summary */
.result-summary {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-left: 4px solid #2c3e50;
    font-size: 1.1em;
    font-weight: 500;
    color: #2c3e50;
}

/* Continue Button */
.continue-btn {
    margin-top: 20px;
    display: inline-block;
}

.leaderboard-section {
  margin: 20px auto;
  padding: 15px;
  width: 90%;
  max-width: 400px;
  background: #f0f4f8;
  border: 1px solid #cbd5e0;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s ease-in-out;
}

.leaderboard-section h3 {
  margin-bottom: 10px;
  font-size: 18px;
  color: #2c3e50;
}

.leaderboard-section:not(.hidden) {
  opacity: 1;
  transform: translateY(0);
}

.leaderboard-list {
  list-style: decimal inside;
  padding: 0;
  margin: 0;
  color: #34495e;
}

.leaderboard-list li {
  font-weight: 600;
  padding: 6px 0;
  border-bottom: 1px solid #e1e8ed;
}

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

.result-summary {
  margin-top: 30px;
  padding: 20px;
  background: #f5f8fa;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  text-align: center;
  font-family: 'Segoe UI', sans-serif;
  color: #2d3436;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.result-summary p {
  font-size: 18px;
  margin-bottom: 15px;
  font-weight: bold;
}

.continue-btn {
  padding: 10px 20px;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
}

.continue-btn:hover {
  background-color: #2980b9;
}

.custom-leaderboard-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #ffffff;
  margin: 8px 0;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  font-weight: 600;
  font-size: 16px;
  color: #2c3e50;
}

.custom-leaderboard-entry.you {
  background-color: #e8f5e9;
  color: #1e7e34;
}

.custom-leaderboard-medal {
  font-size: 22px;
  margin-right: 10px;
}

.custom-leaderboard-name {
  flex-grow: 1;
  text-align: left;
}

.custom-leaderboard-score {
  font-weight: 700;
  color: #34495e;
}
