/* ============================================================
   FAQ CHAT COMPONENT
   Premium two-column FAQ with animated phone chat mockup
   ============================================================ */

/* ---------- Layout ---------- */
.faq-chat-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 72px;
    align-items: start;
}

/* ---------- Sticky phone column ---------- */
.faq-chat__phone-col {
    position: sticky;
    top: 100px;
}

/* ---------- Phone mockup shell ---------- */
.phone-mockup {
    width: 280px;
    margin: 0 auto;
    position: relative;
    border-radius: 44px;
    background: #0e0e0e;
    padding: 14px 10px;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.06),
        0 40px 80px rgba(0,0,0,0.45),
        inset 0 0 0 1px rgba(255,255,255,0.04);
    overflow: hidden;
}

.phone-mockup::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 19px;
    transform: translateX(-50%);
    width: 80px;
    height: 22px;
    background: #0e0e0e;
    border-radius: 0 0 16px 16px;
    z-index: 10;
}

.phone-mockup__side-btn {
    position: absolute;
    background: #1c1c1c;
    border-radius: 3px;
}
.phone-mockup__side-btn--vol-up  { width: 3px; height: 28px; right: -3px; top: 80px; }
.phone-mockup__side-btn--vol-dn  { width: 3px; height: 28px; right: -3px; top: 116px; }
.phone-mockup__side-btn--power   { width: 3px; height: 44px; left: -3px; top: 100px; }

.phone-mockup__screen {
    border-radius: 34px;
    overflow: hidden !important;
    background: #fff;
    height: 520px !important;
    min-height: 520px !important;
    max-height: 520px !important;
    position: relative;
    display: block;
}

/* ---------- Status bar ---------- */
.phone-status-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px 4px;
    font-size: 10px;
    font-weight: 600;
    color: #111;
    background: #fff;
    z-index: 3;
    height: 28px;
    box-sizing: content-box;
}
.phone-status-bar__time { font-weight: 700; font-size: 11px; }
.phone-status-icons { display: flex; align-items: center; gap: 4px; }
.phone-status-icons svg { width: 12px; height: 12px; }

/* ---------- Chat header ---------- */
.chat-header {
    position: absolute;
    top: 42px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px 10px;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    z-index: 3;
}
.chat-header__back {
    color: var(--gold);
    display: flex;
    align-items: center;
    margin-right: 2px;
}
.chat-header__back svg { width: 18px; height: 18px; }
.chat-header__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a1a1a, #333);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}
.chat-header__avatar span {
    font-size: 13px;
    font-weight: 700;
    color: var(--gold, #C9A84C);
    font-family: var(--font-heading, 'Outfit', sans-serif);
}
.chat-header__avatar::after {
    content: '';
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #fff;
}
.chat-header__info { flex: 1; }
.chat-header__name {
    font-size: 13px;
    font-weight: 700;
    color: #111;
    line-height: 1.2;
    font-family: var(--font-heading, 'Outfit', sans-serif);
}
.chat-header__status {
    font-size: 10px;
    color: #22c55e;
    font-weight: 500;
}
.chat-header__call {
    color: var(--gold, #C9A84C);
    display: flex;
    align-items: center;
}
.chat-header__call svg { width: 16px; height: 16px; }

/* ---------- Messages area ---------- */
.chat-messages {
    position: absolute;
    top: 96px;
    bottom: 52px;
    left: 0;
    right: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
    background: #fafafa;
    box-sizing: border-box;
    z-index: 1;
}
.chat-messages::-webkit-scrollbar { display: none; }

/* ---------- Date divider ---------- */
.chat-date {
    text-align: center;
    font-size: 10px;
    color: #aaa;
    font-weight: 500;
    margin: 4px 0;
}

/* ---------- Bubble base ---------- */
.chat-bubble {
    max-width: 78%;
    padding: 9px 13px;
    border-radius: 18px;
    font-size: 12px;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(8px) scale(0.97);
    transition: opacity 0.45s cubic-bezier(0.34,1.56,0.64,1),
                transform 0.45s cubic-bezier(0.34,1.56,0.64,1);
    pointer-events: none;
}
.chat-bubble.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Customer bubble (right) */
.chat-bubble--customer {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

/* Business bubble (left) */
.chat-bubble--business {
    background: #fff;
    color: #1a1a1a;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    border: 1px solid #f0ebe0;
}

/* Tick marks for customer bubbles */
.chat-bubble--customer::after {
    content: '✓✓';
    display: block;
    text-align: right;
    font-size: 9px;
    color: var(--gold, #C9A84C);
    margin-top: 3px;
    opacity: 0.85;
}

/* Gold highlight on business reply */
.chat-bubble--business-first {
    border-left: 2px solid var(--gold, #C9A84C);
}

/* ---------- Typing indicator ---------- */
.chat-typing {
    position: absolute;
    bottom: 62px;
    left: 14px;
    display: none;
    align-items: center;
    gap: 4px;
    padding: 9px 14px;
    background: #fff;
    border-radius: 18px;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    border: 1px solid #f0ebe0;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 5;
}
.chat-typing.is-active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}
.chat-typing__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #bbb;
    animation: typingBounce 1.2s infinite ease-in-out;
}
.chat-typing__dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing__dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); background: #ccc; }
    30% { transform: translateY(-5px); background: var(--gold, #C9A84C); }
}

/* ---------- Chat footer ---------- */
.chat-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 52px;
    box-sizing: border-box;
    padding: 10px 12px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    z-index: 3;
}
.chat-footer__input {
    flex: 1;
    background: #f5f5f5;
    border-radius: 20px;
    padding: 7px 14px;
    font-size: 11px;
    color: #aaa;
    border: none;
    outline: none;
    cursor: default;
}
.chat-footer__send {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--gold, #C9A84C);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.chat-footer__send svg {
    width: 14px;
    height: 14px;
    color: #fff;
}

/* ---------- Home indicator ---------- */
.phone-home-bar {
    padding: 6px 0 10px;
    display: flex;
    justify-content: center;
    background: #0e0e0e;
}
.phone-home-bar__line {
    width: 100px;
    height: 4px;
    border-radius: 4px;
    background: rgba(255,255,255,0.25);
}

/* ---------- FAQ accordion (right column) ---------- */
.faq-chat-accordion {}

.faq-chat-item {
    border-bottom: 1px solid var(--border-color, #E5DDD0);
    transition: border-color 0.3s;
}
.faq-chat-item:first-child { border-top: 1px solid var(--border-color, #E5DDD0); }

.faq-chat-item__trigger {
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 4px;
    text-align: left;
    gap: 16px;
    transition: color 0.25s;
}
.faq-chat-item__trigger:focus-visible {
    outline: 2px solid var(--gold, #C9A84C);
    outline-offset: 2px;
    border-radius: 4px;
}

.faq-chat-item__q-text {
    font-size: 15.5px;
    font-weight: 600;
    color: var(--text-primary, #1A1A1A);
    line-height: 1.4;
    font-family: var(--font-heading, 'Outfit', sans-serif);
    transition: color 0.25s;
}

.faq-chat-item.is-open .faq-chat-item__q-text,
.faq-chat-item__trigger:hover .faq-chat-item__q-text {
    color: var(--gold-dark, #A8832A);
}

.faq-chat-item__icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid var(--border-color, #E5DDD0);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.3s, border-color 0.3s, transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
    color: var(--text-muted, #888);
}
.faq-chat-item__icon svg { width: 14px; height: 14px; }

.faq-chat-item.is-open .faq-chat-item__icon {
    background: var(--gold, #C9A84C);
    border-color: var(--gold, #C9A84C);
    color: #fff;
    transform: rotate(45deg);
}

.faq-chat-item__body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4,0,0.2,1);
}
.faq-chat-item__body-inner {
    padding: 0 4px 22px;
    font-size: 14.5px;
    color: var(--text-secondary, #4A4A4A);
    line-height: 1.7;
}

/* Hint text below accordion */
.faq-chat-hint {
    margin-top: 28px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: rgba(201,168,76,0.07);
    border-left: 3px solid var(--gold, #C9A84C);
    border-radius: 0 8px 8px 0;
    font-size: 13.5px;
    color: var(--text-secondary, #4A4A4A);
}
.faq-chat-hint svg { width: 18px; height: 18px; color: var(--gold, #C9A84C); flex-shrink: 0; }

/* ---------- Intro idle message (shown before any FAQ clicked) ---------- */
.chat-idle {
    text-align: center;
    padding: 30px 16px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: opacity 0.4s ease;
}
.chat-idle__icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a1a1a, #333);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.chat-idle__icon span {
    font-size: 20px;
    font-weight: 800;
    color: var(--gold, #C9A84C);
    font-family: var(--font-heading, 'Outfit', sans-serif);
}
.chat-idle__name {
    font-weight: 700;
    font-size: 14px;
    color: #111;
    font-family: var(--font-heading, 'Outfit', sans-serif);
}
.chat-idle__sub {
    font-size: 11.5px;
    color: #888;
    text-align: center;
    line-height: 1.5;
    max-width: 180px;
}
.chat-idle__prompt {
    font-size: 11px;
    color: var(--gold-dark, #A8832A);
    font-weight: 600;
    margin-top: 4px;
    animation: idlePulse 2s infinite ease-in-out;
}
@keyframes idlePulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .faq-chat-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .faq-chat__phone-col {
        position: relative;
        top: auto;
    }
    .phone-mockup {
        width: 240px;
        border-radius: 38px;
        padding: 12px 8px;
    }
    .phone-mockup__screen {
        border-radius: 28px;
        height: 460px;
        min-height: 460px;
        max-height: 460px;
    }
    .chat-messages {
        top: 90px;
        bottom: 48px;
    }
    .chat-footer {
        height: 48px;
    }
    .phone-mockup::before {
        width: 70px;
        height: 20px;
    }
}

@media (max-width: 640px) {
    .phone-mockup {
        width: 220px;
    }
    .phone-mockup__screen {
        height: 420px;
        min-height: unset;
    }
    .chat-bubble { font-size: 11px; }
}
