/**
 * RewardsWidget CSS
 * Styling for the vanilla JS RewardsWidget
 */

/* Widget Base */
.rewards-widget {
  position: fixed;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  color: #333;
  transition: all 0.3s ease;
}

/* Widget Button (Collapsed State) */
.rewards-widget-button {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: #10b981; /* emerald-500 */
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.rewards-widget-button:hover {
  background-color: #059669; /* emerald-600 */
  transform: scale(1.05);
}

/* Widget Content (Expanded State) */
.rewards-widget-content {
  width: 320px;
  background-color: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Widget Header */
.rewards-widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background-color: #10b981; /* emerald-500 */
  color: white;
  cursor: move;
}

.rewards-widget-title {
  font-weight: 600;
  font-size: 18px;
}

.rewards-widget-close {
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.rewards-widget-close:hover {
  opacity: 1;
}

/* Widget Body */
.rewards-widget-body {
  max-height: 70vh;
  overflow-y: auto;
}

/* Login Form */
.login-form-container {
  padding: 16px;
  background-color: #ecfdf5; /* emerald-50 */
}

.login-form-container h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #064e3b; /* emerald-900 */
}

.error-message {
  background-color: #fee2e2; /* red-100 */
  color: #b91c1c; /* red-700 */
  padding: 8px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 14px;
}

.login-form .form-group {
  margin-bottom: 16px;
}

.login-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #065f46; /* emerald-800 */
}

.login-form input {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db; /* gray-300 */
  border-radius: 4px;
  font-size: 16px;
}

.login-form input:focus {
  outline: none;
  border-color: #10b981; /* emerald-500 */
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.login-button {
  width: 100%;
  padding: 12px;
  background-color: #10b981; /* emerald-500 */
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.login-button:hover {
  background-color: #059669; /* emerald-600 */
}

.login-info {
  margin-top: 16px;
  font-size: 12px;
  color: #6b7280; /* gray-500 */
}

.login-info p {
  margin: 4px 0;
}

/* Dashboard */
.dashboard-container {
  padding: 16px;
  background-color: #ecfdf5; /* emerald-50 */
}

.user-info {
  margin-bottom: 16px;
}

.user-greeting {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
}

.logout-button {
  background: none;
  border: none;
  color: #6b7280; /* gray-500 */
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.logout-button:hover {
  color: #ef4444; /* red-500 */
}

/* Coins Container */
.coins-container {
  background-color: white;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.coins-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.coins-amount {
  display: flex;
  align-items: center;
  font-weight: 600;
}

.coins-amount svg {
  color: #10b981; /* emerald-500 */
  margin-right: 8px;
}

.next-level {
  font-size: 14px;
  color: #6b7280; /* gray-500 */
}

.next-level span {
  font-weight: 600;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background-color: #e5e7eb; /* gray-200 */
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: #10b981; /* emerald-500 */
  border-radius: 9999px;
  transition: width 0.3s ease;
}

/* Quests */
.quests-section {
  margin-bottom: 16px;
}

.quests-section h4 {
  font-weight: 600;
  margin-bottom: 12px;
  color: #1f2937; /* gray-800 */
}

.quests-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quest-item {
  background-color: white;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.quest-item:hover {
  background-color: #f9fafb; /* gray-50 */
}

.quest-title {
  display: flex;
  justify-content: space-between;
  font-weight: 500;
  margin-bottom: 4px;
}

.quest-reward {
  color: #10b981; /* emerald-500 */
  font-size: 14px;
}

.quest-description {
  font-size: 14px;
  color: #6b7280; /* gray-500 */
}

/* Finished Quests */
.finished-quests-section {
  margin-top: 16px;
}

.toggle-finished-quests {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background-color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  color: #1f2937; /* gray-800 */
  cursor: pointer;
  transition: background-color 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.toggle-finished-quests:hover {
  background-color: #f9fafb; /* gray-50 */
}

.toggle-finished-quests svg {
  color: #6b7280; /* gray-500 */
}

.finished-quests-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.3s ease;
}

.finished-quests-list.hide {
  display: none;
}

.finished-quest-item {
  background-color: white;
  padding: 12px;
  border-radius: 8px;
  opacity: 0.75;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Quiz */
.quiz-container {
  padding: 16px;
  background-color: #ecfdf5; /* emerald-50 */
}

.quiz-container h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #064e3b; /* emerald-900 */
}

.quiz-progress {
  color: #6b7280; /* gray-500 */
  margin-bottom: 16px;
}

.quiz-question {
  font-weight: 500;
  margin-bottom: 16px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-option {
  width: 100%;
  text-align: left;
  padding: 12px;
  background-color: white;
  border: 1px solid #d1d5db; /* gray-300 */
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.quiz-option:hover {
  background-color: #f9fafb; /* gray-50 */
}

.quiz-results {
  padding: 16px;
  background-color: #ecfdf5; /* emerald-50 */
  text-align: center;
}

.quiz-results h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #064e3b; /* emerald-900 */
}

.quiz-results p {
  margin-bottom: 16px;
}

.quiz-close-button {
  width: 100%;
  padding: 12px;
  background-color: #10b981; /* emerald-500 */
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.quiz-close-button:hover {
  background-color: #059669; /* emerald-600 */
}

/* Video */
.video-container {
  padding: 16px;
  background-color: #ecfdf5; /* emerald-50 */
}

.video-container h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #064e3b; /* emerald-900 */
}

.video-wrapper {
  aspect-ratio: 16 / 9;
  background-color: #f3f4f6; /* gray-100 */
  margin-bottom: 16px;
  border-radius: 8px;
  overflow: hidden;
}

.video-complete-button {
  width: 100%;
  padding: 12px;
  background-color: #10b981; /* emerald-500 */
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.video-complete-button:hover {
  background-color: #059669; /* emerald-600 */
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .rewards-widget-content {
    max-height: 80vh;
  }
}
