/*
|--------------------------------------------------------------------------
| Comments Frontend Styles - Bootstrap 5 Compatible
|--------------------------------------------------------------------------
*/

.comments-section {
    margin: 40px 0;
}

/* Header */
.comments-section .comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.comments-section .comments-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.comments-stats-summary {
    font-size: 14px;
    color: #64748b;
}

/* Rating Summary */
.rating-summary {
    display: flex;
    gap: 32px;
    padding: 24px;
    background: #f8fafc;
    border-radius: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.rating-average {
    text-align: center;
    min-width: 120px;
}

.rating-number {
    display: block;
    font-size: 48px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
}

.rating-stars {
    margin: 8px 0;
}

.rating-stars .fa-star {
    color: #fbbf24;
    font-size: 18px;
}

.rating-stars .fa-star.empty {
    color: #e2e8f0;
}

.rating-count {
    font-size: 14px;
    color: #64748b;
}

.rating-bars {
    flex: 1;
    min-width: 200px;
}

.rating-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.rating-bar-row:last-child {
    margin-bottom: 0;
}

.rating-bar-label {
    font-size: 13px;
    color: #64748b;
    width: 60px;
}

.rating-bar-track {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.rating-bar-fill {
    height: 100%;
    background: #fbbf24;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.rating-bar-count {
    font-size: 13px;
    color: #94a3b8;
    width: 40px;
    text-align: right;
}

/* Comment Form */
.comment-form-wrapper {
    margin-bottom: 32px;
}

.comment-form {
    padding: 24px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.guest-fields {
    margin-bottom: 16px;
}

.guest-fields .form-row {
    display: flex;
    gap: 16px;
}

.guest-fields .form-group {
    flex: 1;
}

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

.form-group:last-child {
    margin-bottom: 0;
}

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

.form-group .required {
    color: #ef4444;
}

.comment-form .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.comment-form .form-control:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.comment-form textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Star Rating Input */
.rating-input-group {
    margin-bottom: 16px;
}

.star-rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 4px;
}

.star-rating-input input {
    display: none;
}

.star-rating-input label {
    cursor: pointer;
    font-size: 24px;
    color: #e2e8f0;
    transition: color 0.2s;
    margin-bottom: 0;
}

.star-rating-input label:hover,
.star-rating-input label:hover ~ label,
.star-rating-input input:checked ~ label {
    color: #fbbf24;
}

/* Reply Indicator */
.reply-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f1f5f9;
    border-radius: 8px;
    margin-bottom: 16px;
}

.reply-indicator span {
    font-size: 14px;
    color: #64748b;
}

.btn-cancel-reply {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
}

.btn-cancel-reply:hover {
    color: #ef4444;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.btn-submit {
    padding: 12px 24px;
    font-weight: 600;
}

/* Login Prompt */
.login-prompt {
    text-align: center;
    padding: 32px;
    background: #f8fafc;
    border-radius: 12px;
}

.login-prompt p {
    margin-bottom: 16px;
    color: #64748b;
}

/* Comments List */
.comments-list {
    min-height: 100px;
}

.comments-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: #64748b;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Comment */
.comment {
    display: flex;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid #e2e8f0;
}

.comment:last-child {
    border-bottom: none;
}

.comment .comment-avatar {
    flex-shrink: 0;
}

.comment .avatar-initials {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50%;
}

.comment .comment-body {
    flex: 1;
    min-width: 0;
}

.comment .comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.comment .comment-author {
    font-weight: 600;
    color: #1e293b;
}

.comment .comment-date {
    font-size: 13px;
    color: #94a3b8;
}

.comment .comment-rating {
    margin-bottom: 8px;
}

.comment .comment-rating .fa-star {
    font-size: 14px;
    color: #fbbf24;
}

.comment .comment-rating .fa-star.empty {
    color: #e2e8f0;
}

.comment .comment-content {
    font-size: 15px;
    line-height: 1.6;
    color: #334155;
    margin-bottom: 12px;
}

.comment .comment-actions {
    display: flex;
    gap: 16px;
}

.comment .btn-reply {
    background: none;
    border: none;
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.comment .btn-reply:hover {
    color: #6366f1;
}

/* Nested Replies */
.comment-replies {
    margin-top: 16px;
    padding-left: 32px;
    border-left: 2px solid #e2e8f0;
}

.comment-replies .comment {
    padding: 16px 0;
}

.comment-replies .comment .avatar-initials {
    width: 40px;
    height: 40px;
    font-size: 14px;
}

/* Load More */
.comments-load-more {
    text-align: center;
    margin-top: 24px;
}

/* No Comments */
.no-comments {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

.no-comments i {
    font-size: 48px;
    color: #cbd5e1;
    margin-bottom: 16px;
    display: block;
}

/* Responsive */
@media (max-width: 767px) {
    .rating-summary {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .rating-bars {
        width: 100%;
    }

    .guest-fields .form-row {
        flex-direction: column;
    }

    .comment {
        flex-direction: column;
        gap: 12px;
    }

    .comment-replies {
        padding-left: 16px;
    }

    .star-rating-input label {
        font-size: 32px;
    }
}
