/* Modern & Unique Design for Online Quiz Game */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #000000; /* Solid black background */
  color: #000000; /* Light text color for contrast */
  min-height: 100vh;
  padding: 15px;
  animation: bgShift 15s ease infinite;
}

/* Optional: you can remove this if you want plain black without animation */
@keyframes bgShift {
  0%, 100% { background: #000000; }
  50% { background: #111111; } /* Slight shift for a soft effect */
}


.container {
  max-width: 700px;
  margin: 20px auto;
  background: rgba(255, 255, 255, 0.98);
  padding: 25px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1 {
  margin-bottom: 10px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

h2 {
  color: #667eea;
  margin-bottom: 20px;
  font-size: 1.4rem;
}

p {
  line-height: 1.6;
  margin-bottom: 15px;
  color: #555;
  font-size: 0.95rem;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #2d3748;
  font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input:not([type]),
select {
  width: 100%;
  padding: 14px 12px;
  margin-bottom: 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
  background-color: #f7fafc;
  -webkit-appearance: none;
  appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input:not([type]):focus,
select:focus {
  outline: none;
  border-color: #667eea;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

button {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  padding: 16px 20px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  width: 100%;
  min-height: 48px;
  touch-action: manipulation;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

ul.options {
  list-style: none;
  margin-bottom: 20px;
}

ul.options li {
  margin: 10px 0;
}

ul.options label {
  display: flex;
  align-items: center;
  padding: 14px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #f7fafc;
  margin-bottom: 0;
  min-height: 48px;
  font-size: 0.95rem;
}

ul.options input[type="radio"] {
  margin-right: 12px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #667eea;
  flex-shrink: 0;
}

ul.options label:hover {
  background: #edf2f7;
  border-color: #667eea;
}

ul.options input[type="radio"]:checked + label {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  border-color: #667eea;
}

.question {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 25px;
  line-height: 1.5;
}

.error {
  color: #c53030;
  background: linear-gradient(135deg, rgba(197, 48, 48, 0.1), rgba(245, 101, 101, 0.1));
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid #c53030;
  font-weight: 500;
}

.success {
  color: #22863a;
  background: linear-gradient(135deg, rgba(34, 134, 58, 0.1), rgba(85, 181, 100, 0.1));
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid #22863a;
  font-weight: 500;
}

table.leaderboard {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  font-size: 0.85rem;
}

table.leaderboard thead {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}

table.leaderboard th {
  padding: 12px 8px;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
}

table.leaderboard td {
  padding: 10px 8px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.85rem;
}

table.leaderboard tbody tr:hover {
  background: #f7fafc;
}

table.leaderboard tbody tr:nth-child(even) {
  background: #f9fafb;
}

a {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

a:hover {
  border-bottom-color: #667eea;
  color: #764ba2;
}

.progress-indicator {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e2e8f0;
  flex-wrap: wrap;
  gap: 10px;
}

.progress-text {
  font-weight: 600;
  color: #667eea;
  font-size: 0.95rem;
}

.score-display {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667eea' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 20px;
  padding-right: 40px;
}

/* Mobile optimization */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .container {
    margin: 10px auto;
    padding: 20px;
    border-radius: 12px;
  }

  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  p {
    font-size: 0.9rem;
  }

  button {
    min-height: 50px;
    padding: 14px 16px;
    font-size: 0.95rem;
  }

  ul.options label {
    padding: 12px 10px;
    min-height: 50px;
    font-size: 0.9rem;
  }

  ul.options input[type="radio"] {
    width: 18px;
    height: 18px;
  }

  .progress-indicator {
    flex-direction: column;
    align-items: flex-start;
  }

  table.leaderboard {
    font-size: 0.8rem;
  }

  table.leaderboard th,
  table.leaderboard td {
    padding: 8px 6px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 15px;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1rem;
  }

  p {
    font-size: 0.85rem;
  }

  button {
    min-height: 48px;
    padding: 12px 14px;
    font-size: 0.9rem;
  }

  ul.options label {
    padding: 10px 8px;
    min-height: 46px;
    font-size: 0.85rem;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  input:not([type]),
  select {
    padding: 12px 10px;
    font-size: 16px;
  }

  label {
    font-size: 0.85rem;
  }

  .score-display {
    font-size: 0.9rem;
    padding: 6px 12px;
  }
}

/* New Enhanced Styles */

/* Header Navigation */
.header-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.user-menu {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.btn-small {
  padding: 6px 12px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.3s ease;
  border-bottom: none !important;
}

.btn-small:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-radius: 8px;
  text-decoration: none;
  margin: 5px;
  transition: all 0.3s ease;
  border-bottom: none !important;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Info Box */
.info-box {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 15px;
  margin: 20px 0;
}

.info-box ul {
  margin: 0;
  padding-left: 20px;
}

.info-box li {
  margin: 5px 0;
  color: #555;
}

/* Progress Bar */
.progress-bar-container {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  transition: width 0.3s ease;
  border-radius: 10px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

/* Feedback Messages */
.feedback-message {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-weight: 600;
  text-align: center;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.correct-feedback {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(74, 222, 128, 0.1));
  color: #15803d;
  border-left: 4px solid #22c55e;
}

.incorrect-feedback {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(248, 113, 113, 0.1));
  color: #b91c1c;
  border-left: 4px solid #ef4444;
}

/* Timer */
.timer-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
  border-radius: 8px;
}

.timer-label {
  font-weight: 600;
  color: #2d3748;
}

.timer-display {
  font-size: 1.5rem;
  font-weight: 700;
  color: #667eea;
  min-width: 50px;
  text-align: center;
}

/* Hint System */
.hint-container {
  text-align: center;
  margin: 15px 0;
}

.hint-button {
  display: inline-block;
  padding: 10px 20px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border-bottom: none !important;
}

.hint-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.hint-box {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(249, 115, 22, 0.1));
  border: 2px solid #fbbf24;
  border-radius: 8px;
  padding: 15px;
  margin: 15px 0;
  color: #92400e;
}

/* Enhanced Options */
.option-label {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  flex-shrink: 0;
}

.option-text {
  flex: 1;
}

ul.options input[type="radio"]:checked ~ .option-label .option-letter {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin: 25px 0;
}

.stat-item, .stat-card {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 15px;
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 5px;
}

.stat-value {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: #667eea;
}

.stat-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

/* Answer Review */
.answer-review {
  margin: 30px 0;
}

.answer-review h3 {
  color: #667eea;
  margin-bottom: 20px;
}

.review-item {
  background: #f7fafc;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
}

.review-item.correct {
  border-left: 4px solid #22c55e;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.05), rgba(74, 222, 128, 0.05));
}

.review-item.incorrect {
  border-left: 4px solid #ef4444;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), rgba(248, 113, 113, 0.05));
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.review-number {
  font-weight: 700;
  color: #667eea;
}

.review-status {
  font-weight: 600;
  font-size: 0.9rem;
}

.review-question {
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 10px;
}

.review-answer {
  font-size: 0.9rem;
  color: #555;
  margin: 10px 0;
}

.review-explanation {
  background: rgba(102, 126, 234, 0.1);
  padding: 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #2d3748;
  margin-top: 10px;
}

/* Filters */
.filters {
  margin: 20px 0;
  padding: 15px;
  background: #f7fafc;
  border-radius: 8px;
}

.filter-form {
  display: flex;
  gap: 15px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-group {
  flex: 1;
  min-width: 150px;
}

.filter-group label {
  margin-bottom: 5px;
  font-size: 0.85rem;
}

.filter-group select {
  margin-bottom: 0;
}

/* Table Responsive */
.table-responsive {
  overflow-x: auto;
  margin: 15px 0;
}

/* Performance Classes */
tr.perfect {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(74, 222, 128, 0.05)) !important;
}

tr.excellent {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(96, 165, 250, 0.05)) !important;
}

tr.good {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(251, 191, 36, 0.05)) !important;
}

/* Profile Styles */
.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 25px 0;
  padding: 20px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
  border-radius: 12px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
}

.profile-info h2 {
  margin: 0 0 5px 0;
}

.profile-info p {
  margin: 5px 0;
  color: #64748b;
}

.profile-meta {
  font-size: 0.85rem;
}

/* Achievements */
.achievements-section {
  margin: 30px 0;
}

.achievements-section h3 {
  color: #667eea;
  margin-bottom: 20px;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
}

.achievement-card {
  display: flex;
  gap: 15px;
  padding: 15px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), rgba(251, 191, 36, 0.05));
  border: 2px solid #fbbf24;
  border-radius: 8px;
}

.achievement-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.achievement-info h4 {
  margin: 0 0 5px 0;
  color: #2d3748;
  font-size: 1rem;
}

.achievement-info p {
  margin: 5px 0;
  font-size: 0.85rem;
  color: #64748b;
}

.achievement-info small {
  color: #94a3b8;
  font-size: 0.75rem;
}

/* Recent Scores Section */
.recent-scores-section {
  margin: 30px 0;
}

.recent-scores-section h3 {
  color: #667eea;
  margin-bottom: 20px;
}

/* Small text helper */
small {
  display: block;
  margin-top: -10px;
  margin-bottom: 15px;
  font-size: 0.8rem;
  color: #64748b;
}

/* Mobile Responsive Updates */
@media (max-width: 768px) {
  .header-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .user-menu {
    width: 100%;
    justify-content: flex-start;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .filter-form {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    width: 100%;
  }

  .achievements-grid {
    grid-template-columns: 1fr;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .option-letter {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }

  .timer-display {
    font-size: 1.2rem;
  }
}
