.custom-p-tabs ::ng-deep .p-tabpanels {
  padding: 0.5rem 0 0 0 !important;
}

.tab-content {
  padding: 0.5rem 0;
}

.dashboard-scroller-infinite {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  padding: 0.5rem;
  gap: 1rem;
  width: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.dashboard-scroller-infinite::-webkit-scrollbar {
  height: 8px;
}

.dashboard-scroller-infinite::-webkit-scrollbar-track {
  background: transparent;
}

.dashboard-scroller-infinite::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.dashboard-scroller-infinite::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary-color);
}

.dashboard-scroller-card {
  width: 115px;
  flex-basis: 115px;
  flex-shrink: 0;
  flex-grow: 0;
  scroll-snap-align: start;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border-radius: 0.5rem;
}

.dashboard-scroller-card:hover {
  transform: translateY(-6px);
}

.dashboard-scroller-card:hover::after {
  opacity: 1;
}

.dashboard-scroller-card::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 10%;
  right: 10%;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
  filter: blur(4px);
}

// Files tab styles
.files-tab-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 0.5rem 0;
}

.files-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;

  &.download-all-section {
    align-items: flex-end;
    margin-bottom: -1.5rem;
    margin-top: 1rem;
  }
}

.files-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.files-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  transition: background 0.2s ease, border-color 0.2s ease;

  &:hover {
    background: var(--highlight-background);
    border-color: var(--primary-color);
  }

  &.primary-file {
    border-left: 3px solid var(--primary-color);
  }
}

.file-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.file-type-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.file-icon {
  font-size: 1.25rem;
  color: var(--text-color-secondary);
  flex-shrink: 0;
}

.file-name {
  font-size: 0.9rem;
  color: var(--text-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.file-size {
  font-size: 0.8rem;
  color: var(--text-color-secondary);
  flex-shrink: 0;
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;

  ::ng-deep .p-button-sm {
    width: 2rem;
    height: 2rem;

    .p-button-icon {
      font-size: 1rem;
    }
  }
}

// Empty state for physical books
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-color-secondary);
}

.empty-state-icon {
  font-size: 3rem;
  color: var(--book-type-physical-color);
  margin-bottom: 1rem;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 0.5rem 0;
}

.empty-state-message {
  font-size: 0.9rem;
  margin: 0 0 0.5rem 0;
  max-width: 400px;
}

.empty-state-hint {
  font-size: 0.8rem;
  font-style: italic;
  margin: 0;
  opacity: 0.8;
}

// Chapters tab styles
.chapters-tab-content {
  padding: 0.5rem 0;
}

.chapters-loading {
  display: flex;
  justify-content: center;
  padding: 2rem;
  font-size: 1.5rem;
  color: var(--text-color-secondary);
}

.chapters-tech-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  color: var(--text-color-secondary);

  .tech-info-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    background: var(--highlight-background);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    white-space: nowrap;

    i {
      font-size: 0.75rem;
      color: var(--primary-color);
    }
  }
}

.chapters-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
}

.chapters-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;

  th, td {
    padding: 0.625rem 0.75rem;
    text-align: left;
  }

  thead tr {
    background: var(--highlight-background);
    border-bottom: 1px solid var(--border-color);
  }

  th {
    font-weight: 600;
    color: var(--text-color-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
  }

  tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s ease;

    &:last-child {
      border-bottom: none;
    }

    &:hover {
      background: var(--highlight-background);
    }
  }

  td {
    color: var(--text-color);
  }

  .chapter-num {
    width: 3rem;
    text-align: center;
    color: var(--text-color-secondary);
  }

  .chapter-title {
    min-width: 10rem;
  }

  .chapter-file {
    min-width: 8rem;
    color: var(--text-color-secondary);
    font-size: 0.8rem;
  }

  .chapter-time {
    width: 6rem;
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-color-secondary);
    white-space: nowrap;
  }
}

.chapters-empty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem;
  justify-content: center;
  color: var(--text-color-secondary);
  font-size: 0.9rem;
}

@media (max-width: 576px) {
  .chapters-table {
    font-size: 0.8rem;

    th, td {
      padding: 0.5rem;
    }

    .chapter-file {
      display: none;
    }

    .chapter-time {
      width: auto;
    }
  }
}

// Covers tab styles
.covers-tab-content {
  padding: 1rem 0;
}

.covers-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;

  @media (min-width: 768px) {
    justify-content: flex-start;
  }
}

.cover-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;

  ::ng-deep .square-cover img {
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 0.5rem;
  }
}

.cover-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary-color);
  padding: 0.25rem 0.75rem;
  background: color-mix(in srgb, var(--primary-color) 15%, transparent);
  border-radius: 0.5rem;

  i {
    font-size: 1rem;
  }

  &.audiobook {
    color: var(--purple-500);
    background: color-mix(in srgb, var(--purple-500) 15%, transparent);
  }
}
