/**
 * Front-end styles for the Airism Marketplace Reviews widget.
 * Tabbed design with Shopee and Lazada marketplace support
 */

/* Reset & Base */
.pmr-widget {
  padding: clamp(2rem, 4vw, 4rem);
  background-color: #ffffff;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #0f172a;
}

/* Widget Title */
.pmr-widget__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: #0f2554;
  margin: 0 0 2rem 0;
  letter-spacing: -0.02em;
  text-align: center;
}

/* ==================== TABS ==================== */
.pmr-tabs {
  margin-bottom: 1.5rem;
}

.pmr-tabs__list {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.pmr-tabs__list::-webkit-scrollbar {
  display: none;
}

.pmr-tabs__tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 200ms ease;
  white-space: nowrap;
  font-family: inherit;
}

.pmr-tabs__tab:hover {
  background: #ffffff;
}

.pmr-tabs__tab.is-active {
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.pmr-tabs__icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
}

.pmr-tabs__icon--all {
  color: #6b7280;
}

.pmr-tabs__icon--shopee {
  width: 18px !important;
  height: 18px !important;
}

.pmr-tabs__icon--lazada {
  width: 28px !important;
  height: 28px !important;
}

.pmr-tabs__icon--shopee svg,
.pmr-tabs__icon--lazada svg {
  border-radius: 4px;
}

.pmr-tabs__label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #374151;
}

.pmr-tabs__rating {
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
}

/* ==================== RATING FILTER TABS ==================== */
.pmr-rating-filters {
  margin-bottom: 2.5rem;
}

.pmr-rating-filters__list {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex-wrap: wrap;
}

.pmr-rating-filters__list::-webkit-scrollbar {
  display: none;
}

.pmr-rating-filters__tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: transparent;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  transition: all 200ms ease;
  white-space: nowrap;
  font-family: inherit;
  font-size: 0.875rem;
}

.pmr-rating-filters__tab:hover {
  background: #ffffff;
  transform: translateY(-1px);
}

.pmr-rating-filters__tab.is-active {
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-weight: 600;
  transform: translateY(-1px);
}

.pmr-rating-filters__stars {
  color: #fbbf24;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
}

.pmr-rating-filters__label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

.pmr-rating-filters__tab.is-active .pmr-rating-filters__label {
  font-weight: 600;
  color: #111827;
}

.pmr-rating-filters__count {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  background: #e5e7eb;
  padding: 0.125rem 0.5rem;
  border-radius: 12px;
  min-width: 1.5rem;
  text-align: center;
}

.pmr-rating-filters__tab.is-active .pmr-rating-filters__count {
  background: #3b82f6;
  color: #ffffff;
}

/* ==================== TAB SUMMARY ==================== */
.pmr-tab-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.pmr-tab-summary__info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pmr-tab-summary__marketplace {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pmr-tab-summary__icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pmr-tab-summary__icon svg {
  width: 24px;
  height: 24px;
  border-radius: 4px;
}

.pmr-tab-summary__title {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
}

.pmr-tab-summary__rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pmr-tab-summary__score {
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
  line-height: 1;
}

.pmr-tab-summary__stars {
  display: flex;
  gap: 2px;
}

.pmr-tab-summary__stars .pmr-star {
  font-size: 1.25rem;
  color: #fbbf24;
}

.pmr-tab-summary__count {
  font-size: 0.9rem;
  color: #6b7280;
}

.pmr-tab-summary__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #1d4ed8;
  color: #ffffff !important;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  transition: all 200ms ease;
}

.pmr-tab-summary__cta:hover {
  background: #1e40af;
}

.pmr-tab-summary__cta [data-pmr-cta-name] {
  color: #ffffff !important;
}

.pmr-tab-summary__cta--shopee {
  background: #EE4D2D;
  color: #ffffff !important;
}

.pmr-tab-summary__cta--shopee:hover {
  background: #d73211;
}

.pmr-tab-summary__cta--lazada {
  background: #0F146D;
  color: #ffffff !important;
}

.pmr-tab-summary__cta--lazada:hover {
  background: #0a0f52;
}

/* ==================== STAR STYLES ==================== */
.pmr-star {
  font-size: 1.25rem;
  color: #d1d5db;
}

.pmr-star--filled {
  color: #fbbf24;
}

.pmr-star--half {
  color: #fbbf24;
  opacity: 0.5;
}

/* ==================== CAROUSEL ==================== */
.pmr-carousel {
  position: relative;
  overflow: visible;
  padding: 0 50px;
}

.pmr-carousel__track {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 0 2rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.pmr-carousel__track::-webkit-scrollbar {
  display: none;
}

/* Carousel Navigation Arrows */
.pmr-carousel__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #374151;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 200ms ease;
  z-index: 10;
  padding: 0;
}

.pmr-carousel__nav:hover {
  background: #f8fafc;
  border-color: #d1d5db;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.pmr-carousel__nav--prev {
  left: 0;
}

.pmr-carousel__nav--next {
  right: 0;
}

.pmr-carousel__nav svg {
  width: 20px;
  height: 20px;
}

.pmr-carousel__nav svg path {
  color: #374151 !important;
}

/* ==================== REVIEW CARD (New Design) ==================== */
.pmr-review-card {
  flex: 0 0 calc(20% - 1rem);
  min-width: 240px;
  max-width: 280px;
  background: #ffffff;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  border: 1px solid #e5e7eb;
  transition: box-shadow 200ms ease;
}

.pmr-review-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.pmr-review-card__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.pmr-review-card__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #e0e7ff;
}

.pmr-review-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pmr-review-card__meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.pmr-review-card__author {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.pmr-review-card__name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pmr-review-card__badge {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pmr-review-card__badge svg {
  width: 14px;
  height: 14px;
}

.pmr-review-card__badge--shopee svg {
  border-radius: 3px;
}

.pmr-review-card__badge--lazada svg {
  border-radius: 3px;
}

.pmr-review-card__date {
  margin-top: -7px;
  font-size: 0.8rem;
  color: #6b7280;
}

.pmr-review-card__stars {
  display: flex;
  gap: 2px;
  margin-bottom: 0.75rem;
}

.pmr-review-card__stars .pmr-star {
  font-size: 1rem;
}

.pmr-review-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

.pmr-review-card__text {
  font-size: 0.875rem;
  line-height: 1.5;
  color: #4b5563;
  margin: 0 0 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.pmr-review-card__readmore {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: #3b82f6;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

/* ==================== CAROUSEL DOTS ==================== */
.pmr-carousel__dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.pmr-carousel__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background-color: #d1d5db;
  cursor: pointer;
  transition: all 200ms ease;
  padding: 0;
}

.pmr-carousel__dot:hover {
  background-color: #9ca3af;
}

.pmr-carousel__dot.is-active {
  background-color: #3b82f6;
  width: 20px;
  border-radius: 999px;
}

/* ==================== LEGACY STYLES (kept for compatibility) ==================== */
.pmr-widget__filters {
  display: none;
}

.pmr-widget__placeholder {
  margin: 0;
  color: #475569;
  text-align: center;
  padding: 2rem;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
  .pmr-review-card {
    flex: 0 0 calc(25% - 1rem);
  }
}

@media (max-width: 1024px) {
  .pmr-review-card {
    flex: 0 0 calc(33.333% - 1rem);
  }
}

@media (max-width: 768px) {
  .pmr-tabs__list {
    justify-content: flex-start;
  }

  .pmr-tab-summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .pmr-tab-summary__cta {
    width: 100%;
    justify-content: center;
  }

  .pmr-review-card {
    flex: 0 0 calc(50% - 0.75rem);
    min-width: 200px;
  }

  .pmr-carousel {
    padding: 0 40px;
  }
}

@media (max-width: 480px) {
  .pmr-widget {
    padding: 1.5rem;
  }

  .pmr-widget__title {
    font-size: 1.5rem;
  }

  .pmr-tabs__tab {
    padding: 0.5rem 0.75rem;
  }

  .pmr-tabs__label {
    display: none;
  }

  .pmr-review-card {
    flex: 0 0 calc(100% - 0.5rem);
    min-width: 260px;
  }

  .pmr-carousel {
    padding: 0 35px;
  }

  .pmr-carousel__nav {
    width: 32px;
    height: 32px;
  }

  .pmr-carousel__nav svg {
    width: 16px;
    height: 16px;
  }
}
