/* === Smart Ratings — Base Styles === */
.smart-rating-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 2rem 0;
  font-family: inherit;
  padding: 1rem;
  background-color: #fafafa;
  border: 1px solid #eee;
  border-radius: 8px;
}

.smart-rating {
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.smart-rating span {
  font-size: 2.2rem;
  margin: 0 0.3rem;
  cursor: pointer;
  color: #ccc;
  transition: color 0.3s ease, transform 0.2s ease;
}
.smart-rating span:hover {
  transform: scale(1.15);
  color: #ffc107;
}
.smart-rating span.hovered,
.smart-rating span.selected,
.smart-rating span.readonly-star {
  color: #f5c518;
}
.smart-rating span.readonly-star {
  cursor: default;
  transform: none;
}

/* === Average Display === */
.smart-rating-average {
  font-size: 1.1rem;
  font-weight: 600;
  color: #444;
  background-color: #fff9c4;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: center;
  box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.05);
}

/* === Form === */
#smart-rating-form {
  width: 100%;
  max-width: 380px;
  margin-top: 1rem;
  background: linear-gradient(to bottom, #ffffff, #f8f9fa);
  padding: 1.2rem;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin-left: auto;
  margin-right: auto;  
}

.smart-rating-field {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 0.8rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}
.smart-rating-field:focus {
  border-color: #0073aa;
  box-shadow: 0 0 0 2px rgba(0,115,170,0.2);
  outline: none;
}

.smart-agreement-label {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  margin-bottom: 0.8rem;
}
.smart-agreement-label input {
  margin-right: 0.5rem;
}

.smart-rating-submit-btn {
  width: 100%;
  padding: 0.8rem;
  background: linear-gradient(to right, #0073aa, #0096d6);
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.smart-rating-submit-btn:hover {
  background: linear-gradient(to right, #005f8d, #0083c1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* === Responses & Reviews === */
.smart-rating-response {
  margin-top: 1rem;
  color: #0073aa;
  font-weight: 500;
  text-align: center;
}

.smart-rating-comments {
  width: 100%;
  max-width: 500px;
  margin-top: 2rem;
}
.smart-rating-comments h4 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
  color: #333;
}
.smart-review {
  background: #fff;
  padding: 1rem;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin-bottom: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.smart-review:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.smart-review-stars {
  font-size: 1.2rem;
  color: #f5c518;
  margin-bottom: 0.5rem;
}
.smart-review-author {
  font-weight: 600;
  color: #222;
  margin-bottom: 0.4rem;
}
.smart-review-comment {
  margin: 0.4rem 0 0.8rem;
  color: #444;
}
.smart-review-time {
  font-size: 0.85rem;
  color: #888;
}

/* === Already Rated Box === */
.smart-already-rated-box {
  display: block;
  background: #e6fffa;
  color: #006644;
  padding: 0.8rem 1rem;
  border-left: 4px solid #48c9b0;
  border-radius: 4px;
  margin: 0.5rem;
  max-width: 380px;
  font-weight: 500;
  width: fit-content;
}
[dir="rtl"] .smart-already-rated-box {
  border-right: 4px solid #48c9b0;
  border-left: unset;
}
.smart-already-rated-box .dashicons {
  vertical-align: middle;
  margin: 0 0.5rem;
}

/* === Login Prompt === */
.sr-login-prompt {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  padding: 12px;
  border-radius: 4px;
  margin: 20px 0;
  font-size: 14px;
}
.sr-login-prompt a {
  color: #ff6f00;
  text-decoration: underline;
  white-space: nowrap;
}

/* === Average Only Display (shortcode) === */
.smart-rating-average-only {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  margin-top: .5em;
  font-size: .9em;
}
.smart-rating-average-only .average-text {
  font-weight: bold;
}
.smart-rating-average-only .average-stars {
  color: #FFD700;
  font-size: 1.2em;
}

---

/* 🌙 === DARK MODE SUPPORT === */
@media (prefers-color-scheme: dark) {
  .smart-rating-container {
    background-color: #1e1e1e;
    border-color: #333;
  }
  .smart-rating span {
    color: #666;
  }
  .smart-rating span.readonly-star,
  .smart-rating span.hovered,
  .smart-rating span.selected {
    color: #ffd700;
  }
  .smart-rating-average {
    background-color: #333;
    color: #f5f5f5;
  }
  #smart-rating-form {
    background: #2a2a2a;
    border-color: #444;
  }
  .smart-rating-field {
    background: #222;
    color: #eee;
    border-color: #444;
  }
  .smart-review {
    background: #2a2a2a;
    color: #ddd;
  }
  .smart-review-comment,
  .smart-review-time {
    color: #aaa;
  }
  .sr-login-prompt {
    background: #333;
    border-color: #555;
    color: #fff3cd;
  }
}


.smart-popup-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.smart-popup-box {
  background: #fff;
  padding: 1.5rem 2rem;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  max-width: 360px;
  width: 90%;
  animation: popin 0.2s ease;
}

@keyframes popin {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.popup-actions {
  margin-top: 1.2rem;
}

.smart-popup-btn {
  padding: 0.6rem 1.2rem;
  margin: 0 0.4rem;
  border: none;
  border-radius: 6px;
  background-color: #0073aa;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.smart-popup-btn.cancel {
  background-color: #aaa;
}

.smart-popup-btn:hover {
  background-color: #005f8d;
}
