/**
 * Reviews Widget Styles
 * Path: public_html/css/reviews.css
 * Version: 1.0.5
 * 
 * Changelog v1.0.1:
 * - Fixed dark mode appearing on light mode
 * - Explicit background colors on all elements
 * - Dark mode uses body.dark-mode class instead of media query
 */

/* Reviews Widget Container */
.reviews-widget {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 16px;
    overflow: hidden;
}

/* Reviews Section */
.reviews-section {
    padding: 0;
    background: #fff;
}

.reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}

.reviews-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
}

.reviews-summary {
    display: flex;
    align-items: center;
    gap: 6px;
}

.avg-rating {
    font-size: 16px;
    font-weight: 600;
    color: #1a202c;
}

.stars {
    color: #fbbf24;
    font-size: 14px;
    letter-spacing: -1px;
}

.review-count {
    font-size: 13px;
    color: #64748b;
}

/* Reviews List */
.reviews-list {
    max-height: 400px;
    overflow-y: auto;
    background: #fff;
}

/* Individual Review */
.review-item {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
}

.review-item:last-child {
    border-bottom: none;
}

.review-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.reviewer-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.reviewer-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.reviewer-name {
    font-weight: 600;
    color: #1a202c;
    font-size: 14px;
}

.review-date {
    font-size: 12px;
    color: #64748b;
}

.review-rating {
    color: #fbbf24;
    font-size: 12px;
    letter-spacing: -1px;
}

.review-text {
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
    margin: 0 0 10px 0;
    word-wrap: break-word;
}

/* Pros/Cons Display */
.review-pros-cons {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.review-pros-cons .pros,
.review-pros-cons .cons {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 13px;
}

.review-pros-cons .pros {
    color: #16a34a;
}

.review-pros-cons .cons {
    color: #dc2626;
}

.pros-cons-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

/* Write Review Button */
.write-review-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 16px;
    background: #1976D2;
    color: white;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.write-review-btn:hover {
    background: #1565C0;
}

.write-review-btn svg {
    flex-shrink: 0;
}

/* When reviews exist, button has rounded bottom corners */
.reviews-section + .write-review-btn {
    border-radius: 0 0 12px 12px;
}

/* When no reviews, button has all rounded corners */
.reviews-widget > .write-review-btn:first-child {
    border-radius: 12px;
}

/* Review Form Section */
.review-form-section {
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

.form-header {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 18px;
    font-weight: 700;
    color: #1a202c;
    background: #fff;
}

.review-form {
    padding: 16px;
    background: #fff;
}

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

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

.review-form .form-label .optional {
    font-weight: 400;
    color: #94a3b8;
}

/* Pros/Cons Label Colors */
.review-form .form-label.pros-label {
    color: #16a34a;
}

.review-form .form-label.cons-label {
    color: #dc2626;
}

/* Star Rating Input */
.star-rating-input {
    display: flex;
    gap: 8px;
}

.star-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #d1d5db;
    transition: color 0.15s, transform 0.1s;
    padding: 0;
    line-height: 1;
}

.star-btn.active {
    color: #fbbf24;
}

.star-btn:hover {
    color: #fbbf24;
    transform: scale(1.1);
}

/* Star rating error state */
.star-rating-input.error {
    padding: 8px;
    margin: -8px;
    border-radius: 8px;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

/* Form Inputs */
.review-form .form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
    background: #fff;
    color: #1a202c;
}

.review-form .form-input:focus-visible {
    outline: 2px solid #2196F3;
    outline-offset: 2px;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.review-form .form-input.error {
    border-color: #dc2626;
}

.review-form .form-input::placeholder {
    color: #9ca3af;
}

.review-form textarea.form-input {
    min-height: 100px;
    resize: vertical;
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

.char-count.warning {
    color: #f59e0b;
}

.char-count.error {
    color: #dc2626;
}

/* Email Notice */
.email-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: #eff6ff;
    border-radius: 8px;
    margin-bottom: 16px;
}

.email-notice svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.email-notice-text {
    font-size: 13px;
    color: #1e40af;
    line-height: 1.4;
}

/* Form Error */
.form-error {
    padding: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    font-size: 14px;
    margin-bottom: 16px;
    white-space: pre-line;
    line-height: 1.5;
}

/* Submit Button */
.submit-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: #1976D2;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
}

.submit-btn:hover {
    background: #1565C0;
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.submit-btn.loading {
    position: relative;
    color: transparent;
}

.submit-btn.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: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Success Message */
.review-success {
    padding: 32px 16px;
    text-align: center;
    background: #fff;
}

.success-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    background: #dcfce7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #16a34a;
}

.review-success-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a202c;
}

.review-success p {
    margin: 0;
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
}

/* Honeypot field - hidden */
.hp-field {
    position: absolute;
    left: -9999px;
    height: 0;
    overflow: hidden;
}

/* Dark Mode Support - using body.dark-mode class */
body.dark-mode .reviews-widget {
    background: #1e293b;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

body.dark-mode .reviews-section,
body.dark-mode .reviews-header,
body.dark-mode .reviews-list,
body.dark-mode .review-item,
body.dark-mode .review-form-section,
body.dark-mode .form-header,
body.dark-mode .review-form,
body.dark-mode .review-success {
    background: #1e293b;
}

body.dark-mode .reviews-header {
    border-bottom-color: #334155;
}

body.dark-mode .reviews-title,
body.dark-mode .avg-rating,
body.dark-mode .reviewer-name,
body.dark-mode .form-header {
    color: #f1f5f9;
}

body.dark-mode .review-count,
body.dark-mode .review-date {
    color: #94a3b8;
}

body.dark-mode .review-item {
    border-bottom-color: #334155;
}

body.dark-mode .review-text {
    color: #cbd5e1;
}

body.dark-mode .review-form .form-label {
    color: #e2e8f0;
}

body.dark-mode .review-form .form-input {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

body.dark-mode .review-form .form-input::placeholder {
    color: #64748b;
}

body.dark-mode .review-form .form-input:focus {
    border-color: #2196F3;
}

body.dark-mode .email-notice {
    background: #1e3a5f;
}

body.dark-mode .email-notice-text {
    color: #93c5fd;
}

body.dark-mode .form-error {
    background: #450a0a;
    border-color: #7f1d1d;
}

body.dark-mode .review-success-title {
    color: #f1f5f9;
}

body.dark-mode .review-success p {
    color: #94a3b8;
}

body.dark-mode .review-form-section {
    border-top-color: #334155;
}

body.dark-mode .star-btn {
    color: #4b5563;
}

body.dark-mode .star-btn.active,
body.dark-mode .star-btn:hover {
    color: #fbbf24;
}

body.dark-mode .star-rating-input.error {
    background: #450a0a;
    border-color: #7f1d1d;
}

/* Responsive */
@media (max-width: 480px) {
    .reviews-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .star-btn {
        font-size: 24px;
    }
    
    .reviewer-avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
}