/* ============================================================
   ДОСТИГАТОР — Стили для "Круга задач" (Canvas-виджет)
   ============================================================ */

/* ------------------------------------------------------------
   Обёртка круга
   ------------------------------------------------------------ */
.circle-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
}

.circle-canvas {
  width: 100%;
  height: 100%;
  cursor: pointer;
  border-radius: 50%;
}

/* ------------------------------------------------------------
   Центральная панель (баланс + аватар)
   ------------------------------------------------------------ */
.circle-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  z-index: 2;
}

.circle-center__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.8rem;
  color: white;
  box-shadow: 0 0 30px rgba(124, 58, 237, 0.4);
  border: 3px solid rgba(255, 255, 255, 0.15);
}

.circle-center__balance {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--accent-gold);
  text-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

.circle-center__balance-icon {
  margin-right: 4px;
}

.circle-center__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ------------------------------------------------------------
   Тултип (при наведении на сегмент)
   ------------------------------------------------------------ */
.circle-tooltip {
  position: fixed;
  z-index: var(--z-tooltip);
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  max-width: 280px;
  backdrop-filter: blur(20px);
}

.circle-tooltip.active {
  opacity: 1;
  visibility: visible;
}

.circle-tooltip__title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.circle-tooltip__deadline {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.circle-tooltip__progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.circle-tooltip__progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.circle-tooltip__progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent-green);
  transition: width 0.3s ease;
}

.circle-tooltip__percent {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-cyan);
  min-width: 36px;
  text-align: right;
}

.circle-tooltip__priority {
  margin-top: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ------------------------------------------------------------
   Легенда (под кругом)
   ------------------------------------------------------------ */
.circle-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.circle-legend__item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.circle-legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.circle-legend__dot--in-progress {
  background: var(--accent-purple);
  box-shadow: 0 0 8px rgba(124, 58, 237, 0.5);
}

.circle-legend__dot--completed {
  background: var(--accent-green);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.circle-legend__dot--overdue {
  background: var(--accent-red);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.circle-legend__dot--pending {
  background: #374151;
}

/* ------------------------------------------------------------
   Кольца: переключатель (год/месяц/неделя)
   ------------------------------------------------------------ */
.circle-ring-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
}

.circle-ring-toggle__btn {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.circle-ring-toggle__btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.circle-ring-toggle__btn.active {
  color: white;
  background: var(--accent-purple);
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.4);
}

/* ------------------------------------------------------------
   Пустое состояние (нет задач)
   ------------------------------------------------------------ */
.circle-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  z-index: 2;
}

.circle-empty__icon {
  font-size: 2rem;
  margin-bottom: 8px;
  opacity: 0.5;
}

.circle-empty__text {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 120px;
  line-height: 1.4;
}

/* ------------------------------------------------------------
   Адаптивность
   ------------------------------------------------------------ */
@media (max-width: 768px) {
  .circle-wrapper {
    max-width: 350px;
  }

  .circle-center__avatar {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }

  .circle-center__balance {
    font-size: 0.85rem;
  }

  .circle-legend {
    gap: 12px;
  }

  .circle-legend__item {
    font-size: 0.7rem;
  }
}

@media (max-width: 480px) {
  .circle-wrapper {
    max-width: 280px;
  }

  .circle-center__avatar {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}
