/**
 * KSM Review Collector Styles
 * Based on Trustindex widget styling
 */

/* Main Widget Container */
.ksm-widget {
  margin: 2rem 0;

}

.ksm-widget-container {
  background-color: #f9f9f9;
  padding: 2rem;
  border-radius: 8px;
}

/* Header Section */
.ksm-widget-header {
  margin-bottom: 2rem;
  background-color:#444;
}

/* Platform Tabs */
.ksm-platform-tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #e0e0e0;
}

.ksm-platform-tab-items {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ksm-tab-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
  user-select: none;
}

.ksm-tab-item:hover {
  border-bottom-color: #ccc;
}

.ksm-tab-item.ksm-tab-active {
  border-bottom-color: #2196F3;
  font-weight: 600;
}

.ksm-platform-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.ksm-item-label {
  font-size: 14px;
  color: #ffffff;
}

/* Header Content */
.ksm-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.ksm-header-rating {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ksm-stars {
  display: flex;
  gap: 0.2rem;
}

.ksm-star {
  font-size: 30px;
  color: #ddd;
}

.ksm-star.f {
  color: #FFA500;
}

.ksm-header-rating-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.ksm-header-rating-text strong {
  font-size: 35px;
  color: #fff;
}

.ksm-header-rating-reviews {
  font-size: 20px;
  color: #ffffff;
}

/* Write Review Button */
.ksm-header-write-btn-container {
  position: relative;
}

.ksm-header-write-btn {
  background-color: #2196F3;
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.ksm-header-write-btn:hover {
  background-color: #1976D2;
}

.ksm-write-btn-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  min-width: 200px;
}

.ksm-write-btn-dropdown.ksm-dropdown-active {
  display: block;
}

.ksm-write-btn-dropdown-inner {
  padding: 0.5rem 0;
}

.ksm-write-btn-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1.2rem;
  text-decoration: none;
  color: #333;
  transition: background-color 0.2s ease;
}

.ksm-write-btn-dropdown-item:hover {
  background-color: #f5f5f5;
}

.ksm-write-btn-dropdown-item img {
  width: 16px;
  height: 16px;
}

/* Reviews Container */
.ksm-reviews-container-wrapper {
  position: relative;
  margin-bottom: 2rem;
}

.ksm-reviews-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.ksm-col-3 .ksm-reviews-container {
  grid-template-columns: repeat(3, 1fr);
}

.ksm-col-1 .ksm-reviews-container {
  grid-template-columns: 1fr;
}

/* Review Card */
.ksm-review-item {
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ksm-review-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ksm-review-item[data-source]:not([data-source="all"]) {
  display: none;
}

.ksm-review-item[data-source="all"],
.ksm-tab-item.ksm-tab-active[data-source="all"] ~ .ksm-reviews-container .ksm-review-item {
  display: block;
}

/* Review Header */
.ksm-review-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: start;
}

.ksm-profile-img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  background-color: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ksm-profile-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ksm-profile-default {
  font-size: 20px;
  font-weight: 600;
  color: #666;
}

.ksm-profile-details {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.ksm-name {
  font-weight: 600;
  font-size: 15px;
  color: #333;
}

.ksm-profile-details .ksm-stars {
  font-size: 16px;
}

.ksm-verified-review {
  display: inline-block;
  color: #4CAF50;
  font-size: 14px;
  font-weight: 600;
}

.ksm-date {
  font-size: 12px;
  color: #999;
  text-align: right;
}

/* Review Content */
.ksm-review-content {
  margin-top: 1rem;
}

.ksm-review-text-container {
  position: relative;
}

.ksm-inner {
  line-height: 1.6;
  color: #555;
}

.ksm-inner p {
  margin: 0 0 0.5rem 0;
}

.ksm-read-more {
  color: #2196F3;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
  display: inline-block;
}

.ksm-read-more:hover {
  text-decoration: underline;
}

/* Slider Controls */
.ksm-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.ksm-arrow-prev,
.ksm-arrow-next {
  width: 40px;
  height: 40px;
  background-color: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.ksm-arrow-prev::before,
.ksm-arrow-next::before {
  content: '';
  width: 10px;
  height: 10px;
  border-top: 2px solid #333;
  border-right: 2px solid #333;
  display: block;
}

.ksm-arrow-prev::before {
  transform: rotate(-135deg);
  margin-left: 3px;
}

.ksm-arrow-next::before {
  transform: rotate(45deg);
  margin-right: 3px;
}

.ksm-arrow-prev:hover,
.ksm-arrow-next:hover {
  background-color: #2196F3;
  border-color: #2196F3;
}

.ksm-arrow-prev:hover::before,
.ksm-arrow-next:hover::before {
  border-color: #fff;
}

.ksm-controls-line {
  display: flex;
  gap: 0.5rem;
}

.dot {
  width: 10px;
  height: 10px;
  background-color: #ddd;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s ease;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  touch-action: manipulation;
}

.dot.ksm-active {
  background-color: #2196F3;
}

/* Verified Badge */
.ksm-verified-by {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid #e0e0e0;
}

.ksm-verified-by-row {
  font-size: 12px;
  color: #999;
  margin-bottom: 0.5rem;
}

.ksm-view-all-reviews {
  display: inline-block;
  color: #2196F3;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease;
}

.ksm-view-all-reviews:hover {
  color: #1976D2;
  text-decoration: underline;
}

/* Platform Review Badges */
.ksm-platform-badges {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 2rem 0;
}

.ksm-platform-badge {
  flex: 1 1 calc(33.333% - 1rem);
  min-width: 250px;
}

.ksm-platform-badge-link {
  display: block;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.ksm-platform-badge-link:hover {
  transform: translateY(-2px);
}

.ksm-platform-badge-content {
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  transition: box-shadow 0.2s ease;
}

.ksm-platform-badge-link:hover .ksm-platform-badge-content {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ksm-platform-badge-name {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin-bottom: 0.75rem;
}

.ksm-platform-badge-stats {
  font-size: 14px;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ksm-platform-badge-count {
  font-weight: 600;
  color: #2196F3;
}

.ksm-platform-badge-separator {
  color: #ccc;
}

.ksm-platform-badge-rating {
  color: #666;
}

/* List View Styles */
.ksm-reviews-list-wrapper {
  margin: 2rem 0;
}

.ksm-list-header {
  background-color: #444444;
  padding: 2rem;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.ksm-list-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.ksm-reviews-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.ksm-review-list-item {
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 2rem;
}

.ksm-review-list-header {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.ksm-review-list-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  background-color: #e0e0e0;
  flex-shrink: 0;
}

.ksm-review-list-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ksm-avatar-default {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
  color: #666;
}

.ksm-review-list-meta {
  flex: 1;
}

.ksm-review-author {
  margin: 0 0 0.5rem 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.ksm-review-rating {
  display: flex;
  gap: 0.2rem;
  margin-bottom: 0.5rem;
}

.ksm-star {
  font-size: 18px;
  color: #ddd;
}

.ksm-star.filled {
  color: #FFA500;
}

.ksm-review-source {
  font-size: 13px;
  color: #999;
}

.ksm-review-list-content {
  font-size: 15px;
  line-height: 1.6;
  color: #555;
}

/* List View Pagination */
.ksm-review-hidden {
  display: none;
}

.ksm-load-more-container {
  text-align: center;
  margin-top: 2rem;
}

.ksm-load-more-btn {
  background-color: #2196F3;
  color: #fff;
  border: none;
  padding: 14px 32px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.ksm-load-more-btn:hover {
  background-color: #1976D2;
}

/* Reviews Summary Badge */
.ksm-reviews-summary-wrapper {
  margin: 2rem 0;
}

.ksm-summary-title {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: #333;
}

.ksm-summary-title a {
  color: #333;
  text-decoration: none;
  transition: color 0.3s ease;
}

.ksm-summary-title a:hover {
  color: #2196F3;
}

.ksm-reviews-summary-badge {
  display: inline-block;
}

.ksm-summary-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1.2rem;
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ksm-summary-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: #2196F3;
}

.ksm-summary-stars {
  display: flex;
  gap: 0.15rem;
}

.ksm-summary-star {
  font-size: 20px;
  color: #ddd;
}

.ksm-summary-star.filled {
  color: #FFA500;
}

.ksm-summary-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 15px;
  color: #333;
}

.ksm-summary-rating {
  font-weight: 600;
  font-size: 18px;
}

.ksm-summary-separator {
  color: #999;
}

.ksm-summary-count {
  color: #666;
}

/* Responsive Styles */
@media (max-width: 992px) {
  .ksm-widget-container {
    padding: 1.5rem;
  }

  .ksm-reviews-container {
    grid-template-columns: 1fr;
  }

  .ksm-col-2 .ksm-reviews-container,
  .ksm-col-3 .ksm-reviews-container {
    grid-template-columns: 1fr;
  }

  .ksm-platform-tab-items {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .ksm-header-content {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .ksm-widget-container {
    padding: 1rem;
  }

  .ksm-platform-badges {
    flex-direction: column;
  }

  .ksm-platform-badge {
    flex: 1 1 100%;
    min-width: 100%;
  }

  .ksm-review-header {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }

  .ksm-date {
    grid-column: 1 / -1;
    text-align: left;
    margin-top: 0.5rem;
  }

  .ksm-review-list-header {
    flex-direction: column;
  }

  .ksm-review-list-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto;
  }

  .ksm-write-btn-dropdown {
    right: auto;
    left: 0;
    min-width: 100%;
  }
  .ksm-stars {
  display: block;
  text-align: center;
  width: 100%;
}
.ksm-header-rating {
  display: block;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}
}
