.book-reviews-container {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  min-height: 250px;

  .reviews-content {
    flex: 1;
    padding-right: 60px;
    height: 100%;
    overflow: hidden;
  }

  .action-bar {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 50px;
    z-index: 1000;
    pointer-events: none;

    .action-buttons {
      display: flex;
      flex-direction: column;
      gap: 8px;
      padding: 16px 8px;
      background: rgba(0, 0, 0, 0.1);
      border-radius: 8px;
      border: 1px solid rgba(255, 255, 255, 0.2);
      backdrop-filter: blur(8px);
      pointer-events: auto;
      position: relative;
      top: -50%;

      .action-btn {
        width: 34px;
        height: 34px;

        ::ng-deep {
          .p-button {
            width: 100%;
            height: 100%;
            padding: 0;

            .p-button-icon {
              margin: 0;
            }
          }
        }
      }
    }
  }
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  gap: 1rem;
}

.loading-text {
  color: #9ca3af;
}

.empty-state {
  position: relative;
  padding: 3rem !important;
  text-align: center;
  color: #9ca3af;

  .empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #e5e7eb;
  }

  .empty-state-subtitle {
    max-width: 400px;
    margin: 0.5rem auto 0;
    line-height: 1.6;
    font-size: 0.875rem;
    color: #9ca3af;

    &--warning {
      color: #fbbf24;
    }
  }

  .empty-state-decoration {
    position: absolute;
    top: 20%;
    right: 15%;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    filter: blur(40px);
    animation: float 4s ease-in-out infinite;
  }
}

.reviews-scroll-container {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
  height: 100%;

  &::-webkit-scrollbar {
    height: 8px;
  }

  &::-webkit-scrollbar-track {
    background: var(--surface-ground);
    border-radius: 4px;
  }

  &::-webkit-scrollbar-thumb {
    background: var(--surface-border);
    border-radius: 4px;

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

.reviews-horizontal-list {
  display: flex;
  gap: 1rem;
  padding: 0.5rem;
}

.review-card {
  width: 500px;
  height: 250px;
  flex-shrink: 0;
  padding: 0;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--p-content-border-color);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  @media (max-width: 768px) {
    width: 340px;
    height: 220px;
  }

  @media (max-width: 480px) {
    width: 290px;
    height: 200px;
  }

  &:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--primary-color), transparent 50%);

    .action-btn-hover {
      opacity: 1;
      transform: scale(1);
    }
  }

  &.no-title {
    .review-content-area {
      height: calc(100% - 80px);
    }
  }

  &.has-spoiler {
    .review-content-area {
      pointer-events: none;
    }

    &::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.3);
      z-index: 50;
      pointer-events: none;
    }
  }

  .review-header {
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(40, 40, 40, 0.8), rgba(30, 30, 30, 0.8));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;

    .review-header-inner {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      padding: 0.75rem;
    }

    .reviewer-info-group {
      display: flex;
      flex-direction: column;
      gap: 0.25rem;
    }

    .reviewer-name-row {
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .reviewer-name {
      max-width: 120px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      background: linear-gradient(135deg, #f8fafc, #e2e8f0);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
      font-weight: 500;
      font-size: 0.875rem;
    }

    .review-meta {
      display: flex;
      align-items: center;
      opacity: 0.8;

      i {
        color: #3b82f6;
      }
    }

    .review-meta-icon {
      font-size: 0.75rem;
      margin-right: 0.25rem;
    }

    .review-meta-text {
      font-size: 0.875rem;
      color: #9ca3af;
    }

    .review-actions {
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .rating-wrapper {
      display: flex;
      align-items: center;
      gap: 0.25rem;
    }

    .rating-text {
      font-size: 0.875rem;
      font-weight: 500;
    }

    .lock-icon-container {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 2rem;
      height: 2rem;
    }

    .lock-icon {
      color: #f59e0b;
      font-size: 0.875rem;
    }

    .action-btn-hover {
      opacity: 0.7;
      transition: all 0.3s ease;
      transform: scale(0.9);

      ::ng-deep .p-button {
        border-radius: 8px;

        &:hover {
          transform: scale(1.1);
        }
      }
    }
  }

  .review-title-section {
    flex-shrink: 0;
    border-bottom: 1px solid var(--surface-border);
    padding: 8px 16px 4px 16px;
  }

  .review-content-area {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 8px 16px 16px 16px;

    .review-fade-overlay {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      height: 30px;
      background: linear-gradient(transparent, rgba(20, 20, 20, 0.9));
      pointer-events: none;
    }
  }

  .spoiler-overlay-button {
    position: absolute;
    top: 62%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    pointer-events: auto;
  }
}

.review-title {
  max-width: 450px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: help;
  font-weight: 500;
  font-size: 1.25rem;
  color: #e5e7eb;
  line-height: 1.25;
  margin: 0;

  &--blurred {
    filter: blur(4px);
    margin-bottom: 0.5rem;
  }
}

.review-body {
  flex: 1;
  min-height: 0;
  max-height: 210px;
  overflow-y: auto;
  word-wrap: break-word;
  white-space: pre-wrap;
  box-sizing: border-box;
  color: #d4d4d8;

  &--blurred {
    filter: blur(4px);
  }

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

  &::-webkit-scrollbar-track {
    background: var(--surface-ground);
    border-radius: 2px;
  }

  &::-webkit-scrollbar-thumb {
    background: var(--surface-border);
    border-radius: 2px;

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

.review-empty-text {
  color: #a1a1aa;
  font-style: italic;
  font-size: 0.875rem;

  &--blurred {
    filter: blur(4px);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}
