// Payment Timeline Component Styles

.arraysubs-payment-timeline {
  background: #fff;
  border: 1px solid #ccd0d4;
  border-radius: 4px;
  overflow: hidden;

  // Compact mode - no border/background when wrapped in detail-card
  &--compact {
    background: transparent;
    border: none;
    border-radius: 0;

    .timeline-content {
      padding: 0;
    }
  }

  .timeline-loading {
    padding: 30px;
    text-align: center;
    color: #666;
  }

  .timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #f9f9f9;
    border-bottom: 1px solid #ccd0d4;
    cursor: pointer;
    user-select: none;

    &:hover {
      background: #f1f1f1;
    }

    &__title {
      display: flex;
      align-items: center;
      gap: 10px;

      h3 {
        margin: 0;
        font-size: 16px;
        font-weight: 600;
      }
    }

    &__count {
      color: #666;
      font-size: 14px;
      font-weight: normal;
    }

    &__toggle {
      background: none;
      border: none;
      padding: 4px;
      cursor: pointer;
      color: #666;
      display: flex;
      align-items: center;
      justify-content: center;

      &:hover {
        color: #333;
      }
    }
  }

  .timeline-content {
    padding: 20px;
  }

  .timeline-empty {
    text-align: center;
    color: #666;
    padding: 20px;
    margin: 0;
  }

  .timeline-events {
    position: relative;
  }

  .timeline-event {
    display: flex;
    gap: 15px;
    position: relative;
    padding-bottom: 20px;

    &:last-child {
      padding-bottom: 0;

      .timeline-event__line {
        display: none;
      }
    }

    &__marker {
      display: flex;
      flex-direction: column;
      align-items: center;
      flex-shrink: 0;
    }

    &__icon {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      background: #f0f0f0;
      color: #666;
      z-index: 1;
    }

    &__line {
      width: 2px;
      flex: 1;
      background: #ddd;
      margin-top: 8px;
      min-height: 20px;
    }

    &__content {
      flex: 1;
      min-width: 0;
      padding-top: 4px;
    }

    &__header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 10px;
      margin-bottom: 4px;
      flex-wrap: wrap;
    }

    &__title {
      font-weight: 600;
      font-size: 14px;
      color: #1e1e1e;
    }

    &__date {
      font-size: 12px;
      color: #666;
      white-space: nowrap;
    }

    &__description {
      margin: 0 0 8px;
      font-size: 13px;
      color: #555;
      line-height: 1.5;
      word-break: break-word;
    }

    &__link {
      font-size: 12px;
      color: #2271b1;
      text-decoration: none;

      &:hover {
        text-decoration: underline;
      }
    }

    // Status variations
    &--success {
      .timeline-event__icon {
        background: #d4edda;
        color: #155724;
      }
    }

    &--error {
      .timeline-event__icon {
        background: #f8d7da;
        color: #721c24;
      }
    }

    &--warning {
      .timeline-event__icon {
        background: #fff3cd;
        color: #856404;
      }
    }

    &--pending {
      .timeline-event__icon {
        background: #fef5e7;
        color: #d68910;
      }
    }

    &--info {
      .timeline-event__icon {
        background: #d1ecf1;
        color: #0c5460;
      }
    }
  }

  .timeline-show-more {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #2271b1;
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;

    &:hover {
      background: #f0f0f0;
      border-color: #2271b1;
    }
  }
}

// Responsive adjustments
@media (max-width: 600px) {
  .arraysubs-payment-timeline {
    .timeline-event {
      gap: 10px;

      &__header {
        flex-direction: column;
        gap: 4px;
      }

      &__icon {
        width: 28px;
        height: 28px;
      }
    }
  }
}
