/* Forest Park AI Assistant — Neumorphic Chat Widget */
:root {
    --neu-bg: #f5f4ee;
    --neu-shadow-dark: rgba(111, 142, 88, 0.28);
    --neu-shadow-light: rgba(255, 255, 255, 0.9);
    --neu-primary: #002717;
    --neu-secondary: #a23f00;
}

.fp-chat-launcher {
    position: fixed;
    bottom: 24px;
    right: 35px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--neu-bg);
    border: none;
    box-shadow: 8px 8px 16px var(--neu-shadow-dark), -8px -8px 16px var(--neu-shadow-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.fp-chat-launcher:hover { transform: translateY(-3px); }
.fp-chat-launcher:active {
    box-shadow: inset 6px 6px 12px var(--neu-shadow-dark), inset -6px -6px 12px var(--neu-shadow-light);
}
.fp-chat-icon {
    font-size: 30px;
    font-variation-settings: 'FILL' 1;
    background: linear-gradient(135deg, var(--neu-primary), var(--neu-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: relative;
    z-index: 2;
}
.fp-chat-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--neu-secondary);
    opacity: 0;
    animation: fp-pulse 2.6s ease-out infinite;
    pointer-events: none;
}
@keyframes fp-pulse {
    0% { transform: scale(0.9); opacity: 0.5; }
    70% { transform: scale(1.55); opacity: 0; }
    100% { opacity: 0; }
}
.fp-chat-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #2e7d32;
    border: 2px solid var(--neu-bg);
    z-index: 3;
}

.fp-chat-panel {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 140px);
    background: var(--neu-bg);
    border-radius: 24px;
    box-shadow: 14px 14px 28px var(--neu-shadow-dark), -14px -14px 28px var(--neu-shadow-light);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    opacity: 0;
    transform: translateY(16px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    font-family: 'Manrope', sans-serif;
}
.fp-chat-panel.fp-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.fp-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 18px 14px;
    flex-shrink: 0;
}
.fp-chat-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--neu-bg);
    box-shadow: inset 4px 4px 8px var(--neu-shadow-dark), inset -4px -4px 8px var(--neu-shadow-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.fp-chat-avatar .material-symbols-outlined {
    font-size: 22px;
    font-variation-settings: 'FILL' 1;
    background: linear-gradient(135deg, var(--neu-primary), var(--neu-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.fp-chat-title { font-weight: 800; color: var(--neu-primary); font-size: 15px; line-height: 1.3; }
.fp-chat-subtitle { font-size: 12px; color: #414843; display: flex; align-items: center; gap: 6px; }
.fp-chat-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #2e7d32; display: inline-block; }
.fp-chat-close {
    margin-left: auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--neu-bg);
    border: none;
    box-shadow: 4px 4px 8px var(--neu-shadow-dark), -4px -4px 8px var(--neu-shadow-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--neu-primary);
    flex-shrink: 0;
}
.fp-chat-close:active {
    box-shadow: inset 3px 3px 6px var(--neu-shadow-dark), inset -3px -3px 6px var(--neu-shadow-light);
}

.fp-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 6px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.fp-msg { max-width: 84%; font-size: 13.5px; line-height: 1.55; }
.fp-msg-bot {
    align-self: flex-start;
    background: var(--neu-bg);
    box-shadow: inset 4px 4px 8px var(--neu-shadow-dark), inset -4px -4px 8px var(--neu-shadow-light);
    padding: 10px 14px;
    border-radius: 16px 16px 16px 4px;
    color: #1b1c19;
}
.fp-msg-user {
    align-self: flex-end;
    background: var(--neu-primary);
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 16px 16px 4px 16px;
    box-shadow: 4px 4px 10px var(--neu-shadow-dark);
}
.fp-msg-bot a { color: var(--neu-secondary); font-weight: 700; }
.fp-msg-bot p { margin: 0; }
.fp-msg-bot p + p,
.fp-msg-bot ul + p,
.fp-msg-bot ol + p,
.fp-msg-bot p + ul,
.fp-msg-bot p + ol { margin-top: 8px; }
.fp-msg-bot ul,
.fp-msg-bot ol { margin: 0; padding-left: 18px; }
.fp-msg-bot li { margin: 2px 0; }
.fp-msg-bot li + li { margin-top: 3px; }
.fp-msg-bot strong { font-weight: 800; }

.fp-msg-media {
    max-width: 84%;
    align-self: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    background: none;
    box-shadow: none;
}
.fp-chat-media-item {
    width: 132px;
    height: 132px;
    object-fit: cover;
    border-radius: 14px;
    box-shadow: 4px 4px 10px var(--neu-shadow-dark);
    background: var(--neu-bg);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.fp-chat-media-item:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 6px 6px 14px var(--neu-shadow-dark);
}

/* Click-to-enlarge previewer for chat media — a lightweight lightbox local
   to the chat widget (site.js's gallery page has its own separate one; this
   one has to work on every page, since the chat widget is global). */
.fp-chat-preview {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.fp-chat-preview.fp-open { display: flex; }
.fp-chat-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 39, 23, 0.92);
    backdrop-filter: blur(6px);
}
.fp-chat-preview-body {
    position: relative;
    z-index: 1;
    max-width: min(90vw, 900px);
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fp-chat-preview-body img,
.fp-chat-preview-body video {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
    object-fit: contain;
}
.fp-chat-preview-caption {
    position: absolute;
    bottom: 24px;
    left: 0;
    right: 0;
    z-index: 1;
    text-align: center;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}
.fp-chat-preview-close,
.fp-chat-preview-nav {
    position: absolute;
    z-index: 1;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}
.fp-chat-preview-close:hover,
.fp-chat-preview-nav:hover { background: rgba(255, 255, 255, 0.22); }
.fp-chat-preview-close { top: 20px; right: 20px; }
.fp-chat-preview-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.fp-chat-preview-next { right: 20px; top: 50%; transform: translateY(-50%); }
.fp-chat-preview-nav.fp-hidden { display: none; }
@media (max-width: 640px) {
    .fp-chat-preview-prev { left: 8px; }
    .fp-chat-preview-next { right: 8px; }
    .fp-chat-preview-close { top: 8px; right: 8px; }
}

.fp-chat-quickreplies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 18px 12px;
    flex-shrink: 0;
}
.fp-chip {
    font-size: 12px;
    font-weight: 700;
    font-family: 'Manrope', sans-serif;
    padding: 8px 14px;
    border-radius: 9999px;
    background: var(--neu-bg);
    color: var(--neu-primary);
    border: none;
    cursor: pointer;
    box-shadow: 3px 3px 6px var(--neu-shadow-dark), -3px -3px 6px var(--neu-shadow-light);
    transition: box-shadow 0.15s ease;
}
.fp-chip:active {
    box-shadow: inset 2px 2px 4px var(--neu-shadow-dark), inset -2px -2px 4px var(--neu-shadow-light);
}

.fp-chat-typing {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--neu-bg);
    border-radius: 16px 16px 16px 4px;
    box-shadow: inset 4px 4px 8px var(--neu-shadow-dark), inset -4px -4px 8px var(--neu-shadow-light);
}
.fp-chat-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #717973;
    animation: fp-bounce 1.2s infinite ease-in-out;
}
.fp-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.fp-chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes fp-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.fp-chat-inputrow {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px 18px;
    flex-shrink: 0;
}
.fp-chat-input {
    flex: 1;
    border: none;
    outline: none;
    background: var(--neu-bg);
    box-shadow: inset 4px 4px 8px var(--neu-shadow-dark), inset -4px -4px 8px var(--neu-shadow-light);
    border-radius: 9999px;
    padding: 12px 18px;
    font-size: 14px;
    font-family: 'Manrope', sans-serif;
    color: #1b1c19;
}
.fp-chat-input::placeholder { color: #717973; }
.fp-chat-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--neu-bg);
    border: none;
    cursor: pointer;
    box-shadow: 4px 4px 8px var(--neu-shadow-dark), -4px -4px 8px var(--neu-shadow-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.15s ease;
}
.fp-chat-send:active {
    box-shadow: inset 3px 3px 6px var(--neu-shadow-dark), inset -3px -3px 6px var(--neu-shadow-light);
}
.fp-chat-send .material-symbols-outlined {
    font-variation-settings: 'FILL' 1;
    background: linear-gradient(135deg, var(--neu-primary), var(--neu-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

@media (max-width: 480px) {
    .fp-chat-panel { right: 16px; left: 16px; width: auto; bottom: 96px; }
    .fp-chat-launcher { right: 16px; bottom: 16px; }
}
