/**
 * Sidebar Review Widget Styles
 *
 * Styles for the customer testimonials sidebar widget
 */

/* ===============================================
   Sidebar Review Container
   =============================================== */
.review-sticky {
  background: #000;
  color: #fff;
  padding: 10px 15px;
  border-radius: 12px 12px 0 0;
  font-size: 14px;
  font-weight: 600;
  border: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-150%) rotate(-90deg);
  transform-origin: 100% 100%;
  z-index: 999;
}

.sidebar-review {
  position: fixed;
  top: 0;
  left: -100%;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  background: #fff;
  box-shadow: 2px 0 24px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transition: left 0.3s ease;
  overflow: hidden;
}

.sidebar-review.active {
  left: 0;
}

/* RTL Support */
[dir="rtl"] .sidebar-review {
  left: auto;
  right: -100%;
}

[dir="rtl"] .sidebar-review.active {
  right: 0;
}

/* ===============================================
   Sidebar Header
   =============================================== */

.sidebar-review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  background: var(--gradient-primary, linear-gradient(135deg, #e2ae9c, #d74273));
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-review-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}

.sidebar-review-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.sidebar-review-close:hover {
  opacity: 0.8;
}

/* ===============================================
   Tab Navigation
   =============================================== */

.sidebar-review-nav {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  background: #f8f9fa;
  border-bottom: 2px solid #e9ecef;
}

.sidebar-review-nav li {
  flex: 1;
}

.sidebar-review-nav a {
  display: block;
  padding: 15px 20px;
  text-align: center;
  text-decoration: none;
  color: #6c757d;
  font-weight: 500;
  transition: all 0.2s ease;
  border-bottom: 3px solid transparent;
  background: transparent;
}

.sidebar-review-nav li.active a {
  color: var(--color-primary, #d74273);
  background: #fff;
  border-bottom-color: var(--color-primary, #d74273);
}

.sidebar-review-nav a:hover {
  background: #fff;
  color: var(--color-primary, #d74273);
}

/* ===============================================
   Tab Content
   =============================================== */

.sidebar-review-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.sidebar-review-pane {
  display: none;
}

.sidebar-review-pane.active {
  display: block;
}

/* ===============================================
   Review Summary
   =============================================== */

.review-summary {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: linear-gradient(135deg, #fff5f7, #ffe5ec);
  border-radius: 12px;
  margin-bottom: 24px;
  border: 1px solid var(--color-blush-light, #ffe5ea);
}

.review-summary-rating {
  font-size: 48px;
  font-weight: 700;
  color: var(--color-primary, #d74273);
  line-height: 1;
  min-width: 60px;
}

.review-summary-details {
  flex: 1;
}

.review-summary-count {
  margin-top: 8px;
  font-size: 14px;
  color: #6c757d;
}

/* ===============================================
   Rating Display
   =============================================== */

.rating-wrapper {
  position: relative;
  display: inline-flex;
  gap: 2px;
  font-size: 20px;
}

.rating-empty,
.rating-filled {
  display: flex;
  gap: 2px;
}

.rating-empty {
  color: #ddd;
}

.rating-filled {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  color: #ffc107;
}

[dir="rtl"] .rating-filled {
  left: auto;
  right: 0;
}

/* ===============================================
   Review Form Section
   =============================================== */

.review-form-section {
  margin-bottom: 32px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
}

.review-form-title {
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-dark, #303030);
}

.review-form-section .form-group {
  margin-bottom: 16px;
}

.review-form-section .form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #495057;
}

.review-form-section .form-label.required::after {
  content: " *";
  color: #dc3545;
}

.review-form-section .form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ced4da;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.review-form-section .form-control:focus {
  outline: none;
  border-color: var(--color-primary, #d74273);
  box-shadow: 0 0 0 3px rgba(215, 66, 115, 0.1);
}

.review-form-section textarea.form-control {
  min-height: 100px;
  resize: vertical;
  font-family: inherit;
}

/* ===============================================
   Star Rating Input
   =============================================== */

.form-rating {
  display: flex;
  flex-direction: row-reverse;
  gap: 8px;
  justify-content: flex-end;
}

.form-rating input[type="radio"] {
  display: none;
}

.form-rating label {
  font-size: 32px;
  color: #ddd;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
  margin: 0;
  line-height: 1;
}

.form-rating label:hover,
.form-rating label:hover~label {
  color: #ffc107;
  transform: scale(1.1);
}

.form-rating input[type="radio"]:checked~label {
  color: #ffc107;
}

.form-rating[data-rating="5"] label:nth-child(2),
.form-rating[data-rating="5"] label:nth-child(2)~label,
.form-rating[data-rating="4"] label:nth-child(4),
.form-rating[data-rating="4"] label:nth-child(4)~label,
.form-rating[data-rating="3"] label:nth-child(6),
.form-rating[data-rating="3"] label:nth-child(6)~label,
.form-rating[data-rating="2"] label:nth-child(8),
.form-rating[data-rating="2"] label:nth-child(8)~label,
.form-rating[data-rating="1"] label:nth-child(10) {
  color: #ffc107;
}

/* ===============================================
   Form Action
   =============================================== */

.form-action {
  margin-top: 20px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.button-fill-primary {
  background: var(--gradient-primary, linear-gradient(135deg, #e2ae9c, #d74273));
  color: #fff;
}

.button-fill-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(215, 66, 115, 0.3);
}

.button-fill-primary:active {
  transform: translateY(0);
}

.button-fill-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.button-block {
  display: flex;
  width: 100%;
}

/* ===============================================
   Form Messages
   =============================================== */

#site-review-message {
  margin-top: 16px;
}

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-danger {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* ===============================================
   Review List Section
   =============================================== */

.review-list-section {
  margin-top: 24px;
}

.review-list-title {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-dark, #303030);
}

.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ===============================================
   Comment Card Styles (for sidebar)
   =============================================== */

.sidebar-review .comment-card {
  padding: 16px;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  margin-bottom: 12px;
  transition: box-shadow 0.2s ease;
}

.sidebar-review .comment-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sidebar-review .comment-card-header {
  margin-bottom: 12px;
}

.sidebar-review .comment-card-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: #6c757d;
}

.sidebar-review .comment-card-author {
  font-weight: 600;
  color: var(--color-dark, #303030);
}

.sidebar-review .comment-card-time {
  color: #6c757d;
}

.sidebar-review .comment-card-body {
  font-size: 14px;
  line-height: 1.6;
  color: #495057;
}

.sidebar-review .comment-card-desc {
  margin: 0;
}

.sidebar-review .rating-wrapper {
  font-size: 14px;
}

.comment-product-link {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e9ecef;
  font-size: 13px;
}

.comment-product-link a {
  color: var(--color-primary, #d74273);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.comment-product-link a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ===============================================
   Empty State
   =============================================== */

.review-empty {
  padding: 40px 20px;
  text-align: center;
  color: #6c757d;
  background: #f8f9fa;
  border-radius: 8px;
}

.review-empty p {
  margin: 0;
  font-size: 15px;
}

/* ===============================================
   Responsive Design
   =============================================== */

@media (max-width: 576px) {
  .sidebar-review {
    max-width: 100%;
  }

  .sidebar-review-header {
    padding: 15px;
  }

  .sidebar-review-title {
    font-size: 18px;
  }

  .sidebar-review-nav a {
    padding: 12px 10px;
    font-size: 14px;
  }

  .sidebar-review-content {
    padding: 15px;
  }

  .review-summary {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .review-summary-rating {
    font-size: 36px;
  }

  .form-rating label {
    font-size: 28px;
  }
}

/* ===============================================
   Scrollbar Styling
   =============================================== */

.sidebar-review-content::-webkit-scrollbar {
  width: 6px;
}

.sidebar-review-content::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.sidebar-review-content::-webkit-scrollbar-thumb {
  background: var(--color-secondary, #ce927e);
  border-radius: 3px;
}

.sidebar-review-content::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary, #d74273);
}

/* ===============================================
   Overlay (optional - for backdrop)
   =============================================== */

.sidebar-review-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  display: none;
  transition: opacity 0.3s ease;
}

.sidebar-review-overlay.active {
  display: block;
}