/* WooCommerce Product Reviews Display Styles */

.wc-product-reviews-container {
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Main Title */
.wc-product-reviews-title {
    color: #e67e22;
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 30px 0;
    text-align: center;
}

/* Summary Section */
.wc-product-reviews-summary {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    position: relative;
}

/* Average Rating Section */
.wc-product-reviews-average {
    text-align: center;
    min-width: 120px;
}

.wc-product-reviews-average-rating {
    font-size: 48px;
    font-weight: bold;
    color: #333;
    line-height: 1;
    margin-bottom: 10px;
}

.wc-product-reviews-stars {
    margin-bottom: 8px;
}

.wc-product-reviews-count {
    font-size: 14px;
    color: #666;
}

/* Star Ratings */
.wc-product-reviews-stars-container {
    display: inline-flex;
    align-items: center;
}

.wc-product-reviews-star {
    font-size: 20px;
    margin-right: 2px;
    color: #ddd;
}

.wc-product-reviews-star.filled {
    color: #ffd700;
}

.wc-product-reviews-star.half-filled {
    color: #ffd700;
    position: relative;
}

.wc-product-reviews-star.half-filled::after {
    content: '★';
    position: absolute;
    left: 0;
    top: 0;
    width: 50%;
    overflow: hidden;
    color: #ddd;
}

.wc-product-reviews-star.empty {
    color: #ddd;
}

/* Rating Breakdown */
.wc-product-reviews-breakdown {
    flex: 1;
    margin-left: 40px;
}

.wc-product-reviews-rating-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.wc-product-reviews-rating-row .wc-product-reviews-star {
    font-size: 16px;
    color: #ffd700;
    margin-right: 10px;
    min-width: 16px;
}

.wc-product-reviews-progress-bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    margin: 0 10px;
    overflow: hidden;
}

.wc-product-reviews-progress-fill {
    height: 100%;
    background: #192330;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.wc-product-reviews-count-number {
    min-width: 20px;
    text-align: right;
    color: #666;
    font-weight: 500;
}

/* Write Review Button */
.wc-product-reviews-write-review {
    position: absolute;
    top: -65px;
    right: 20px;
}

.wc-product-reviews-write-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #192330;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.wc-product-reviews-write-btn:hover {
    background: #d35400;
    color: white;
    text-decoration: none;
}

/* Reviews List Section */
.wc-product-reviews-list {
    margin-top: 30px;
}

.wc-product-reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e67e22;
}

.wc-product-reviews-subtitle {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.wc-product-reviews-sort {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wc-product-reviews-sort label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.wc-product-reviews-sort select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    cursor: pointer;
}

.wc-product-reviews-sort select:focus {
    outline: none;
    border-color: #192330;
    box-shadow: 0 0 0 2px rgba(230, 126, 34, 0.2);
}

/* Individual Review Items */
.wc-product-review-item {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

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

.wc-product-review-stars {
    flex-shrink: 0;
    margin-top: 5px;
}

.wc-product-review-content {
    flex: 1;
}

.wc-product-review-meta {
    margin-bottom: 10px;
}

.wc-product-review-author {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.wc-product-review-date {
    color: #999;
    font-size: 14px;
    margin-left: 15px;
    position: relative;
}

.wc-product-review-date::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 12px;
    background: #ddd;
}

.wc-product-review-text {
    color: #555;
    line-height: 1.6;
    font-size: 15px;
}

.wc-product-review-text p {
    margin: 0;
}

/* No Reviews Message */
.wc-product-reviews-no-reviews {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
}

/* Default Reviews Notice */
.wc-product-reviews-default-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 15px 20px;
    margin-bottom: 20px;
    text-align: center;
}

.wc-product-reviews-default-notice p {
    margin: 0;
    color: #856404;
    font-size: 14px;
    font-weight: 500;
}

.wc-product-reviews-default-notice::before {
    content: '💡';
    margin-right: 8px;
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wc-product-reviews-summary {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .wc-product-reviews-breakdown {
        margin-left: 0;
        margin-top: 20px;
        width: 100%;
    }
    
    .wc-product-reviews-write-review {
        position: static;
        margin-top: 20px;
    }
    
    .wc-product-reviews-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .wc-product-review-item {
        flex-direction: column;
        gap: 10px;
    }
    
    .wc-product-review-date::before {
        display: none;
    }
    
    .wc-product-review-date {
        margin-left: 0;
        display: block;
        margin-top: 5px;
    }
}

/* Loading State */
.wc-product-reviews-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.wc-product-reviews-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e67e22;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Hover Effects */
.wc-product-review-item:hover {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 20px;
    margin: 0 -20px;
}

/* Focus States for Accessibility */
.wc-product-reviews-write-btn:focus,
.wc-product-reviews-sort select:focus {
    outline: 2px solid #192330;
    outline-offset: 2px;
}

/* Review Modal Styles */
.wc-review-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.wc-review-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-review-modal-content {
    background-color: #fff;
    margin: 20px;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.wc-review-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    background: #192330;
    color: white;
    border-radius: 12px 12px 0 0;
}

.wc-review-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.wc-review-modal-close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s;
}

.wc-review-modal-close:hover {
    transform: scale(1.2);
}

.wc-review-modal-body {
    padding: 25px;
}

.wc-review-form-group {
    margin-bottom: 20px;
}

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

.wc-review-form-group input[type="text"],
.wc-review-form-group input[type="email"],
.wc-review-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.wc-review-form-group input:focus,
.wc-review-form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

/* Star Rating Input */
.wc-review-stars-input {
    display: flex;
    flex-direction: row-reverse;
    gap: 5px;
}

.wc-review-stars-input input[type="radio"] {
    display: none;
}

.wc-review-stars-input label {
    font-size: 30px;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    user-select: none;
}

.wc-review-stars-input label:hover,
.wc-review-stars-input label:hover ~ label,
.wc-review-stars-input input[type="radio"]:checked ~ label {
    color: #ffd700;
    transform: scale(1.1);
}

.wc-review-stars-input label.selected {
    color: #ffd700;
}

/* Form Actions */
.wc-review-form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    justify-content: flex-end;
}

.wc-review-submit-btn,
.wc-review-cancel-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 120px;
}

.wc-review-submit-btn {
    background: #192330;
    color: white;
}

.wc-review-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.wc-review-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.wc-review-cancel-btn {
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #e0e0e0;
}

.wc-review-cancel-btn:hover {
    background: #e9ecef;
    color: #495057;
}

/* Modal Open Body */
body.modal-open {
    overflow: hidden;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .wc-review-modal-content {
        width: 95%;
        margin: 10px;
        max-height: 95vh;
    }
    
    .wc-review-modal-header {
        padding: 15px 20px;
    }
    
    .wc-review-modal-header h3 {
        font-size: 18px;
    }
    
    .wc-review-modal-body {
        padding: 20px;
    }
    
    .wc-review-form-actions {
        flex-direction: column;
    }
    
    .wc-review-submit-btn,
    .wc-review-cancel-btn {
        width: 100%;
    }
    
    .wc-review-stars-input label {
        font-size: 25px;
    }
}
