/* Astra Lifecycle Widget Styles */

:root {
  --lifecycle-primary: #0b1220;
  --lifecycle-accent: #2f80ed;
  --lifecycle-danger: #d9534f;
  --lifecycle-success: #27ae60;
  --lifecycle-warn: #f59e0b;
  --lifecycle-muted: #64748b;
  --lifecycle-border: #e6eef6;
  --lifecycle-radius: 10px;
}

/* Основной контейнер */
.astra-timeline-widget {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.widget-container {
  background: #ffffff;
  border: 1px solid var(--lifecycle-border);
  border-radius: 14px;
  padding: 15px;
  box-shadow: 0 8px 30px rgba(9, 30, 66, 0.04);
}

/* Заголовок */
.widget-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.widget-title {
  font-size: 20px;
  margin: 0;
  font-weight: 700;
  color: var(--lifecycle-primary);
}

.next-update-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  background: #faf5ed;
  border: 1px solid #f0d39f;
  border-radius: var(--lifecycle-radius);
  font-weight: 600;
  color: var(--lifecycle-warn);
  font-size: 13px;
}

.next-update-badge .icon {
  width: 14px;
  height: 14px;
}

/* Панель инструментов */
.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filters-container {
  display: flex;
  align-items: center;
  gap: 8px;
  border-right: 1px solid var(--lifecycle-border);
  padding-right: 10px;
}

.filter-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--lifecycle-muted);
  user-select: none;
}

.filter-checkbox input {
  width: 14px;
  height: 14px;
  accent-color: var(--lifecycle-primary);
}

.filter-checkbox .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.filter-checkbox .dot.stable {
  background: var(--lifecycle-danger);
}

.filter-checkbox .dot.patch {
  background: var(--lifecycle-success);
}

.tool-btn {
  background: white;
  border: 1px solid var(--lifecycle-border);
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 13px;
}

.update-time {
  font-size: 12px;
  color: var(--lifecycle-muted);
}

/* Временная шкала */
.timeline-container {
  margin-top: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
}

.timeline-svg {
  width: 100%;
  min-width: 600px;
  border-radius: var(--lifecycle-radius);
  display: block;
}

/* Скроллбар */
.timeline-container::-webkit-scrollbar {
  height: 8px;
}

.timeline-container::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.timeline-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.timeline-container::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.timeline-container {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

/* Полосы жизненного цикла */
.lifecycle-band {
  rx: 8;
  ry: 8;
}

.band-full-support {
  fill: rgba(39, 174, 96, 0.12);
  stroke: rgba(39, 174, 96, 0.45);
  stroke-width: 1.4;
}

.band-bug-fixes {
  fill: rgba(245, 158, 11, 0.08);
  stroke: rgba(245, 158, 11, 0.45);
  stroke-width: 1.2;
}

.band-security {
  fill: rgba(217, 83, 79, 0.1);
  stroke: rgba(217, 83, 79, 0.38);
  stroke-width: 1.2;
}

.band-eol {
  fill: rgba(100, 116, 139, 0.06);
  stroke: rgba(100, 116, 139, 0.25);
  stroke-width: 1.2;
}

/* Точки релизов */
.release-point {
  cursor: pointer;
}

.release-stable {
  fill: var(--lifecycle-danger);
}

.release-patch {
  fill: var(--lifecycle-success);
}

.next-version-label {
  fill: var(--lifecycle-accent);
  font-style: italic;
  opacity: 0.9;
}

.version-label {
  font-size: 14px;
  font-weight: 700;
  fill: var(--lifecycle-primary);
}

/* Легенда и статистика */
.bottom-row {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.legend {
  flex: 1;
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  color: var(--lifecycle-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-dot.stable {
  background: var(--lifecycle-danger);
}

.legend-dot.patch {
  background: var(--lifecycle-success);
}

.legend-rect {
  width: 18px;
  height: 12px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.legend-rect.band-full-support {
  background: rgba(39, 174, 96, 0.12);
  border-color: rgba(39, 174, 96, 0.4);
}

.legend-rect.band-bug-fixes {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.4);
}

.legend-rect.band-security {
  background: rgba(217, 83, 79, 0.1);
  border-color: rgba(217, 83, 79, 0.36);
}

/* Статистика */
.statistics {
  width: calc(100% - 30px);
  background: #f6fbff;
  border-radius: var(--lifecycle-radius);
  padding: 14px;
  border: 1px solid rgba(173, 216, 255, 0.12);
  color: var(--lifecycle-primary);
}

.stats-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.block-title {
  font-weight: 700;
  color: var(--lifecycle-accent);
  margin-bottom: 6px;
}

.life-row {
  font-size: 13px;
  color: var(--lifecycle-muted);
  margin: 4px 0;
}

.num-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.num-item {
  display: flex;
  flex-direction: column;
}

.num-val {
  font-weight: 800;
  font-size: 20px;
  color: var(--lifecycle-primary);
}

.num-label {
  font-size: 12px;
  color: var(--lifecycle-muted);
}

/* Всплывающая подсказка */
.astra-release-tooltip {
  transition: opacity 0.12s ease;
}

.release-details-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #2f80ed 0%, #1e5bb8 100%);
  color: white !important;
  text-decoration: none !important;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(47, 128, 237, 0.2);
  margin-top: 8px;
  width: 100%;
  justify-content: center;
}

.release-details-link:hover {
  background: linear-gradient(135deg, #1e5bb8 0%, #164a9a 100%);
  box-shadow: 0 4px 12px rgba(47, 128, 237, 0.3);
  transform: translateY(-1px);
}

.release-details-link:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(47, 128, 237, 0.2);
}

/* Адаптивность */
@media (max-width: 1400px) {
  .widget-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-right {
    width: 100%;
    align-items: flex-start;
  }

  .toolbar {
    flex-wrap: wrap;
  }
}

@media (max-width: 900px) {
  .widget-container {
    padding: 16px;
  }

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

  .bottom-row {
    gap: 12px;
  }

  .statistics {
    width: 100%;
  }

  .filters-container {
    flex-direction: column;
    align-items: flex-start;
    border: none;
    padding: 0;
  }
}

@media (max-width: 600px) {
  .widget-container {
    padding: 12px;
  }

  .widget-title {
    font-size: 16px;
  }

  .next-update-badge {
    padding: 6px 10px;
    font-size: 12px;
  }

  .toolbar {
    width: 100%;
  }

  .tool-btn {
    font-size: 12px;
    padding: 5px 7px;
  }

  .legend-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
