/**
 * Custom Review System - Frontend Styles
 * 
 * @package Commerce_Elite
 */

/* ============================================
   REVIEWS SECTION WRAPPER
   ============================================ */

.ce-reviews-section-wrapper {
    margin-top: 4rem;
    padding: 3rem 1rem;
    background: #f9fafb;
    border-radius: 12px;
}

/* ============================================
   REVIEWS SECTION
   ============================================ */

.ce-reviews-section {
    max-width: 1280px;
    margin: 0 auto;
}

.ce-reviews-heading {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: #111827;
}

/* ============================================
   REVIEW SUMMARY (2-COLUMN)
   ============================================ */

.ce-review-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
    padding: 2rem;
    background: #f9fafb;
    border-radius: 12px;
}

/* LEFT: Rating Summary */
.ce-rating-summary {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ce-overall-rating {
    text-align: center;
}

.ce-rating-number {
    font-size: 3.5rem;
    font-weight: 700;
    color: #111827;
    line-height: 1;
}

.ce-rating-stars {
    margin: 0.5rem 0;
}

.ce-rating-text {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Rating Bars */
.ce-rating-bars {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ce-rating-bar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ce-bar-label {
    min-width: 40px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.ce-bar-track {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.ce-bar-fill {
    height: 100%;
    background: #fbbf24;
    transition: width 0.3s ease;
}

.ce-bar-percentage {
    min-width: 45px;
    text-align: right;
    font-size: 0.875rem;
    color: #6b7280;
}

.ce-recommend-stat {
    padding: 1rem;
    background: #ecfdf5;
    border-radius: 8px;
    text-align: center;
    color: #065f46;
    font-size: 0.875rem;
}

.ce-recommend-stat strong {
    font-size: 1.25rem;
    color: #047857;
}

/* RIGHT: Trust & Actions */
.ce-trust-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
}

.ce-trust-badges {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ce-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.ce-badge-icon {
    font-size: 1.25rem;
}

.ce-badge-text {
    font-size: 0.875rem;
    color: #374151;
}

.ce-badge-text strong {
    color: #111827;
}

.ce-write-review-btn {
    padding: 1rem 2rem;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.ce-write-review-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* ============================================
   REVIEW FILTERS
   ============================================ */

.ce-review-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.ce-filters-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.ce-filters-left label {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.ce-filter-buttons {
    display: flex;
    gap: 0.5rem;
}

.ce-filter-btn {
    padding: 0.5rem 1rem;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.ce-filter-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.ce-filter-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

.ce-checkbox-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
}

.ce-filters-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ce-sort-select {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
}

/* ============================================
   REVIEW CARDS
   ============================================ */

.ce-reviews-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ce-reviews-loading {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

.ce-no-reviews,
.ce-no-reviews-filtered {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

.ce-review-card {
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: box-shadow 0.2s;
}

.ce-review-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Review Header */
.ce-review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.ce-reviewer-info {
    flex: 1;
}

.ce-reviewer-name {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.ce-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    margin-left: 0.5rem;
    background: #dcfce7;
    color: #166534;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
}

.ce-featured-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    margin-left: 0.5rem;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
}

.ce-review-meta {
    margin-top: 0.25rem;
    font-size: 0.813rem;
    color: #6b7280;
}

.ce-separator {
    margin: 0 0.5rem;
}

/* Stars */
.ce-stars {
    display: inline-flex;
    gap: 0.125rem;
}

.ce-stars-small {
    font-size: 0.875rem;
}

.ce-stars-medium {
    font-size: 1rem;
}

.ce-stars-large {
    font-size: 1.25rem;
}

.ce-star-full {
    color: #fbbf24;
}

.ce-star-half {
    color: #fbbf24;
    opacity: 0.5;
}

.ce-star-empty {
    color: #d1d5db;
}

/* Review Content */
.ce-review-content {
    margin-bottom: 1rem;
}

.ce-review-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.75rem;
}

.ce-review-text {
    font-size: 0.938rem;
    line-height: 1.6;
    color: #374151;
}

.ce-read-more-btn,
.ce-read-less-btn {
    background: none;
    border: none;
    color: #3b82f6;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    margin-left: 0.25rem;
}

.ce-read-more-btn:hover,
.ce-read-less-btn:hover {
    text-decoration: underline;
}

/* Media */
.ce-review-media {
    margin: 1rem 0;
}

.ce-review-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
    max-width: 330px;
}

.ce-review-image-link {
    position: relative;
    display: block;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s;
}

.ce-review-image-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ce-review-image-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ce-review-image-lazy {
    background: #f3f4f6;
}

.ce-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    color: white;
}

.ce-review-image-link:hover .ce-image-overlay {
    opacity: 1;
}

.ce-review-video {
    position: relative;
    margin-top: 0.5rem;
    max-width: 400px;
}

.ce-review-video video {
    width: 100%;
    border-radius: 8px;
    background: #000;
}

.ce-video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 1rem 2rem;
    background: rgba(59, 130, 246, 0.9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.ce-video-play-btn:hover {
    background: rgba(37, 99, 235, 1);
    transform: translate(-50%, -50%) scale(1.05);
}

/* Lightbox */
.ce-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s;
}

.ce-lightbox.active {
    opacity: 1;
}

.ce-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(4px);
}

.ce-lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.ce-lightbox-content img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.ce-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.ce-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.ce-lightbox-prev,
.ce-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.ce-lightbox-prev {
    left: 1rem;
}

.ce-lightbox-next {
    right: 1rem;
}

.ce-lightbox-prev:hover,
.ce-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
}

.ce-lightbox-counter {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 20px;
    font-size: 0.875rem;
}

.ce-review-variant {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #f9fafb;
    border-radius: 6px;
}

.ce-review-variant small {
    font-size: 0.813rem;
    color: #6b7280;
}

/* Review Actions */
.ce-review-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.ce-helpful-actions {
    display: flex;
    gap: 0.5rem;
}

.ce-helpful-btn {
    padding: 0.5rem 0.75rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.813rem;
    cursor: pointer;
    transition: all 0.2s;
}

.ce-helpful-btn:hover {
    background: #e5e7eb;
}

.ce-helpful-btn.voted {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1e40af;
}

.ce-report-btn {
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    font-size: 0.813rem;
    color: #6b7280;
    cursor: pointer;
    margin-left: auto;
}

.ce-report-btn:hover {
    color: #ef4444;
}

/* Admin Reply */
.ce-admin-reply {
    margin-top: 1rem;
    padding: 1rem;
    background: #f0f9ff;
    border-left: 3px solid #3b82f6;
    border-radius: 6px;
}

.ce-reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.ce-reply-header strong {
    font-size: 0.875rem;
    color: #1e40af;
}

.ce-reply-date {
    font-size: 0.75rem;
    color: #6b7280;
}

.ce-reply-content {
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.6;
}

/* ============================================
   LOAD MORE
   ============================================ */

.ce-load-more-wrap {
    text-align: center;
    margin-top: 2rem;
}

.ce-load-more-btn {
    padding: 0.75rem 2rem;
    background: #fff;
    border: 2px solid #3b82f6;
    color: #3b82f6;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.ce-load-more-btn:hover {
    background: #3b82f6;
    color: #fff;
}

/* ============================================
   REVIEW MODAL
   ============================================ */

.ce-review-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.ce-review-modal.active {
    display: block;
}

.ce-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.ce-modal-content {
    position: relative;
    max-width: 600px;
    margin: 2rem auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.ce-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.ce-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #111827;
}

.ce-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
}

.ce-modal-close:hover {
    color: #111827;
}

.ce-modal-body {
    padding: 1.5rem;
}

/* Form Styles */
.ce-form-group {
    margin-bottom: 1.5rem;
}

.ce-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
}

.ce-form-required label::after {
    content: ' *';
    color: #ef4444;
}

.ce-form-group input[type="text"],
.ce-form-group input[type="email"],
.ce-form-group textarea,
.ce-form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.938rem;
    transition: border-color 0.2s;
}

.ce-form-group input:focus,
.ce-form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ce-form-group small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.ce-char-count {
    float: right;
}

/* Star Rating Input */
.ce-star-rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 0.25rem;
}

.ce-star-rating-input input[type="radio"] {
    display: none;
}

.ce-star-rating-input label {
    font-size: 2rem;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.2s;
}

.ce-star-rating-input input[type="radio"]:checked ~ label,
.ce-star-rating-input label:hover,
.ce-star-rating-input label:hover ~ label {
    color: #fbbf24;
}

/* Checkbox */
.ce-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.ce-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Form Actions */
.ce-form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.ce-submit-review-btn {
    flex: 1;
    padding: 0.875rem 2rem;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.ce-submit-review-btn:hover {
    background: #2563eb;
}

.ce-submit-review-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.ce-cancel-btn {
    padding: 0.875rem 2rem;
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
}

.ce-cancel-btn:hover {
    background: #f9fafb;
}

/* Form Messages */
.ce-form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 6px;
    display: none;
}

.ce-form-message.success {
    display: block;
    background: #dcfce7;
    color: #166534;
}

.ce-form-message.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
}

.ce-error-message {
    padding: 1rem;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 6px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .ce-review-summary {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .ce-review-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ce-filters-left,
    .ce-filters-right {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ce-filter-buttons {
        flex-wrap: wrap;
    }
    
    .ce-modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
    
    .ce-form-actions {
        flex-direction: column;
    }
}