/**
 * Book Reviews & Ratings - Styles
 * Beautiful, mobile-responsive review system
 */

/* Star Rating Display */
.star-rating {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: #fbbf24;
    font-size: 1rem;
}

.star-rating i {
    transition: color 0.2s;
}

.star-rating .rating-number {
    margin-left: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #4a5568;
}

body.dark-mode .star-rating .rating-number {
    color: #cbd5e0;
}

/* Interactive Star Rating (for input) */
.star-rating-input {
    display: flex;
    gap: 8px;
    font-size: 2rem;
    cursor: pointer;
}

.star-rating-input i {
    color: #e2e8f0;
    transition: all 0.2s;
    cursor: pointer;
}

.star-rating-input i:hover,
.star-rating-input i.active {
    color: #fbbf24;
    transform: scale(1.1);
}

body.dark-mode .star-rating-input i {
    color: #4a5568;
}

/* Reviews Section */
.reviews-section {
    margin-top: 40px;
    padding: 30px 0;
    border-top: 2px solid #e2e8f0;
}

body.dark-mode .reviews-section {
    border-top-color: #4a5568;
}

.reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.reviews-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
}

body.dark-mode .reviews-header h2 {
    color: #f7fafc;
}

/* Review Stats */
.review-stats {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 30px;
    padding: 25px;
    background: #f7fafc;
    border-radius: 12px;
    margin-bottom: 30px;
}

body.dark-mode .review-stats {
    background: #2d3748;
}

.review-stats-summary {
    text-align: center;
    padding-right: 30px;
    border-right: 2px solid #e2e8f0;
}

body.dark-mode .review-stats-summary {
    border-right-color: #4a5568;
}

.review-average {
    font-size: 3.5rem;
    font-weight: 700;
    color: #2d3748;
    line-height: 1;
    margin-bottom: 8px;
}

body.dark-mode .review-average {
    color: #f7fafc;
}

.review-count {
    font-size: 0.9rem;
    color: #718096;
}

/* Star Distribution */
.star-distribution {
    flex: 1;
}

.star-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.star-bar-label {
    font-size: 0.85rem;
    color: #4a5568;
    min-width: 60px;
}

.star-bar-track {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

body.dark-mode .star-bar-track {
    background: #4a5568;
}

.star-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.star-bar-count {
    font-size: 0.85rem;
    color: #718096;
    min-width: 40px;
    text-align: right;
}

/* Review Form */
.review-form {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

body.dark-mode .review-form {
    background: #2d3748;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.review-form h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 20px 0;
}

body.dark-mode .review-form h3 {
    color: #f7fafc;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 8px;
}

body.dark-mode .form-group label {
    color: #cbd5e0;
}

.review-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

.review-textarea:focus {
    outline: none;
    border-color: #4299e1;
}

body.dark-mode .review-textarea {
    background: #1a202c;
    border-color: #4a5568;
    color: #f7fafc;
}

.submit-review-btn {
    background: linear-gradient(135deg, #4299e1, #3182ce);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.submit-review-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.4);
}

.submit-review-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Reviews List */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s;
}

.review-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

body.dark-mode .review-item {
    background: #2d3748;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.review-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.review-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

.review-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.review-user-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 4px 0;
}

body.dark-mode .review-user-info h4 {
    color: #f7fafc;
}

.review-date {
    font-size: 0.85rem;
    color: #a0aec0;
}

.review-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #4a5568;
    margin: 15px 0;
}

body.dark-mode .review-text {
    color: #cbd5e0;
}

.review-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.helpful-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid #e2e8f0;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #718096;
    cursor: pointer;
    transition: all 0.2s;
}

.helpful-btn:hover {
    border-color: #4299e1;
    color: #4299e1;
}

.helpful-btn.active {
    background: #4299e1;
    border-color: #4299e1;
    color: white;
}

body.dark-mode .helpful-btn {
    border-color: #4a5568;
    color: #a0aec0;
}

/* Empty State */
.reviews-empty {
    text-align: center;
    padding: 60px 20px;
    color: #a0aec0;
}

.reviews-empty i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.reviews-empty h3 {
    font-size: 1.25rem;
    color: #4a5568;
    margin-bottom: 10px;
}

body.dark-mode .reviews-empty h3 {
    color: #cbd5e0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .review-stats {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .review-stats-summary {
        padding-right: 0;
        padding-bottom: 20px;
        border-right: none;
        border-bottom: 2px solid #e2e8f0;
    }

    body.dark-mode .review-stats-summary {
        border-bottom-color: #4a5568;
    }

    .reviews-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .review-header {
        flex-direction: column;
        gap: 10px;
    }

    .star-rating-input {
        font-size: 1.75rem;
    }
}