/**
 * YayReviews - Review Display Styles
 */

/* Section */
.yayrev-reviews {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 5rem;
  font-size: 14px;
}

body:not(.theme-brandy) .yayrev-reviews.woocommerce-Reviews form textarea,
body:not(.theme-brandy)
  .yayrev-reviews.woocommerce-Reviews
  form
  input[type="text"],
body:not(.theme-brandy)
  .yayrev-reviews.woocommerce-Reviews
  form
  input[type="email"],
body:not(.theme-brandy)
  .yayrev-reviews.woocommerce-Reviews
  form
  input[type="number"],
body:not(.theme-brandy)
  .yayrev-reviews.woocommerce-Reviews
  form
  input[type="tel"],
body:not(.theme-brandy)
  .yayrev-reviews.woocommerce-Reviews
  form
  input[type="url"],
body:not(.theme-brandy)
  .yayrev-reviews.woocommerce-Reviews
  form
  input[type="search"],
body:not(.theme-brandy)
  .yayrev-reviews.woocommerce-Reviews
  form
  input[type="password"] {
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #d3dce5;
  font: inherit;
  font-feature-settings: inherit;
  font-variation-settings: inherit;
  letter-spacing: inherit;
}

body:not(.theme-brandy) .yayrev-product-media-title,
body:not(.theme-brandy) .woocommerce-Reviews-title,
body:not(.theme-brandy) .yayrev-reviews__form-title,
body:not(.theme-brandy) .yayrev-reviews-list-title {
  font-weight: 700;
}

body:not(.theme-brandy) #reviews .woocommerce-Reviews-title,
body:not(.theme-brandy) #reviews .yayrev-reviews__form-title,
body:not(.theme-brandy) #reviews .yayrev-reviews-list-title {
  margin-bottom: 1rem;
}

#review_form_wrapper #commentform .yayrev-anonymous-field > label,
#review_form_wrapper #commentform .yayrev-gdpr-consent-field > label {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}

body:not(.theme-brandy) .yayrev-review-title-field label,
body:not(.theme-brandy) .yayrev-media-upload-field label,
body:not(.theme-brandy) .comment-form-rating label,
body:not(.theme-brandy) .comment-form-comment label {
  display: inline-block;
  margin-bottom: 0.3rem;
}

body:not(.theme-brandy) .commentlist {
  padding: 0;
}

body:not(.theme-brandy)
  .woocommerce
  #reviews
  #comments
  ol.commentlist
  li
  .comment-text,
.wp-theme-bricks #reviews #comments ol.commentlist li .comment-text {
  padding: 1rem;
}

body:not(.theme-brandy)
  .woocommerce
  #reviews.yayrev-reviews
  #comments
  ol.commentlist
  li,
.wp-theme-bricks #reviews #comments ol.commentlist li {
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #f5f5f5;
}

#reviews.yayrev-reviews #comments ol.commentlist li img.avatar,
.wp-theme-bricks #reviews #comments ol.commentlist li img.avatar {
  padding: 0;
  background: transparent;
  border-radius: 100px;
  height: 44px;
  width: 44px;
  float: unset;
  position: relative;
  margin: 0;
}

.yayrev-reviews .commentlist .children {
  display: none;
}

.yayrev-reviews .comment-header {
  display: flex;
  gap: 1rem;
}

.yayrev-reviews .comment-header__start:empty {
  display: none;
}

.yayrev-reviews .comment-header__end {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.yayrev-reviews .comment-header__end .meta {
  margin: 0;
  order: -1;
}

#reviews.yayrev-reviews .comment-header__end .meta {
  margin-bottom: 0;
}

.yayrev-reviews .comment-header__end .meta .woocommerce-review__author {
  font-weight: 600;
}

.yayrev-reviews .comment-header__end .meta .woocommerce-review__verified,
#reviews.yayrev-reviews .commentlist li p.meta .verified {
  display: none;
}

.yayrev-reviews .yayrev-rating--stars {
  color: #f59e0b;
}

#reviews.yayrev-reviews .comment_container {
  display: block;
}

.yayrev-reviews .comment-body,
.yayrev-reviews .comment-footer {
  margin-top: 1rem;
}

.yayrev-reviews .comment-footer {
  display: flex;
  gap: 1rem;
}

#reviews.yayrev-reviews .description {
  border: 0;
  padding: 0;
}

/* Review Title */
.yayrev-review-title {
  margin: 0 0 0.5em;
  font-size: 1.1em;
  font-weight: 600;
  line-height: 1.3;
  color: #333;
}

/* Verified Badge */
.yayrev-verified-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: #ecfdf5;
  color: #047857;
  font-size: 11px;
  font-weight: 500;
  border-radius: 20px;
}

.yayrev-verified-badge svg {
  flex-shrink: 0;
}

/* Location Badge */
.yayrev-location-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  font-size: 0.75em;
  color: #666;
  font-weight: 400;
  margin-left: 0.5em;
}

/* Review Media */
.yayrev-review-media {
  margin-top: 1em;
}

.yayrev-media-thumbnails {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
}

.yayrev-media-thumb {
  width: 90px;
  height: 90px;
  border-radius: 6px;
  background-color: #f3f4f6;
  outline: 1.5px solid #0000000f;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, outline-color 0.2s ease;
  position: relative;
}

.yayrev-media-thumb:hover {
  outline-color: #0000009b;
}

.yayrev-media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Video Thumbnail */
.yayrev-video-thumb {
  position: relative;
  width: 100%;
  height: 100%;
}

.yayrev-video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.yayrev-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.yayrev-play-icon svg {
  width: 10px;
  height: 10px;
  margin-left: 2px;
}

/* Video Thumbnail Loading States */
.yayrev-thumb-loading {
  position: relative;
}

.yayrev-thumb-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: yayrev-spin 0.8s linear infinite;
  z-index: 2;
}

.yayrev-thumb-loaded img {
  transition: opacity 0.3s ease;
}

@keyframes yayrev-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Media Modal (basic - enhanced in Phase 4) */
.yayrev-media-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.yayrev-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.yayrev-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.yayrev-modal-content {
  max-width: 90vw;
  max-height: 80vh;
}

.yayrev-modal-content img,
.yayrev-modal-content video {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

/* Responsive */
@media (max-width: 480px) {
  .yayrev-media-thumb {
    width: 50px;
    height: 50px;
  }

  .yayrev-review-title {
    font-size: 1em;
  }
}

/* ==========================================
   Pinned/Featured Reviews
   ========================================== */

/* Pinned Review Badge */
.yayrev-pinned-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.yayrev-pinned-badge::before {
  content: "\2605"; /* Star character */
  font-size: 10px;
}

/* Pinned review highlight */
.yayrev-review--pinned,
.comment.yayrev-review--pinned {
  position: relative;
  border-left: 3px solid #f59e0b !important;
  background: linear-gradient(to right, rgba(254, 243, 199, 0.15), transparent) !important;
  padding: 15px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .yayrev-pinned-badge {
    background: linear-gradient(135deg, #78350f, #92400e);
    color: #fef3c7;
  }

  .yayrev-review--pinned,
  .comment.yayrev-review--pinned {
    background: linear-gradient(to right, rgba(120, 53, 15, 0.2), transparent) !important;
  }
}
