/**
 * Product Reviews Styles
 * Play Store style rating and feedback system
 */

/* Reviews Section */
.reviews-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.reviews-title {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reviews-title i {
    color: #ffc107;
}

/* Rating Summary - Play Store Style */
.rating-summary {
    display: flex;
    gap: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.rating-summary-left {
    text-align: center;
    min-width: 120px;
}

.rating-big-number {
    font-size: 3.5rem;
    font-weight: 700;
    color: #333;
    line-height: 1;
}

.rating-stars-big {
    color: #ffc107;
    font-size: 1.25rem;
    margin: 0.5rem 0;
}

.rating-total {
    color: #666;
    font-size: 0.9rem;
}

.rating-summary-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
}

.rating-bar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rating-bar-label {
    width: 16px;
    text-align: right;
    font-weight: 600;
    color: #666;
    font-size: 0.85rem;
}

.rating-bar-star {
    color: #ffc107;
    font-size: 0.8rem;
}

.rating-bar-track {
    flex: 1;
    height: 10px;
    background: #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.rating-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffc107 0%, #ff9800 100%);
    border-radius: 5px;
    transition: width 0.3s ease;
}

.rating-bar-count {
    width: 32px;
    text-align: right;
    color: #888;
    font-size: 0.85rem;
}

.rating-summary-empty {
    text-align: center;
    padding: 2rem;
    color: #666;
}

/* Review Actions */
.review-actions {
    margin-bottom: 1.5rem;
}

.btn-write-review {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.already-reviewed {
    color: #28a745;
    font-size: 0.95rem;
    margin: 0;
    padding: 0.75rem 1rem;
    background: #e8f5e9;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.already-reviewed i {
    font-size: 1.1rem;
}

/* Reviews Toolbar */
.reviews-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.reviews-sort {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Reviews List */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Review Card */
.review-card {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 1.25rem;
    transition: box-shadow 0.2s;
}

.review-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.review-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.review-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.review-meta {
    flex: 1;
}

.review-author {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.review-date {
    color: #888;
    font-size: 0.85rem;
}

.review-rating {
    color: #ffc107;
    font-size: 0.9rem;
}

.review-title {
    font-size: 1.1rem;
    color: #333;
    margin: 0.5rem 0;
}

.review-text {
    color: #555;
    line-height: 1.6;
    margin: 0.75rem 0;
}

.review-pros, .review-cons {
    margin: 0.75rem 0;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.review-pros {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.review-cons {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.review-pros ul, .review-cons ul {
    margin: 0.5rem 0 0 1.25rem;
    padding: 0;
}

.review-pros li, .review-cons li {
    margin: 0.25rem 0;
    color: #333;
}

.review-verified {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #28a745;
    font-size: 0.85rem;
    margin: 0.5rem 0;
}

.review-response {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 0 6px 6px 0;
}

.response-header {
    font-weight: 600;
    color: #1976d2;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.review-response p {
    color: #333;
    margin: 0;
    font-size: 0.9rem;
}

.review-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eee;
}

.review-helpful-text {
    color: #666;
    font-size: 0.85rem;
}

.btn-helpful {
    background: none;
    border: 1px solid #ddd;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-helpful:hover {
    border-color: #28a745;
    color: #28a745;
    background: rgba(40, 167, 69, 0.05);
}

/* Empty State */
.reviews-empty {
    text-align: center;
    padding: 3rem;
    color: #888;
}

.reviews-empty i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 1rem;
}

.reviews-empty h3 {
    color: #555;
    margin-bottom: 0.5rem;
}

.reviews-empty p {
    margin-bottom: 1.5rem;
}

/* Load More Button */
.btn-load-more {
    display: block;
    width: 100%;
    margin-top: 1.5rem;
    padding: 1rem;
}

/* Review Modal */
.review-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.review-modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.review-modal-content h2 {
    color: #333;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.review-modal-content h2 i {
    color: #ffc107;
}

/* Star Rating Input */
.star-rating-input {
    display: flex;
    gap: 0.5rem;
    font-size: 2rem;
}

.star-rating-input i {
    color: #ffc107;
    cursor: pointer;
    transition: transform 0.2s;
}

.star-rating-input i:hover {
    transform: scale(1.2);
}

/* Form Styles */
.review-modal-content .form-group {
    margin-bottom: 1.25rem;
}

.review-modal-content label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.review-modal-content input[type="text"],
.review-modal-content input[type="email"],
.review-modal-content textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.review-modal-content input:focus,
.review-modal-content textarea:focus {
    outline: none;
    border-color: #28a745;
}

.review-modal-content small {
    color: #888;
    font-size: 0.8rem;
}

.review-modal-content textarea {
    resize: vertical;
    min-height: 100px;
}

#prosContainer, #consContainer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-add-item {
    background: none;
    border: 1px dashed #ccc;
    padding: 0.5rem;
    border-radius: 6px;
    color: #666;
    cursor: pointer;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.btn-add-item:hover {
    border-color: #28a745;
    color: #28a745;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.form-actions button {
    flex: 1;
    padding: 0.875rem;
}

#reviewFormMessage .alert {
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .reviews-section {
        padding: 1.25rem;
        margin-top: 1rem;
        border-radius: 8px;
    }
    
    .rating-summary {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.25rem;
    }
    
    .rating-summary-left {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .rating-big-number {
        font-size: 2.5rem;
    }
    
    .review-modal-content {
        padding: 1.5rem;
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .star-rating-input {
        font-size: 1.75rem;
    }
    
    .review-header {
        flex-wrap: wrap;
    }
    
    .review-rating {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .review-footer {
        flex-wrap: wrap;
    }
    
    .review-helpful-text {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

/* Star Colors on Product Cards */
.product-card .rating-stars,
.product-rating-stars {
    color: #ffc107;
    font-size: 0.9rem;
}

/* Featured Review Badge */
.review-featured {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.review-card.featured {
    position: relative;
    border-color: #ffc107;
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.2);
}
