/* GhostPilot Ghost-Chat Widget — frontend styles */
/* Primary chat color aligns with admin theme: --gp-primary (#8A2BE2) */

:root {
    --gc-primary:      #8A2BE2;
    --gc-primary-dark: #6d22b3;
    --gc-msg-user-bg:  #8A2BE2;
    --gc-msg-bot-bg:   #e8e8f0;
    --gc-msg-bot-text: #1a1a2e;
    --gc-focus-ring:   rgba(138, 43, 226, 0.15);
    --gc-input-border: #d1d5db;
    --gc-input-focus:  #8A2BE2;
    --gc-consent-link: #8A2BE2;
    --gc-panel-bg:     #fff;
    --gc-body-bg:      #f9fafb;
    --gc-footer-bg:    #fff;
    --gc-footer-border:#eee;
}

.gc-fab {
    position: fixed;
    z-index: 99999;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gc-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}
.gc-fab.bottom-right { bottom: 24px; right: 24px; }
.gc-fab.bottom-left  { bottom: 24px; left: 24px; }

.gc-panel {
    position: fixed;
    z-index: 99998;
    width: 370px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 100px);
    background: var(--gc-panel-bg);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: gc-slide-up 0.25s ease-out;
}
.gc-panel.bottom-right { bottom: 90px; right: 24px; }
.gc-panel.bottom-left  { bottom: 90px; left: 24px; }

@keyframes gc-slide-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.gc-panel-header {
    padding: 14px 16px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.gc-panel-title {
    font-weight: 600;
    font-size: 15px;
}
.gc-panel-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    opacity: 0.8;
}
.gc-panel-close:hover { opacity: 1; }

.gc-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--gc-body-bg);
}

.gc-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}
.gc-msg-bot {
    background: var(--gc-msg-bot-bg);
    color: var(--gc-msg-bot-text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.gc-msg-user {
    background: var(--gc-msg-user-bg);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.gc-panel-footer {
    padding: 12px;
    border-top: 1px solid var(--gc-footer-border);
    flex-shrink: 0;
    background: var(--gc-footer-bg);
}

.gc-msg-form,
.gc-contact-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.gc-msg-form {
    flex-wrap: nowrap;
}

.gc-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--gc-input-border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    min-width: 0;
}
.gc-input:focus {
    border-color: var(--gc-input-focus);
    box-shadow: 0 0 0 2px var(--gc-focus-ring);
}

.gc-contact-form .gc-input {
    flex-basis: 100%;
}

.gc-send-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
}
.gc-send-btn:hover { opacity: 0.9; }
.gc-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.gc-consent {
    font-size: 12px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-basis: 100%;
}
.gc-consent a { color: var(--gc-consent-link); }

/* ── Smart CTA Block ── */

.ghost-convert-cta {
    margin: 32px 0;
    padding: 28px 24px;
    background: linear-gradient(135deg, var(--gc-primary) 0%, #a855f7 100%);
    border-radius: 14px;
    color: #fff;
    text-align: center;
}
.gc-cta-inner {
    max-width: 480px;
    margin: 0 auto;
}
.gc-cta-headline {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #fff;
}
.gc-cta-desc {
    font-size: 15px;
    opacity: 0.9;
    margin: 0 0 18px;
}
.gc-cta-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}
.gc-cta-input {
    padding: 10px 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 14px;
    flex: 1;
    min-width: 180px;
    outline: none;
    transition: border-color 0.2s;
}
.gc-cta-input::placeholder { color: rgba(255,255,255,0.65); }
.gc-cta-input:focus { border-color: #fff; }
.gc-cta-consent {
    flex-basis: 100%;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    opacity: 0.85;
}
.gc-cta-consent a { color: #fff; text-decoration: underline; }
.gc-cta-btn {
    padding: 10px 24px;
    background: #fff;
    color: var(--gc-primary);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s;
}
.gc-cta-btn:hover { transform: scale(1.03); }
.gc-cta-success {
    font-size: 16px;
    font-weight: 600;
    margin: 12px 0 0;
}

.gc-cta-slide-in {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99990;
    animation: gc-slide-up 0.3s ease-out;
}
.gc-cta-slide-in .ghost-convert-cta {
    border-radius: 14px 14px 0 0;
    margin: 0;
}

.gc-cta-popup {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 99991;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.gc-cta-popup .ghost-convert-cta {
    margin: 0;
    max-width: 520px;
}

@media (max-width: 480px) {
    .gc-panel {
        width: calc(100vw - 16px);
        height: calc(100vh - 80px);
        bottom: 72px !important;
        right: 8px !important;
        left: 8px !important;
        border-radius: 12px;
    }
    .gc-fab {
        width: 50px;
        height: 50px;
        font-size: 22px;
    }
}

/* ═════════════════════════════════════════════════════════════════════════════
 * Smart CTA — Elite Full-Width layout + shared slide-up entry animation
 * ═════════════════════════════════════════════════════════════════════════════ */

/* Shared entry animation: fade + slide up when the block scrolls into view.
   ghost-chat.js adds `.gc-cta-visible` via IntersectionObserver. We opt the
   element OUT of the default hidden state when the user has `prefers-reduced-
   motion`, so motion-sensitive users see the CTA immediately. */
.gc-cta-animate-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .6s ease-out, transform .6s ease-out;
    will-change: opacity, transform;
}
.gc-cta-animate-in.gc-cta-visible {
    opacity: 1;
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    .gc-cta-animate-in { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ── Modern Boxed refinements (Option A) ─────────────────────────────── */
.gc-cta-boxed {
    border-radius: 16px;
    padding: 40px 32px;
    margin: 48px auto;
    max-width: 720px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.gc-cta-boxed .gc-cta-headline {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin: 0 0 10px;
}
.gc-cta-boxed .gc-cta-desc {
    font-size: 1rem;
    line-height: 1.55;
    margin: 0 0 20px;
    opacity: 0.92;
}

/* ── Elite Full-Width (Option B) — edge-to-edge footer CTA ─────────────
   Rendered via wp_footer, wrapped in .gc-cta-footer-anchor so it escapes
   any theme content container and sits at the very bottom of the page.
   When used inline (via [ghost_convert_cta layout="full"] inside post
   content), we still need the viewport break-out so the block escapes
   narrow post columns. */
.gc-cta-footer-anchor {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    clear: both;
}
.gc-cta-elite {
    display: block;
    width: 100%;
    margin: 0;
    padding: 72px 24px 56px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    text-align: center;
    box-sizing: border-box;
    border-radius: 16px;
}
/* When Elite appears inline inside post content, break out of the column —
   AND drop the radius because the block is truly edge-to-edge (100vw), so
   rounded corners would be clipped off-screen anyway. */
.entry-content .gc-cta-elite,
.post-content  .gc-cta-elite,
article        .gc-cta-elite {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-top: 64px;
    border-radius: 0;
}
.gc-cta-elite-inner {
    max-width: 780px;
    margin: 0 auto;
}
.gc-cta-elite-headline {
    font-size: 3rem;
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin: 0 0 12px;
}
.gc-cta-elite-desc {
    font-size: 1.05rem;
    line-height: 1.55;
    opacity: 0.75;
    max-width: 560px;
    margin: 0 auto 36px;
}
.gc-cta-elite-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
/* Single-line underline input + inline submit — the core Elite pattern. */
.gc-cta-elite-underline {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 520px;
    border-bottom: 1px solid var(--gc-underline, #111);
    padding-bottom: 6px;
}
.gc-cta-elite-input {
    flex: 1;
    border: 0;
    background: transparent;
    font-size: 1.1rem;
    padding: 10px 0;
    outline: none;
    font-family: inherit;
}
.gc-cta-elite-btn {
    border: 0;
    padding: 10px 22px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 999px;
    margin-left: 12px;
    transition: transform .15s ease, box-shadow .15s ease;
}
.gc-cta-elite-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.15);
}
.gc-cta-elite-consent {
    font-size: 0.78rem;
    opacity: 0.7;
    margin-top: 6px;
}
@media (max-width: 640px) {
    .gc-cta-elite { padding: 52px 20px 40px; }
    .gc-cta-elite-headline { font-size: 2.1rem; }
    .gc-cta-elite-underline { flex-direction: column; align-items: stretch; gap: 12px; border-bottom: 0; }
    .gc-cta-elite-input { border-bottom: 1px solid var(--gc-underline, #111); padding-bottom: 10px; }
    .gc-cta-elite-btn { margin-left: 0; width: 100%; }
}
