/* ============================================
   Alibandana - Reviews System Styles
   سیستم نظرات و امتیازدهی محصولات
   ============================================ */

/* === Helper: renderStars() output === */
.star-icon { display: inline-block; width: 18px; height: 18px; vertical-align: middle; }
.star-icon svg { width: 100%; height: 100%; }
.star-icon.filled svg { fill: #f5a623; stroke: #f5a623; }
.star-icon.empty svg { fill: none; stroke: #d0d0d0; }
.star-icon.half svg { fill: url(#half-gradient); stroke: #f5a623; }

/* === Rating Summary on Product Page === */
.detail-rating-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.detail-stars { display: flex; gap: 2px; }
.detail-rating-text {
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
}
.detail-rating-text strong { color: #333; font-size: 15px; }
.detail-rating-count { color: #999; }

/* === Reviews Section === */
.reviews-section {
    margin-top: 60px;
    padding: 0 0 40px;
}
.reviews-container { max-width: 100%; }
.reviews-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}
.reviews-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
}

/* === Rating Overview === */
.rating-overview {
    display: flex;
    align-items: center;
    gap: 32px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 28px;
}
.rating-overview-score {
    text-align: center;
    min-width: 100px;
}
.rating-big-number {
    display: block;
    font-size: 48px;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1;
}
.rating-big-stars { margin: 8px 0; display: flex; gap: 2px; justify-content: center; }
.rating-big-stars .star-icon { width: 22px; height: 22px; }
.rating-total-count { font-size: 13px; color: #888; }

.rating-bars { flex: 1; }
.rating-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.rating-bar-label {
    font-size: 12px;
    color: #666;
    min-width: 52px;
    text-align: left;
}
.rating-bar-track {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}
.rating-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f5a623, #f7c948);
    border-radius: 4px;
    transition: width 0.6s ease;
}
.rating-bar-count {
    font-size: 12px;
    color: #888;
    min-width: 28px;
    text-align: right;
}

/* === Review Card === */
.reviews-list { display: flex; flex-direction: column; gap: 16px; }
.review-card {
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 20px;
    transition: box-shadow 0.2s;
}
.review-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
.review-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.review-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}
.review-user-info { flex: 1; }
.review-user-name { font-weight: 600; font-size: 14px; color: #333; }
.review-date { font-size: 12px; color: #999; }
.review-stars { display: flex; gap: 1px; }
.review-stars .star-icon { width: 14px; height: 14px; }
.review-title { font-weight: 700; font-size: 15px; color: #1a1a2e; margin-bottom: 6px; }
.review-text { font-size: 14px; color: #555; line-height: 1.8; }

.review-pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}
.review-pros, .review-cons {
    border-radius: 8px;
    padding: 12px;
    font-size: 13px;
}
.review-pros { background: #f0fdf4; border: 1px solid #bbf7d0; }
.review-cons { background: #fef2f2; border: 1px solid #fecaca; }
.review-pros h4, .review-cons h4 {
    font-size: 12px;
    margin-bottom: 6px;
    font-weight: 700;
}
.review-pros h4 { color: #16a34a; }
.review-cons h4 { color: #dc2626; }
.review-pros li, .review-cons li {
    list-style: none;
    padding: 2px 0;
    color: #444;
}
.review-pros li::before { content: "+ "; color: #16a34a; font-weight: 700; }
.review-cons li::before { content: "- "; color: #dc2626; font-weight: 700; }

/* Admin Reply */
.review-admin-reply {
    margin-top: 14px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 14px;
    border-right: 3px solid #f59e0b;
}
.review-admin-reply-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #b45309;
}
.review-admin-reply-body {
    font-size: 13px;
    color: #78350f;
    line-height: 1.7;
}

/* === Review Form === */
.review-form-wrapper {
    position: sticky;
    top: 100px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #eee;
    height: fit-content;
}
.review-form-title { font-size: 16px; font-weight: 700; margin-bottom: 20px; color: #1a1a2e; }
.review-login-prompt {
    text-align: center;
    padding: 40px 24px;
}
.review-login-prompt svg { color: #ccc; margin-bottom: 12px; }
.review-login-prompt h3 { font-size: 16px; margin-bottom: 8px; }
.review-login-prompt p { font-size: 13px; color: #888; margin-bottom: 20px; }

/* Star Select */
.star-select { display: flex; gap: 4px; direction: ltr; }
.star-select-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    transition: transform 0.15s;
}
.star-select-btn:hover { transform: scale(1.2); }
.star-select-btn svg { fill: none; stroke: #d0d0d0; transition: fill 0.15s, stroke 0.15s; }
.star-select-btn.active svg,
.star-select-btn.hovered svg { fill: #f5a623; stroke: #f5a623; }

/* Form Elements */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #333; }
.form-label .required { color: #e74c3c; }
.form-input, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.form-input:focus, .form-textarea:focus { outline: none; border-color: #667eea; box-shadow: 0 0 0 3px rgba(102,126,234,0.1); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { display: block; font-size: 11px; color: #999; margin-top: 4px; }
.review-form-msg {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
}
.review-form-msg-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.review-form-msg-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.review-note { font-size: 11px; color: #aaa; text-align: center; margin-top: 12px; }

/* Pagination */
.reviews-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}
.reviews-pagination button {
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    transition: all 0.2s;
}
.reviews-pagination button:hover { border-color: #667eea; color: #667eea; }
.reviews-pagination button.active { background: #667eea; color: #fff; border-color: #667eea; }
.reviews-pagination button:disabled { opacity: 0.4; cursor: default; }

/* No Reviews */
.reviews-empty {
    text-align: center;
    padding: 40px 20px;
    color: #aaa;
}
.reviews-empty svg { margin-bottom: 12px; }
.reviews-empty p { font-size: 14px; }

/* === Responsive === */
@media (max-width: 900px) {
    .reviews-layout { grid-template-columns: 1fr; }
    .review-form-wrapper { position: static; }
    .rating-overview { flex-direction: column; text-align: center; gap: 20px; }
    .review-pros-cons { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .rating-overview { padding: 16px; }
    .rating-big-number { font-size: 36px; }
    .review-card { padding: 14px; }
    .reviews-header { flex-direction: column; align-items: flex-start; }
}