/**
 * Progress Tracker Widget Styles for chemie-lernen.org
 */

/* Progress Widget Container */
.progress-widget {
  max-width: 400px;
  margin: 2rem auto;
  padding: 1.5rem;
  background: var(--card-bg, #ffffff);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.widget-title {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--primary-color, #2c3e50);
}

/* Progress Overview */
.progress-overview {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--overview-bg, #f8f9fa);
  border-radius: 8px;
}

/* Circular Progress Chart */
.progress-circle {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}

.circular-chart {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  max-height: 100%;
}

.circle-bg {
  fill: none;
  stroke: var(--circle-bg, #e0e0e0);
  stroke-width: 2;
}

.circle {
  fill: none;
  stroke: var(--accent-color, #3498db);
  stroke-width: 2;
  stroke-linecap: round;
  transition: stroke-dasharray 0.6s ease;
}

.percentage {
  fill: var(--text-color, #2c3e50);
  font-family: sans-serif;
  font-weight: bold;
  font-size: 0.5em;
  text-anchor: middle;
}

/* Progress Details */
.progress-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.detail-label {
  color: var(--text-secondary, #666);
}

.detail-value {
  font-weight: 600;
  color: var(--primary-color, #2c3e50);
}

/* Topic List */
.topic-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  max-height: 400px;
  overflow-y: auto;
}

.topic-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  background: var(--item-bg, #f8f9fa);
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.topic-item:hover {
  background: var(--item-hover, #e9ecef);
  transform: translateX(4px);
}

.topic-item.completed {
  border-left-color: #28a745;
  background: rgba(40, 167, 69, 0.05);
}

.topic-item.visited {
  border-left-color: #ffc107;
  background: rgba(255, 193, 7, 0.05);
}

.topic-item.not-visited {
  border-left-color: #6c757d;
  opacity: 0.7;
}

.topic-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  text-decoration: none;
  color: var(--text-color, #2c3e50);
}

.topic-link:hover {
  color: var(--accent-color, #3498db);
}

.topic-icon {
  font-size: 1.25rem;
}

.topic-title {
  font-size: 0.95rem;
  font-weight: 500;
}

.topic-score {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  background: var(--score-bg, #e9ecef);
  color: var(--score-text, #495057);
}

.topic-item.completed .topic-score {
  background: #d4edda;
  color: #155724;
}

/* Progress Actions */
.progress-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.btn-reset {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  color: #6c757d;
  background: transparent;
  border: 1px solid #6c757d;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-reset:hover {
  color: #dc3545;
  border-color: #dc3545;
  background: rgba(220, 53, 69, 0.05);
}

/* Responsive Design */
@media (max-width: 768px) {
  .progress-widget {
    margin: 1rem;
    padding: 1rem;
  }

  .progress-overview {
    flex-direction: column;
    text-align: center;
  }

  .topic-list {
    max-height: 300px;
  }

  .topic-title {
    font-size: 0.9rem;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .progress-widget {
    --card-bg: #1e1e1e;
    --primary-color: #e0e0e0;
    --text-color: #e0e0e0;
    --text-secondary: #a0a0a0;
  }

  .circle-bg {
    stroke: #3a3a3a;
  }

  .topic-item {
    background: #2a2a2a;
  }

  .topic-item:hover {
    background: #3a3a3a;
  }

  .detail-item {
    border-bottom-color: #3a3a3a;
  }
}

/* Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.topic-item {
  animation: slideIn 0.3s ease;
}

/* Scrollbar styling for topic list */
.topic-list::-webkit-scrollbar {
  width: 8px;
}

.topic-list::-webkit-scrollbar-track {
  background: var(--scrollbar-track, #f1f1f1);
  border-radius: 4px;
}

.topic-list::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb, #c1c1c1);
  border-radius: 4px;
}

.topic-list::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover, #a1a1a1);
}

/* Print styles */
@media print {
  .progress-widget {
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .btn-reset {
    display: none;
  }
}
