/* Main Variables */
:root {
  --primary: #7e0a08;
  --primary-light: #953631;
  --primary-dark: #5a0705;
  --secondary: #ffd54f;
  --secondary-light: #ffecb3;
  --text-dark: #333333;
  --text-light: #ffffff;
  --gray-light: #f5f5f5;
  --gray-medium: #e0e0e0;
  --gray-dark: #9e9e9e;
  --success: #4caf50;
  --warning: #ff9800;
  --danger: #f44336;
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

/* Base Styles */
body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--text-dark);
  background-color: #f8f9fa;
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
}

.container-fluid {
  padding: 0 20px;
}

/* Card Styles */
.quiz-card {
  background-color: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
  border: none;
  margin-bottom: 20px;
}

.card-header {
  background-color: var(--primary);
  color: var(--text-light);
  padding: 16px 20px;
  border-bottom: none;
  position: relative;
}

.card-body {
  padding: 20px;
}

.card-footer {
  background-color: #f8f9fa;
  border-top: 1px solid #eee;
  padding: 15px 20px;
  text-align: center;
}

/* Button Styles */
.btn {
  border-radius: 50px;
  padding: 10px 20px;
  font-weight: 500;
  transition: var(--transition);
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover {
  background-color: var(--primary-light);
  border-color: var(--primary-light);
}

.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-primary:hover {
  background-color: var(--primary);
  color: var(--text-light);
}

.btn-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Form Styles */
.form-control, .form-select {
  border-radius: 8px;
  padding: 10px 15px;
  border: 1px solid var(--gray-medium);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 0.2rem rgba(126, 10, 8, 0.25);
}

/* Quiz Specific Styles */
/* Header with Question Number */
.quiz-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  text-align: center;
  padding: 15px;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  position: relative;
}

.quiz-header h3 {
  margin: 0;
  font-weight: 500;
}

/* Question Container */
.question-container {
  background-color: #f4eefc;
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
}

.question-text {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 20px;
}

/* Timer Styles */
.timer-container {
  margin-bottom: 15px;
}

.timer-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
}

.timer-bar {
  height: 8px;
  border-radius: 4px;
  background-color: #e0e0e0;
  overflow: hidden;
}

.timer-progress {
  height: 100%;
  width: 100%;
  background: linear-gradient(to right, var(--success), var(--warning), var(--danger));
  transition: width 1s linear;
}

/* Answer Options */
.options-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.option-item {
  background-color: white;
  border: 2px solid var(--gray-medium);
  border-radius: var(--border-radius);
  padding: 12px 15px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.option-item:hover {
  border-color: var(--primary-light);
}

.option-item.selected {
  border-color: var(--primary);
  background-color: rgba(126, 10, 8, 0.05);
}

.option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background-color: var(--gray-light);
  border-radius: 50%;
  margin-right: 15px;
  font-weight: 600;
  color: var(--text-dark);
}

.option-item.selected .option-letter {
  background-color: var(--primary);
  color: white;
}

.option-text {
  flex: 1;
  font-weight: 500;
}

.option-check {
  margin-left: 10px;
  color: #4caf50;
  opacity: 0;
}

.option-item.selected .option-check {
  opacity: 1;
}

.option-item.correct {
  border-color: var(--success);
  background-color: rgba(76, 175, 80, 0.1);
}

.option-item.correct .option-letter {
  background-color: var(--success);
  color: white;
}

.option-item.incorrect {
  border-color: var(--danger);
  background-color: rgba(244, 67, 54, 0.1);
}

.option-item.incorrect .option-letter {
  background-color: var(--danger);
  color: white;
}

/* Results Page Styles */
.result-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border-radius: var(--border-radius);
  padding: 15px;
  margin-bottom: 20px;
  text-align: center;
}

.result-badge {
  background-color: white;
  color: var(--primary);
  border-radius: 50px;
  padding: 5px 15px;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 10px;
}

.player-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.profile-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  width: 100%;
  height: 80px;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  position: relative;
}

.profile-picture {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid white;
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--gray-light);
  overflow: hidden;
}

.profile-picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-info {
  background-color: white;
  width: 100%;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  padding: 50px 20px 20px;
  text-align: center;
}

.player-name {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 5px;
}

.player-rank {
  color: var(--gray-dark);
  margin-bottom: 15px;
}

.player-score {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

/* Leaderboard Styles */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.leaderboard-table th {
  background-color: var(--primary);
  color: white;
  padding: 10px 15px;
  text-align: left;
}

.leaderboard-table td {
  padding: 10px 15px;
  border-bottom: 1px solid var(--gray-medium);
}

.leaderboard-table tr:last-child td {
  border-bottom: none;
}

.leaderboard-table tr.highlight {
  background-color: rgba(126, 10, 8, 0.05);
  font-weight: 500;
}

.leaderboard-rank {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rank-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: var(--gray-light);
  font-weight: 600;
}

.rank-1 {
  background-color: #ffd700;
  color: var(--text-dark);
}

.rank-2 {
  background-color: #c0c0c0;
  color: var(--text-dark);
}

.rank-3 {
  background-color: #cd7f32;
  color: var(--text-dark);
}

/* Admin Leaderboard (Public Display) */
.public-leaderboard {
  background-color: white;
  color: var(--text-dark);
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.public-leaderboard-header {
  text-align: center;
  margin-bottom: 20px;
}

.public-leaderboard h2 {
  color: var(--primary);
  margin-bottom: 10px;
}

.public-leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.public-leaderboard-table th {
  background-color: var(--primary);
  color: white;
  padding: 15px;
  text-align: center;
  font-weight: 500;
}

.public-leaderboard-table td {
  padding: 15px;
  text-align: center;
  border-bottom: 1px solid var(--gray-medium);
}

.public-leaderboard-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

.public-leaderboard-table tr.top-3 {
  background-color: rgba(126, 10, 8, 0.05);
  font-weight: 600;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

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

.modal-container {
  background-color: white;
  border-radius: var(--border-radius);
  padding: 20px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  transform: translateY(-20px);
  transition: var(--transition);
}

.modal-overlay.active .modal-container {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.modal-header i {
  color: var(--danger);
  font-size: 24px;
  margin-right: 10px;
}

.modal-header h4 {
  margin: 0;
  color: var(--text-dark);
}

.modal-body {
  margin-bottom: 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Islamic Decoration */
.islamic-decoration {
  text-align: center;
  position: relative;
  margin: 20px 0;
}

.islamic-decoration::before,
.islamic-decoration::after {
  content: "☪";
  color: var(--primary);
  opacity: 0.7;
  display: inline-block;
  margin: 0 15px;
}

/* Loading States */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(126, 10, 8, 0.1);
  border-left-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Responsive Styles */
@media (min-width: 768px) {
  .container-fluid {
    padding: 0 30px;
  }

  .card-body {
    padding: 30px;
  }

  .options-container {
    padding: 0 20px;
  }
  
  .quiz-header h3 {
    font-size: 22px;
  }
  
  .question-text {
    font-size: 22px;
  }
}

/* Quiz header with back and bookmark buttons */
.quiz-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--primary);
  color: white;
  padding: 12px 15px;
}

.quiz-navigation .btn-back,
.quiz-navigation .btn-bookmark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: white;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
}

.quiz-navigation .quiz-progress {
  font-size: 18px;
  font-weight: 500;
}

/* Progress bar styling with color changes */
.time-progress {
  height: 6px;
  background-color: #e0e0e0;
  border-radius: 3px;
  margin: 5px 0 15px;
  overflow: hidden;
}

.time-progress-bar {
  height: 100%;
  transition: width 1s linear;
}

.time-progress-bar.full {
  background-color: var(--success);
}

.time-progress-bar.medium {
  background-color: var(--warning);
}

.time-progress-bar.low {
  background-color: var(--danger);
}

/* Modern results banner styling */
.completion-banner {
  background-color: #f2f2f2;
  border-radius: var(--border-radius);
  overflow: hidden;
  text-align: center;
  margin-bottom: 30px;
}

.banner-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 15px;
  position: relative;
}

.player-avatar {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  background-color: white;
  margin: 0 auto;
  overflow: hidden;
}

.player-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-body {
  padding: 20px;
}

.player-info {
  margin-bottom: 15px;
}

.rank-display {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary);
}

/* Correctly add option selection checkmark */
.option-status {
  position: absolute;
  right: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.option-status.checked {
  background-color: var(--primary);
  color: white;
}

.option-item.correct .option-status {
  background-color: var(--success);
  color: white;
}

.option-item.incorrect .option-status {
  background-color: var(--danger);
  color: white;
}

/* Enhanced Waiting Page Styles */
.waiting-container {
    max-width: 800px;
    margin: 0 auto;
}

.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 50, 86, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(16, 50, 86, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 50, 86, 0);
    }
}

.islamic-decoration {
    max-width: 300px;
    margin: 0 auto;
    opacity: 0.8;
}

.section-title {
    display: flex;
    align-items: center;
    color: var(--primary-color);
    margin: 1.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.section-title:before,
.section-title:after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(16, 50, 86, 0.2);
    margin: 0 10px;
}

.section-title span {
    padding: 0 10px;
}

/* Quote Box */
.quote-box {
    background-color: rgba(16, 50, 86, 0.05);
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    border-radius: 8px;
    margin: 20px auto;
    max-width: 90%;
}

.quote-text {
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 5px;
}

.quote-source {
    text-align: right;
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

/* Enhanced Dzikir Cards */
.dzikir-container {
    position: relative;
    overflow: hidden;
}

.dzikir-wrapper {
    position: relative;
    height: 260px;
    margin: 0 auto;
}

.dzikir-card {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    border: 1px solid rgba(16, 50, 86, 0.1);
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    transition: all 0.5s ease;
    z-index: 1;
    max-width: 90%;
}

.dzikir-card.active {
    opacity: 1;
    transform: scale(1) translateY(0);
    z-index: 2;
}

.dzikir-arabic {
    font-family: 'Scheherazade New', serif;
    font-size: 2.2rem;
    line-height: 1.2;
    margin-bottom: 12px;
    direction: rtl;
    color: var(--primary-color);
}

.dzikir-latin {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #333;
}

.dzikir-meaning {
    font-size: 0.95rem;
    margin-bottom: 15px;
    color: #555;
}

.dzikir-virtues {
    font-size: 0.85rem;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    color: #666;
}

.dzikir-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}

.dzikir-indicators {
    display: flex;
    justify-content: center;
    margin: 0 15px;
}

.dzikir-indicators span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(16, 50, 86, 0.2);
    margin: 0 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dzikir-indicators span.active {
    background-color: var(--primary-color);
    width: 20px;
    border-radius: 4px;
}

/* Enhanced Tasbih Counter */
.tasbih-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
    max-width: 300px;
}

.tasbih-display-wrapper {
    background: linear-gradient(to bottom, rgba(16, 50, 86, 0.05), rgba(16, 50, 86, 0.1));
    border: 1px solid rgba(16, 50, 86, 0.1);
    border-radius: 12px;
    width: 120px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

.tasbih-display {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-color);
}

.tasbih-buttons {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
}

.btn-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.pulse-light {
    animation: pulse-light 2s infinite;
}

@keyframes pulse-light {
    0% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(13, 110, 253, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
    }
}

.tasbih-target {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

/* Refresh Button Styling */
.refresh-button {
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 10px 20px;
}

.refresh-button:hover i {
    animation: spin 1s linear;
}

.refresh-button.spinning i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}