.series-progress-container {
  width: 100%;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;

  .chart-title {
    flex: 1;
    min-width: 200px;

    h3 {
      color: var(--text-color, #ffffff);
      font-size: 1.25rem;
      font-weight: 500;
      margin: 0 0 0.5rem 0;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .chart-description {
      color: var(--text-secondary-color);
      font-size: 0.9rem;
      margin: 0;
      line-height: 1.4;
    }
  }

  .series-summary {
    display: flex;
    gap: 0.5rem;

    .summary-item {
      display: flex;
      align-items: center;
      gap: 0.35rem;
      padding: 0.35rem 0.6rem;
      border-radius: 16px;
      font-size: 0.8rem;
      font-weight: 600;

      i {
        font-size: 0.75rem;
      }

      &.completed {
        background: rgba(76, 175, 80, 0.2);
        color: #4caf50;
      }

      &.in-progress {
        background: rgba(255, 193, 7, 0.2);
        color: #ffc107;
      }

      &.not-started {
        background: rgba(158, 158, 158, 0.2);
        color: #9e9e9e;
      }
    }
  }
}

.series-icon {
  font-size: 1.5rem;
  color: #673ab7;
}

.stats-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;

  .stat-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);

    .pill-value {
      font-size: 1rem;
      font-weight: 600;
      color: var(--text-color, #ffffff);
    }

    .pill-label {
      font-size: 0.75rem;
      color: var(--text-secondary-color);
    }

    &.highlight {
      background: rgba(103, 58, 183, 0.15);
      border-color: rgba(103, 58, 183, 0.3);

      .pill-value {
        color: #673ab7;
      }
    }
  }
}

.chart-wrapper {
  height: 300px;
  width: 100%;
  margin-bottom: 1rem;
}

.series-details {
  .details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;

    h4 {
      color: var(--text-color, #ffffff);
      font-size: 0.95rem;
      font-weight: 500;
      margin: 0;
    }

    .series-count {
      font-size: 0.75rem;
      color: var(--text-secondary-color);
      background: rgba(255, 255, 255, 0.08);
      padding: 0.25rem 0.5rem;
      border-radius: 4px;
    }
  }

  .controls-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;

    .search-box {
      flex: 1;
      min-width: 150px;
      max-width: 250px;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.4rem 0.65rem;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 6px;

      i {
        color: var(--text-secondary-color);
        font-size: 0.8rem;
      }

      input {
        flex: 1;
        background: transparent;
        border: none;
        outline: none;
        color: var(--text-color, #ffffff);
        font-size: 0.8rem;
        font-family: inherit;

        &::placeholder {
          color: var(--text-secondary-color);
        }
      }
    }

    .filter-controls {
      display: flex;
      gap: 0.5rem;

      .filter-select,
      .sort-select {
        padding: 0.4rem 0.5rem;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 6px;
        color: var(--text-color, #ffffff);
        font-size: 0.75rem;
        font-family: inherit;
        cursor: pointer;
        outline: none;

        option {
          background: #1e1e1e;
          color: #ffffff;
        }

        &:hover {
          border-color: rgba(255, 255, 255, 0.25);
        }

        &:focus {
          border-color: #673ab7;
        }
      }
    }
  }

  .series-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 360px;
    overflow-y: auto;

    &::-webkit-scrollbar {
      width: 4px;
    }

    &::-webkit-scrollbar-track {
      background: rgba(255, 255, 255, 0.05);
      border-radius: 2px;
    }

    &::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.2);
      border-radius: 2px;
    }

    .no-results {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
      padding: 1.5rem;
      color: var(--text-secondary-color);
      font-size: 0.85rem;

      i {
        opacity: 0.5;
      }
    }
  }

  .pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);

    .page-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 28px;
      height: 28px;
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 6px;
      color: var(--text-color, #ffffff);
      cursor: pointer;
      transition: all 0.2s ease;

      i {
        font-size: 0.7rem;
      }

      &:hover:not(:disabled) {
        background: rgba(103, 58, 183, 0.3);
        border-color: #673ab7;
      }

      &:disabled {
        opacity: 0.4;
        cursor: not-allowed;
      }
    }

    .page-info {
      font-size: 0.75rem;
      color: var(--text-secondary-color);
      min-width: 80px;
      text-align: center;
    }
  }

  .series-card {
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid;

    &.completed {
      border-left-color: #4caf50;
    }

    &.in-progress {
      border-left-color: #ffc107;
    }

    &.not-started {
      border-left-color: #9e9e9e;
    }

    &.abandoned {
      border-left-color: #ef5350;
    }

    .series-main {
      display: flex;
      align-items: flex-start;
      gap: 0.5rem;
      margin-bottom: 0.35rem;

      .series-status-icon {
        font-size: 0.9rem;
        margin-top: 0.1rem;
      }

      .series-info {
        flex: 1;
        min-width: 0;

        .series-name {
          display: block;
          font-size: 0.9rem;
          font-weight: 500;
          color: var(--text-color, #ffffff);
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
        }

        .series-meta {
          display: flex;
          align-items: center;
          gap: 0.75rem;
          margin-top: 0.2rem;

          .books-count {
            font-size: 0.75rem;
            color: var(--text-secondary-color);

            .total-hint {
              opacity: 0.7;
            }
          }

          .rating {
            display: flex;
            align-items: center;
            gap: 0.2rem;
            font-size: 0.75rem;
            color: #ffc107;

            i {
              font-size: 0.65rem;
            }
          }
        }
      }
    }

    .series-progress {
      display: flex;
      align-items: center;
      gap: 0.5rem;

      .progress-bar-container {
        flex: 1;
        height: 6px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 3px;
        overflow: hidden;
        position: relative;

        .progress-bar {
          position: absolute;
          top: 0;
          height: 100%;
          border-radius: 3px;
          transition: width 0.3s ease;

          &.read {
            left: 0;
            background: linear-gradient(90deg, #4caf50, #66bb6a);
          }

          &.reading {
            background: #ffc107;
          }
        }
      }

      .progress-text {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--text-color, #ffffff);
        min-width: 32px;
        text-align: right;
      }
    }

    .next-up {
      margin-top: 0.35rem;
      padding-top: 0.3rem;
      border-top: 1px dashed rgba(255, 255, 255, 0.1);
      font-size: 0.7rem;

      .next-label {
        color: var(--text-secondary-color);
        margin-right: 0.35rem;
      }

      .next-title {
        color: #673ab7;
        font-weight: 500;
      }
    }
  }
}

.no-data-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  text-align: center;
  color: var(--text-secondary-color);

  i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
  }

  p {
    font-size: 0.95rem;
    margin: 0 0 0.35rem 0;
    color: var(--text-color, #ffffff);
  }

  small {
    font-size: 0.8rem;
    opacity: 0.7;
  }
}

@media (max-width: 768px) {
  .chart-header {
    .series-summary {
      width: 100%;
      justify-content: flex-start;
    }
  }

  .stats-row {
    .stat-pill {
      flex: 1;
      min-width: 80px;
      justify-content: center;
    }
  }

  .chart-wrapper {
    height: 240px;
  }

  .series-details {
    .controls-row {
      flex-direction: column;

      .search-box {
        max-width: none;
      }

      .filter-controls {
        width: 100%;

        .filter-select,
        .sort-select {
          flex: 1;
        }
      }
    }
  }
}

@media (max-width: 480px) {
  .chart-header {
    .chart-title {
      h3 {
        font-size: 1.05rem;
      }

      .chart-description {
        font-size: 0.8rem;
      }
    }

    .series-summary {
      .summary-item {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
      }
    }
  }

  .stats-row {
    gap: 0.5rem;

    .stat-pill {
      padding: 0.4rem 0.6rem;

      .pill-value {
        font-size: 0.9rem;
      }

      .pill-label {
        font-size: 0.7rem;
      }
    }
  }

  .series-details {
    .series-card {
      padding: 0.5rem 0.65rem;

      .series-main {
        .series-info {
          .series-name {
            font-size: 0.85rem;
          }
        }
      }
    }
  }
}
