/* Reviews Page Styles - v20250103b */

/* Page Layout */
.reviews-page {
    padding: 24px 32px;
    max-width: 1200px;
}

/* Page Header */
.reviews-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 24px;
}

.reviews-page-header-left {
    flex: 1;
}

.reviews-page-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 4px 0;
}

.reviews-page-subtitle {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 12px 0;
}

.reviews-sync-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.reviews-sync-time {
    font-size: 12px;
    color: #94a3b8;
}

.reviews-sync-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f1f5f9;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}

.reviews-sync-btn:hover {
    background: #e2e8f0;
}

.reviews-sync-btn.syncing svg {
    animation: spin 1s linear infinite;
}

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

/* Rating Summary */
.reviews-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.reviews-rating-large {
    display: flex;
    align-items: center;
    gap: 8px;
}

.reviews-rating-value {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a2e;
}

.reviews-stars {
    display: flex;
    gap: 2px;
}

.reviews-stars svg {
    width: 20px;
    height: 20px;
}

.reviews-stars .star-filled {
    color: #facc15;
    fill: #facc15;
}

.reviews-stars .star-empty {
    color: #e2e8f0;
    fill: #e2e8f0;
}

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

.reviews-gbp-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #3b82f6;
    text-decoration: none;
    margin-top: 8px;
}

.reviews-gbp-link:hover {
    text-decoration: underline;
}

/* Not Connected State */
.reviews-not-connected {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.reviews-not-connected-content {
    text-align: center;
    max-width: 400px;
}

.reviews-not-connected-icon {
    color: #cbd5e1;
    margin-bottom: 24px;
}

.reviews-not-connected h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 12px 0;
}

.reviews-not-connected p {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 24px 0;
    line-height: 1.6;
}

.reviews-connect-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #FF6B35;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.reviews-connect-btn:hover {
    background: #e55a2b;
}

/* Tabs */
.reviews-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0;
}

.reviews-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: -1px;
}

.reviews-tab:hover {
    color: #1a1a2e;
}

.reviews-tab.active {
    color: #1a1a2e;
    border-bottom-color: #FF6B35;
}

.reviews-tab svg {
    width: 16px;
    height: 16px;
}

.reviews-tab-count {
    background: #FF6B35;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.reviews-tab-content {
    display: none;
}

.reviews-tab-content.active {
    display: block;
}

/* Filters */
.reviews-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.reviews-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.reviews-filter-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.reviews-filter-btn.active {
    background: #1a1a2e;
    border-color: #1a1a2e;
    color: white;
}

.reviews-filter-count {
    background: #FF6B35;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.reviews-filter-btn.active .reviews-filter-count {
    background: white;
    color: #1a1a2e;
}

/* Reviews List */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.reviews-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #64748b;
}

.reviews-loading .loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top-color: #FF6B35;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

.reviews-empty {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.reviews-empty svg {
    width: 48px;
    height: 48px;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.reviews-empty h3 {
    font-size: 16px;
    font-weight: 600;
    color: #475569;
    margin: 0 0 8px 0;
}

.reviews-empty p {
    font-size: 14px;
    margin: 0;
}

/* Review Card */
.review-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: box-shadow 0.15s ease;
}

.review-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.review-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.review-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.review-author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.review-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.review-author-avatar .avatar-initials {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
}

.review-author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.review-author-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
}

.review-date {
    font-size: 12px;
    color: #94a3b8;
}

.review-rating {
    display: flex;
    gap: 2px;
}

.review-rating svg {
    width: 16px;
    height: 16px;
}

.review-rating .star-filled {
    color: #facc15;
    fill: #facc15;
}

.review-rating .star-empty {
    color: #e2e8f0;
    fill: #e2e8f0;
}

.review-comment {
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
    margin-bottom: 16px;
}

.review-comment.no-comment {
    color: #94a3b8;
    font-style: italic;
}

/* Reply Section */
.review-reply {
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.review-reply-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.review-reply-label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.review-reply-date {
    font-size: 11px;
    color: #94a3b8;
}

.review-reply-text {
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
}

/* Review Actions */
.review-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.review-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}

.review-action-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.review-action-btn.primary {
    background: #FF6B35;
    border-color: #FF6B35;
    color: white;
}

.review-action-btn.primary:hover {
    background: #e55a2b;
    border-color: #e55a2b;
}

/* Question Card (Q&A) */
.question-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: box-shadow 0.15s ease;
}

.question-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.question-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.question-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.question-author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.question-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.question-author-avatar .avatar-initials {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
}

.question-author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.question-author-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
}

.question-author-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #059669;
    background: #d1fae5;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
}

.question-date {
    font-size: 12px;
    color: #94a3b8;
}

.question-upvotes {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #64748b;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 6px;
}

.question-upvotes svg {
    color: #94a3b8;
}

.question-community-answers {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
    margin-top: 8px;
}

.question-community-answers svg {
    color: #94a3b8;
}

.question-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #64748b;
}

.question-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.question-text {
    font-size: 15px;
    font-weight: 500;
    color: #1a1a2e;
    line-height: 1.5;
    margin-bottom: 16px;
}

/* Existing Answers */
.question-answers {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.question-answers-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
}

.question-answer {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
}

.question-answer:last-child {
    margin-bottom: 0;
}

.question-answer-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.question-answer-author {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.question-answer-badge {
    font-size: 10px;
    color: white;
    background: #FF6B35;
    padding: 2px 6px;
    border-radius: 4px;
}

.question-answer-date {
    font-size: 11px;
    color: #94a3b8;
    margin-left: auto;
}

.question-answer-text {
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
}

/* Question Actions */
.question-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

/* Reply Modal */
.reviews-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.reviews-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.reviews-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.reviews-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
}

.reviews-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    font-size: 20px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.reviews-modal-close:hover {
    background: #e2e8f0;
    color: #1a1a2e;
}

.reviews-modal-body {
    padding: 24px;
    overflow-y: auto;
}

.reviews-modal-original {
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.reviews-modal-original .review-author {
    margin-bottom: 12px;
}

.reviews-modal-original .review-comment {
    margin-bottom: 0;
}

/* Reply Composer */
.reviews-reply-composer {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reviews-reply-composer label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.reviews-reply-composer textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.15s ease;
}

.reviews-reply-composer textarea:focus {
    outline: none;
    border-color: #FF6B35;
}

.reviews-reply-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.reviews-ai-suggest-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.reviews-ai-suggest-btn:hover {
    opacity: 0.9;
}

.reviews-ai-suggest-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.reviews-ai-suggest-btn.loading {
    position: relative;
}

.reviews-ai-suggest-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}

.reviews-reply-submit-actions {
    display: flex;
    gap: 8px;
}

.reviews-cancel-btn {
    padding: 10px 20px;
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: background 0.15s ease;
}

.reviews-cancel-btn:hover {
    background: #e2e8f0;
}

.reviews-submit-btn {
    padding: 10px 24px;
    background: #FF6B35;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: background 0.15s ease;
}

.reviews-submit-btn:hover {
    background: #e55a2b;
}

.reviews-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .reviews-page {
        padding: 16px;
    }

    .reviews-page-header {
        flex-direction: column;
        gap: 16px;
    }

    .reviews-summary {
        align-items: flex-start;
    }

    .reviews-filters {
        overflow-x: auto;
        padding-bottom: 4px;
        margin-bottom: 16px;
        -webkit-overflow-scrolling: touch;
    }

    .reviews-filter-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .review-card {
        padding: 16px;
    }

    .review-card-header {
        flex-direction: column;
        gap: 12px;
    }

    .reviews-modal {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .reviews-reply-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .reviews-ai-suggest-btn {
        justify-content: center;
    }

    .reviews-reply-submit-actions {
        justify-content: flex-end;
    }
}
