/* ═══════════════════════════════════════════
   ARP Google Reviews – Frontend Styles v2.1
   ═══════════════════════════════════════════ */

body.arp-reviews-open {
    overflow: hidden;
}

/* ─── Badge Base ─── */

.arp-reviews-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.arp-reviews-badge:focus-visible,
.arp-panel-close:focus-visible,
.arp-google-link:focus-visible,
.arp-review-toggle:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

.arp-badge-google-icon {
    flex-shrink: 0;
}

.arp-badge-rating {
    display: flex;
    align-items: center;
    gap: 5px;
}

.arp-badge-score {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1;
}

.arp-badge-stars {
    display: flex;
    align-items: center;
    gap: 1px;
    line-height: 1;
}

.arp-badge-stars svg {
    width: 12px;
    height: 12px;
}

.arp-badge-count {
    font-size: 11px;
    font-weight: 400;
    line-height: 1;
}

/* ─── Header Badge ─── */

.arp-reviews-badge--header {
    position: absolute;
    top: 50%;
    right: 280px;
    z-index: 10100;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.arp-reviews-badge--header:hover {
    background: rgba(255, 255, 255, 0.20);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-50%) scale(1.04);
}

.arp-reviews-badge--header:active {
    transform: translateY(-50%) scale(0.97);
}

.arp-reviews-badge--header .arp-badge-score {
    color: #fff;
}

.arp-reviews-badge--header .arp-badge-count {
    color: rgba(255, 255, 255, 0.65);
}

.arp-reviews-badge--header.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) translateX(12px);
}

/* ─── Floating Badge ─── */

.arp-reviews-badge--floating,
.arp-reviews-badge--header.is-fallback-floating {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 99999;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.arp-reviews-badge--header.is-fallback-floating {
    top: 20px;
    bottom: auto;
}

.arp-reviews-badge--floating:hover,
.arp-reviews-badge--header.is-fallback-floating:hover {
    transform: scale(1.04);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.16);
}

.arp-reviews-badge--floating:active,
.arp-reviews-badge--header.is-fallback-floating:active {
    transform: scale(0.97);
}

.arp-reviews-badge--floating .arp-badge-score,
.arp-reviews-badge--header.is-fallback-floating .arp-badge-score {
    color: #202124;
}

.arp-reviews-badge--floating .arp-badge-count,
.arp-reviews-badge--header.is-fallback-floating .arp-badge-count {
    color: #70757a;
}

.arp-reviews-badge--floating.is-hidden,
.arp-reviews-badge--header.is-fallback-floating.is-hidden {
    transform: translateY(100px);
    opacity: 0;
    pointer-events: none;
}

/* ─── Backdrop ─── */

.arp-reviews-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999998;
    background: rgba(0, 0, 0, 0);
    pointer-events: none;
    transition: background 0.35s ease;
}

.arp-reviews-backdrop.is-active {
    background: rgba(0, 0, 0, 0.42);
    pointer-events: auto;
}

/* ─── Slide-out Panel ─── */

.arp-reviews-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    width: 440px;
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.10), -1px 0 0 rgba(0,0,0,0.05);
    transform: translateX(100%);
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.arp-reviews-panel.is-open {
    transform: translateX(0);
}

/* ─── Panel Header ─── */

.arp-panel-header {
    flex-shrink: 0;
    padding: 24px 28px 20px;
    border-bottom: 1px solid #f0f0f0;
    background: #ffffff;
}

.arp-panel-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.arp-panel-google-icon {
    flex-shrink: 0;
}

.arp-panel-title {
    font-size: 17px;
    font-weight: 600;
    color: #1a1a1a;
    flex: 1;
    letter-spacing: -0.01em;
}

.arp-panel-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    color: #5f6368;
    transition: background 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}

.arp-panel-close:hover {
    background: #f1f3f4;
    color: #202124;
}

.arp-panel-close:active {
    background: #e8eaed;
}

/* ─── Summary ─── */

.arp-panel-summary {
    display: flex;
    align-items: center;
}

.arp-summary-rating {
    display: flex;
    align-items: center;
    gap: 14px;
}

.arp-summary-score {
    font-size: 48px;
    font-weight: 300;
    color: #202124;
    line-height: 1;
    letter-spacing: -0.03em;
}

.arp-summary-stars {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 3px;
}

.arp-summary-stars svg {
    width: 18px;
    height: 18px;
}

.arp-summary-count {
    font-size: 13px;
    color: #70757a;
    line-height: 1.3;
}

/* ─── Panel Body ─── */

.arp-panel-body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.arp-panel-body::-webkit-scrollbar {
    width: 5px;
}

.arp-panel-body::-webkit-scrollbar-track {
    background: transparent;
}

.arp-panel-body::-webkit-scrollbar-thumb {
    background: #d6d6d6;
    border-radius: 10px;
}

.arp-panel-body::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

/* ─── Loading ─── */

.arp-panel-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 72px 20px;
    color: #70757a;
    font-size: 14px;
}

.arp-panel-loading.is-hidden {
    display: none;
}

.arp-spinner {
    width: 28px;
    height: 28px;
    border: 2.5px solid #e8eaed;
    border-top-color: #4285F4;
    border-radius: 50%;
    animation: arp-spin 0.65s linear infinite;
}

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

/* ─── Review Cards ─── */

.arp-reviews-list {
    padding: 0;
}

.arp-review-card {
    padding: 20px 28px;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s ease;
}

.arp-review-card:last-child {
    border-bottom: none;
}

.arp-review-card:hover {
    background: #fafbfc;
}

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

.arp-review-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #f1f3f4;
}

.arp-review-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5B86E5 0%, #36D1DC 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.arp-review-meta {
    flex: 1;
    min-width: 0;
}

.arp-review-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.arp-review-name a {
    color: inherit;
    text-decoration: none;
}

.arp-review-name a:hover {
    color: #1a73e8;
}

.arp-review-date {
    font-size: 12px;
    color: #9aa0a6;
    line-height: 1.4;
    margin-top: 1px;
}

.arp-review-stars {
    display: flex;
    align-items: center;
    gap: 1px;
    margin-bottom: 8px;
}

.arp-review-stars svg {
    width: 14px;
    height: 14px;
}

.arp-review-text {
    font-size: 14px;
    color: #3c4043;
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-line;
}

.arp-review-toggle {
    display: inline;
    background: none;
    border: none;
    color: #1a73e8;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
    transition: color 0.15s ease;
}

.arp-review-toggle:hover {
    color: #174ea6;
    text-decoration: underline;
}

/* ─── Empty / Error State ─── */

.arp-panel-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 72px 28px;
    text-align: center;
    color: #70757a;
}

.arp-panel-empty svg {
    margin-bottom: 16px;
    color: #dadce0;
}

.arp-panel-empty p {
    font-size: 14px;
    margin: 0;
    line-height: 1.6;
}

/* ─── Panel Footer ─── */

.arp-panel-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 28px;
    border-top: 1px solid #f0f0f0;
    background: #fafbfc;
}

.arp-google-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #1a73e8;
    text-decoration: none;
    padding: 7px 16px;
    border: 1px solid #dadce0;
    border-radius: 20px;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.arp-google-link:hover {
    background: #f0f6ff;
    border-color: #a8c7fa;
    box-shadow: 0 1px 4px rgba(26, 115, 232, 0.08);
}

.arp-google-link.is-hidden {
    display: none;
}

.arp-powered-by {
    font-size: 11px;
    color: #9aa0a6;
}

/* ═══════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════ */

@media (max-width: 1024px) {
    .arp-reviews-badge--header {
        right: 180px;
    }
}

@media (max-width: 640px) {
    body.arp-has-floating-badge .arp-reviews-badge--header {
        display: none;
    }

    .arp-reviews-badge--header,
    .arp-reviews-badge--header.is-fallback-floating {
        position: fixed;
        right: 16px;
        top: auto;
        bottom: 84px;
        transform: none;
        padding: 10px 16px;
        border-radius: 24px;
        background: #ffffff;
        border: 1px solid #e0e0e0;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0,0,0,0.04);
        z-index: 99999;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .arp-reviews-badge--header:hover,
    .arp-reviews-badge--header.is-fallback-floating:hover {
        transform: scale(1.04);
    }

    .arp-reviews-badge--header:active,
    .arp-reviews-badge--header.is-fallback-floating:active {
        transform: scale(0.97);
    }

    .arp-reviews-badge--header .arp-badge-score,
    .arp-reviews-badge--header.is-fallback-floating .arp-badge-score {
        color: #202124;
    }

    .arp-reviews-badge--header .arp-badge-count,
    .arp-reviews-badge--header.is-fallback-floating .arp-badge-count {
        color: #70757a;
    }

    .arp-reviews-badge--header.is-hidden,
    .arp-reviews-badge--header.is-fallback-floating.is-hidden,
    .arp-reviews-badge--floating.is-hidden {
        transform: translateY(100px);
        opacity: 0;
        pointer-events: none;
    }

    .arp-reviews-badge--floating {
        right: 16px;
        bottom: 20px;
        padding: 10px 16px;
        border-radius: 24px;
    }

    .arp-reviews-panel {
        width: 100vw;
        border-radius: 0;
    }

    .arp-panel-header {
        padding: 18px 20px 16px;
    }

    .arp-review-card {
        padding: 18px 20px;
    }

    .arp-panel-footer {
        padding: 12px 20px;
    }

    .arp-summary-score {
        font-size: 40px;
    }
}

@media (max-width: 480px) {
    .arp-badge-count {
        display: none;
    }

    .arp-panel-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ─── Fusion header integration ─── */

.fusion-header .fusion-row {
    position: relative;
}