/* ============================================ */
/* TRIPADVISOR-STYLE REVIEW SYSTEM             */
/* Consolidated & Professional Design          */
/* Only loads on: index, airport-transfer,     */
/* excursions-main                             */
/* ============================================ */

:root {
    /* TripAdvisor Colors */
    --ta-green: #00aa6c;
    --ta-green-dark: #008c59;
    --ta-green-light: #e6f7f0;
    --ta-green-bg: #f0faf6;
    --ta-black: #1a1a1a;
    --ta-text: #333333;
    --ta-text-secondary: #4a5568;
    --ta-text-muted: #717171;
    --ta-border: #e2e8f0;
    --ta-border-light: #f0f0f0;
    --ta-bg: #ffffff;
    --ta-bg-light: #fafafa;
    --ta-star: #00aa6c;
    --ta-star-empty: #d4d4d4;
    --ta-shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --ta-shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --ta-shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --ta-radius: 8px;
    --ta-radius-lg: 12px;
    --ta-radius-xl: 16px;
}

/* ============================================ */
/* MAIN REVIEWS SECTION                        */
/* ============================================ */

.reviews-section {
    background: var(--ta-bg);
    padding: 60px 20px;
    margin: 0;
}

.reviews-section .container {
    max-width: 1100px;
    margin: 0 auto;
}

/* Section Header */
.reviews-section-header {
    text-align: center;
    margin-bottom: 40px;
}

.reviews-section-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--ta-black);
    margin-bottom: 8px;
}

.reviews-section-header p {
    color: var(--ta-text-muted);
    font-size: 1rem;
}

/* ============================================ */
/* RATING SUMMARY CARD (Top Section)           */
/* ============================================ */

.ta-rating-card {
    background: var(--ta-bg);
    border: 1px solid var(--ta-border);
    border-radius: var(--ta-radius-xl);
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: var(--ta-shadow-sm);
}

.ta-rating-card-inner {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 40px;
    align-items: start;
}

/* Left: Score Circle */
.ta-score-circle {
    text-align: center;
    padding: 24px;
    background: var(--ta-green-bg);
    border-radius: var(--ta-radius-lg);
}

.ta-score-number {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--ta-green);
    line-height: 1;
    margin-bottom: 4px;
}

.ta-score-max {
    font-size: 1rem;
    color: var(--ta-text-muted);
    margin-bottom: 12px;
}

.ta-score-stars {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 12px;
}

.ta-score-stars .ta-star {
    width: 20px;
    height: 20px;
    fill: var(--ta-star);
}

.ta-score-stars .ta-star.empty {
    fill: var(--ta-star-empty);
}

.ta-review-count {
    font-size: 0.9rem;
    color: var(--ta-text-secondary);
    font-weight: 500;
}

.ta-review-count strong {
    color: var(--ta-black);
}

/* Right: Rating Breakdown Bars */
.ta-rating-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 8px;
}

.ta-rating-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ta-rating-bar-label {
    min-width: 80px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ta-text);
    display: flex;
    align-items: center;
    gap: 4px;
}

.ta-rating-bar-label .star-icon {
    color: var(--ta-star);
    font-size: 0.75rem;
}

.ta-rating-bar-track {
    flex: 1;
    height: 8px;
    background: var(--ta-border-light);
    border-radius: 4px;
    overflow: hidden;
}

.ta-rating-bar-fill {
    height: 100%;
    background: var(--ta-green);
    border-radius: 4px;
    transition: width 0.6s ease-out;
}

.ta-rating-bar-count {
    min-width: 30px;
    text-align: right;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ta-text-secondary);
}

/* ============================================ */
/* REVIEW CARDS (Visible on Page)              */
/* ============================================ */

.ta-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 32px;
}

.ta-review-card {
    background: var(--ta-bg);
    border: 1px solid var(--ta-border);
    border-radius: var(--ta-radius-lg);
    padding: 24px;
    transition: box-shadow 0.2s ease;
}

.ta-review-card:hover {
    box-shadow: var(--ta-shadow-md);
}

/* Review Header */
.ta-review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.ta-reviewer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ta-reviewer-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--ta-green-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    color: var(--ta-green);
}

.ta-reviewer-info h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ta-black);
    margin: 0 0 4px 0;
}

.ta-reviewer-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--ta-text-muted);
}

.ta-reviewer-meta .location {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ta-reviewer-meta .verified {
    color: var(--ta-green);
    font-weight: 500;
}

.ta-review-date {
    font-size: 0.8125rem;
    color: var(--ta-text-muted);
}

/* Review Rating */
.ta-review-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

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

.ta-review-stars .ta-star {
    width: 16px;
    height: 16px;
    fill: var(--ta-star);
}

.ta-review-stars .ta-star.empty {
    fill: var(--ta-star-empty);
}

.ta-review-title {
    font-weight: 600;
    color: var(--ta-black);
    font-size: 0.9375rem;
}

/* Review Content */
.ta-review-content {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--ta-text);
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ta-review-content.expanded {
    -webkit-line-clamp: unset;
}

/* Review Photos */
.ta-review-photos {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.ta-review-photo {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--ta-radius);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.ta-review-photo:hover {
    transform: scale(1.05);
}

/* Review Footer */
.ta-review-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--ta-border-light);
}

.ta-review-tags {
    display: flex;
    gap: 8px;
}

.ta-review-tag {
    padding: 4px 12px;
    background: var(--ta-bg-light);
    border-radius: 16px;
    font-size: 0.75rem;
    color: var(--ta-text-secondary);
    font-weight: 500;
}

.ta-helpful-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--ta-border);
    border-radius: 20px;
    font-size: 0.8125rem;
    color: var(--ta-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ta-helpful-btn:hover {
    border-color: var(--ta-green);
    color: var(--ta-green);
    background: var(--ta-green-light);
}

.ta-helpful-btn.voted {
    border-color: var(--ta-green);
    color: var(--ta-green);
    background: var(--ta-green-light);
}

/* ============================================ */
/* READ MORE BUTTON                            */
/* ============================================ */

.ta-read-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px 24px;
    background: var(--ta-bg);
    border: 2px solid var(--ta-green);
    border-radius: var(--ta-radius-lg);
    font-size: 1rem;
    font-weight: 600;
    color: var(--ta-green);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ta-read-more-btn:hover {
    background: var(--ta-green);
    color: white;
}

.ta-read-more-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.2s ease;
}

.ta-read-more-btn:hover svg {
    transform: translateX(4px);
}

/* ============================================ */
/* FLOATING REVIEW BUTTON                      */
/* ============================================ */

.ta-floating-btn {
    position: fixed;
    left: 24px; /* Moved to left side */
    bottom: 180px; /* Positioned above the shield button */
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: var(--ta-green);
    color: white;
    border: none;
    border-radius: 50px;
    font-family: 'Inter', 'InterVariable', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--ta-shadow-lg);
    z-index: 900;
    transition: all 0.3s ease;
}

.ta-floating-btn:hover {
    background: var(--ta-green-dark);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0,170,108,0.3);
}

.ta-floating-btn .rating {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-left: 8px;
    border-left: 1px solid rgba(255,255,255,0.3);
    margin-left: 4px;
    font-size: 16px;
    font-weight: 700;
}

.ta-floating-btn .star-icon {
    color: #ffd700;
}

/* ============================================ */
/* REVIEWS MODAL                               */
/* ============================================ */

.ta-reviews-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ta-reviews-modal.active {
    display: flex;
}

.ta-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.ta-modal-container {
    position: relative;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    background: var(--ta-bg);
    border-radius: var(--ta-radius-xl);
    box-shadow: var(--ta-shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header */
.ta-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--ta-border);
    background: var(--ta-bg);
}

.ta-modal-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ta-modal-rating-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--ta-green-light);
    border-radius: var(--ta-radius);
}

.ta-modal-rating-badge .score {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ta-green);
}

.ta-modal-rating-badge .stars {
    display: flex;
    gap: 2px;
}

.ta-modal-rating-badge .stars .ta-star {
    width: 14px;
    height: 14px;
    fill: var(--ta-star);
}

.ta-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ta-black);
    margin: 0;
}

.ta-modal-subtitle {
    font-size: 0.875rem;
    color: var(--ta-text-muted);
    margin: 4px 0 0 0;
}

.ta-modal-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--ta-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ta-modal-close:hover {
    background: var(--ta-bg-light);
    color: var(--ta-black);
}

/* Modal Body */
.ta-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.ta-modal-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Modal Review Card (full content) */
.ta-modal-review-card {
    background: var(--ta-bg);
    border: 1px solid var(--ta-border);
    border-radius: var(--ta-radius-lg);
    padding: 20px;
}

.ta-modal-review-card .ta-review-content {
    -webkit-line-clamp: unset;
    overflow: visible;
}

/* Modal Footer */
.ta-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--ta-border);
    background: var(--ta-bg-light);
    text-align: center;
}

.ta-modal-load-more {
    padding: 12px 32px;
    background: var(--ta-green);
    color: white;
    border: none;
    border-radius: var(--ta-radius);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ta-modal-load-more:hover {
    background: var(--ta-green-dark);
}

.ta-modal-load-more:disabled {
    background: var(--ta-border);
    cursor: not-allowed;
}

/* ============================================ */
/* WRITE REVIEW MODAL                          */
/* ============================================ */

.ta-write-review-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--ta-green);
    color: white;
    border: none;
    border-radius: var(--ta-radius);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ta-write-review-btn:hover {
    background: var(--ta-green-dark);
    transform: translateY(-1px);
}

/* ============================================ */
/* RESPONSIVE DESIGN                           */
/* ============================================ */

@media (max-width: 768px) {
    .reviews-section {
        padding: 40px 16px;
    }

    .ta-rating-card {
        padding: 20px;
    }

    .ta-rating-card-inner {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .ta-score-circle {
        padding: 20px;
    }

    .ta-score-number {
        font-size: 2.5rem;
    }

    .ta-review-card {
        padding: 16px;
    }

    .ta-reviewer-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }

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

    .ta-review-footer {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .ta-floating-btn {
        left: 16px; /* Left side on mobile too */
        bottom: 160px; /* Higher on mobile to avoid overlapping with other floating buttons */
        padding: 12px 16px;
        font-size: 0.875rem;
    }

    .ta-modal-container {
        max-height: 95vh;
        border-radius: var(--ta-radius-lg);
    }

    .ta-modal-header {
        padding: 16px;
    }

    .ta-modal-header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .ta-modal-body {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .ta-score-number {
        font-size: 2rem;
    }

    .ta-rating-bar-label {
        min-width: 60px;
        font-size: 0.8125rem;
    }

    .ta-review-content {
        font-size: 0.875rem;
    }

    /* Move floating button even higher on small screens to avoid overlap */
    .ta-floating-btn {
        bottom: 180px;
        left: 12px; /* Left side on small screens too */
        padding: 10px 14px;
        font-size: 0.8125rem;
    }

    .ta-floating-btn .rating {
        display: none;
    }
}

/* ============================================ */
/* STAR SVG ICON (Inline)                      */
/* ============================================ */

.ta-star {
    display: inline-block;
    width: 16px;
    height: 16px;
}

.ta-star-svg {
    width: 100%;
    height: 100%;
}

/* ============================================ */
/* LOADING STATE                               */
/* ============================================ */

.ta-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--ta-text-muted);
}

.ta-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--ta-border);
    border-top-color: var(--ta-green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

/* ============================================ */
/* EMPTY STATE                                 */
/* ============================================ */

.ta-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--ta-text-muted);
}

.ta-empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.ta-empty-state h3 {
    font-size: 1.25rem;
    color: var(--ta-text);
    margin-bottom: 8px;
}

.ta-empty-state p {
    margin-bottom: 24px;
}

/* ============================================ */
/* ACCESSIBILITY                               */
/* ============================================ */

@media (prefers-reduced-motion: reduce) {
    .ta-modal-container,
    .ta-review-card,
    .ta-helpful-btn,
    .ta-read-more-btn,
    .ta-floating-btn {
        transition: none;
        animation: none;
    }
}

.ta-reviews-modal:focus-within .ta-modal-container {
    outline: 2px solid var(--ta-green);
    outline-offset: 2px;
}

/* Skip link for keyboard users */
.ta-skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--ta-green);
    color: white;
    padding: 8px 16px;
    z-index: 100;
    transition: top 0.3s;
}

.ta-skip-link:focus {
    top: 0;
}
