/* Кольцевой прогресс, shimmer-эффект, состояние передачи */

/* SVG кольцо прогресса */
.progress-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.progress-ring svg {
  transform: rotate(-90deg);
}

.progress-ring__track {
  fill: none;
  stroke: rgba(14, 110, 126, 0.12);
  stroke-width: 4;
}

.progress-ring__fill {
  fill: none;
  stroke: rgba(14, 110, 126, 0.85);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 283; /* 2π × r(45) ≈ 283 */
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 0.5s var(--ease-ios);
}

.progress-ring__fill.sending {
  stroke: #00b894;
}

.progress-ring__fill.receiving {
  stroke: #0984e3;
}

/* Центральный контент кольца */
.progress-ring__content {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.progress-ring__percent {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
}

.progress-ring__label {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Shimmer на прогресс-баре */
.progress-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(14, 110, 126, 0.12);
  overflow: hidden;
  width: 100%;
}

.progress-bar__fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    rgba(14, 110, 126,0.5) 0%,
    rgba(14, 110, 126,0.85) 40%,
    rgba(14, 110, 126,0.5) 80%,
    rgba(14, 110, 126,0.7) 100%
  );
  background-size: 200% auto;
  animation: shimmer 2s linear infinite;
  transition: width var(--duration-fast) linear;
}

/* Карточка передачи */
.transfer-card {
  width: 100%;
  max-width: 360px;
  padding: var(--spacing-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-lg);
  animation: slide-up var(--duration-normal) var(--ease-ios);
}

.transfer-card--inline {
  max-width: 620px;
  padding: 16px;
  flex-direction: row;
  align-items: center;
  gap: 16px;
}

.transfer-card--inline .progress-ring {
  flex: 0 0 82px;
  width: 82px;
  height: 82px;
}

.transfer-card--inline .progress-ring svg {
  width: 82px;
  height: 82px;
}

.transfer-card--inline .progress-ring__percent {
  font-size: 15px;
}

.transfer-card--inline .progress-ring__label {
  font-size: 9px;
}

.transfer-info {
  text-align: center;
  width: 100%;
}

.transfer-card--inline .transfer-info {
  min-width: 0;
  text-align: left;
}

.transfer-info__eyebrow {
  margin-bottom: 3px;
  color: var(--text-accent);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
}

.transfer-info__filename {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.transfer-info__size {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.transfer-info__status {
  min-height: 18px;
  margin-bottom: var(--spacing-md);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.transfer-stats {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  width: 100%;
  margin-top: var(--spacing-sm);
}

.transfer-stats__speed {
  color: var(--text-primary);
  font-weight: 500;
}

.transfer-card--inline .connection-type-indicator,
.transfer-complete-card .connection-type-indicator {
  margin-left: 0;
  margin-right: 0;
}

.transfer-card__cancel {
  flex-shrink: 0;
}

.transfer-complete-card {
  width: 100%;
  max-width: 620px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.transfer-complete-card__icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: rgba(30, 165, 138, 0.14);
  border: 1px solid rgba(30, 165, 138, 0.24);
  font-size: 24px;
}

.transfer-complete-card__body {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
}

.transfer-complete-card__title {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.2;
}

.transfer-complete-card__name {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transfer-complete-card__meta {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.3;
}

.transfer-complete-card__action {
  flex-shrink: 0;
}

/* Индикатор типа соединения */
.connection-type-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  margin: var(--spacing-sm) auto 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-secondary);
  padding: 6px 11px;
  border-radius: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-ios),
              background var(--duration-fast) var(--ease-ios),
              border-color var(--duration-fast) var(--ease-ios);
}

.connection-type-indicator:hover {
  transform: translateY(-1px);
  background: var(--glass-bg-hover);
}

.connection-type-indicator:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.connection-type-indicator__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}

.connection-type-indicator__label {
  min-width: 0;
}

.connection-type-indicator.direct {
  color: var(--text-success);
  border-color: rgba(0, 184, 148, 0.3);
}

.connection-type-indicator.direct .connection-type-indicator__dot {
  background: var(--text-success);
}

.connection-type-indicator.relay {
  color: var(--text-warning);
  border-color: rgba(225, 112, 85, 0.3);
}

.connection-type-indicator.relay .connection-type-indicator__dot {
  background: var(--text-warning);
}

@media (max-width: 560px) {
  .transfer-card--inline,
  .transfer-complete-card {
    align-items: stretch;
    flex-direction: column;
  }

  .transfer-card--inline .transfer-info,
  .transfer-complete-card__body {
    text-align: center;
  }

  .transfer-card--inline .connection-type-indicator,
  .transfer-complete-card .connection-type-indicator {
    margin-left: auto;
    margin-right: auto;
  }

  .transfer-card__cancel,
  .transfer-complete-card__action {
    width: 100%;
  }
}
