/* ===== floating-widget.css ===== */

/* ---- Welcome Tooltip ---- */
.fw-welcome-tooltip {
    position: fixed;
    bottom: 68px;
    right: 20px;
    width: 340px;
    background: #fff;
    border: 3px solid #5d975a;
    border-radius: 14px;
    padding: 10px 32px 10px 14px;
    z-index: 9998;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.13);
    font-family: 'Inter', sans-serif;
    color-scheme: light !important;
    animation: fwSlideUp 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

/* Down-pointing arrow (outer border color) */
.fw-welcome-tooltip::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 12px 11px 0;
    border-style: solid;
    border-color: #5d975a transparent transparent;
}

/* Down-pointing arrow (inner white fill) */
.fw-welcome-tooltip::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 9px 8px 0;
    border-style: solid;
    border-color: #fff transparent transparent;
    z-index: 1;
}

.fw-brand-title {
    margin: 0 0 15px;
    font-size: 18px;
    font-weight: 800;
    color: #1a1a1a !important;
    letter-spacing: -0.5px;
}

.fw-welcome-tooltip p {
    margin: 0;
    font-size: 13px;
    color: #444;
    line-height: 1.4;
}

.fw-tooltip-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0;
}

.fw-tooltip-close:hover {
    color: #333;
}

@keyframes fwSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Floating Bar ---- */
#fw-contact-btn i,
#fw-welcome-tooltip i,
#fw-floating-bar i,
#fw-popup-wrapper i {
    pointer-events: none;
}

.fw-floating-bar {
    position: fixed;
    bottom: 0;
    right: 20px;
    width: 340px;
    /* Wider bar to match wider popup */
    height: 60px;
    /* Fixed height as requested */
    background: #5d975a;
    color-scheme: light !important;
    display: flex;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    z-index: 9999;
    box-shadow: 0 -3px 14px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

/* Also sync tooltip width to bar width */
.fw-welcome-tooltip {
    width: 340px;
}

.fw-tab-btn {
    flex: 1;
    background: transparent;
    color: #fff;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0;
    /* Let flex centering handle it since height is fixed */
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1;
    transition: filter 0.18s;
    font-family: 'Inter', sans-serif;
}

.fw-tab-btn:last-child {
    border-right: none;
}

.fw-tab-btn i {
    font-size: 16px;
    margin: 0;
    padding: 0;
    line-height: 1;
    display: block;
}

.fw-tab-btn span {
    display: block;
    line-height: 1;
}

.fw-tab-btn:hover {
    filter: brightness(1.1);
}

.fw-tab-btn.active {
    filter: brightness(0.9);
}

/* Base button color (Standardized so they don't look "pre-activated") */
.fw-tab-btn {
    background-color: #6fb06b; /* Consistent base green */
}

/* Standardized active color (Same for ALL buttons) */
.fw-tab-btn.active {
    background-color: #3e753b !important; /* Dark green requested */
}

/* =========================================
   POPUP WINDOW
   ========================================= */
.fw-popup-wrapper {
    position: fixed;
    bottom: 72px;
    /* Increased gap above 60px bar */
    right: 20px;
    width: 680px;
    /* Wider */
    height: 500px;
    /* Slightly reduced height */
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
    display: flex;
    z-index: 10000;
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.28s ease, transform 0.28s ease, width 0.3s ease;
    pointer-events: none;
    font-family: 'Inter', sans-serif;
    color-scheme: light !important;
}

.fw-popup-wrapper.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* Resets */
.fw-popup-wrapper h2 {
    font-size: 20px;
    color: #111;
    margin: 0 0 6px;
    font-weight: 700;
}

.fw-popup-wrapper h3 {
    font-size: 17px;
    color: #111;
    margin: 0 0 10px;
    font-weight: 600;
}

.fw-popup-wrapper p {
    font-size: 13px;
    color: #555;
    margin: 0 0 14px;
    line-height: 1.5;
}

/* ---- Sidebar (shown in maximized state) ---- */
.fw-sidebar {
    width: 250px;
    min-width: 250px;
    background: #eef7f2;
    /* Light mint */
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease, min-width 0.3s ease, padding 0.3s ease, opacity 0.2s ease;
    overflow: hidden;
}

.fw-logo-card {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.fw-logo-card img {
    max-width: 100%;
    max-height: 45px;
}

.fw-brand-title {
    font-size: 21px;
    color: #1a1a1a;
    font-weight: 700;
    margin: 0 0 16px;
    line-height: 1.2;
}

.fw-brand-item {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    align-items: flex-start;
}

.fw-brand-icon {
    width: 24px;
    text-align: center;
    color: #6da096;
    /* Teal green */
    font-size: 16px;
    flex-shrink: 0;
}

.fw-brand-text {
    font-size: 14px;
    color: #444;
    line-height: 1.4;
}

.fw-brand-text a {
    color: inherit;
    text-decoration: none;
    transition: color 0.18s;
}

.fw-brand-text a:hover {
    color: #6da096;
}

.fw-brand-text strong {
    color: #1a1a1a;
    font-weight: 600;
}

.fw-brand-sep {
    border: none;
    border-top: 1px solid #dceadc;
    margin: 5px 0 15px;
}

/* Minimized state — shrink the wrapper and hide sidebar */
.fw-popup-wrapper.fw-minimized {
    width: 340px;
    /* Synchronized with .fw-floating-bar width */
}

.fw-popup-wrapper.fw-minimized .fw-sidebar {
    width: 0;
    min-width: 0;
    padding: 0;
    opacity: 0;
    border: none;
}

.fw-logo-box {
    background: #fff;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 16px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
    text-align: center;
}

.fw-logo-box img {
    max-width: 100%;
    max-height: 42px;
    object-fit: contain;
}

.fw-info-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 11px;
    font-size: 12px;
    color: #333;
}

.fw-info-row i {
    color: #5d975a;
    margin-top: 2px;
    flex-shrink: 0;
    font-size: 12px;
}

.fw-divider {
    border: none;
    border-top: 1px solid #ccd9cc;
    margin: 14px 0;
}

.fw-hours-section strong {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #222;
}

/* ---- Right Content Area */
.fw-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    background: #fff;
    box-shadow: -10px 0 20px rgba(0, 0, 0, 0.04);
    z-index: 2;
    padding: 22px 22px 18px;
}

.fw-top-logo {
    margin-bottom: 12px;
}

.fw-top-logo img {
    max-height: 45px;
    max-width: 100%;
    object-fit: contain;
}

/* ---- Control Buttons (close + maximize/minimize) ---- */
.fw-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    /* Smaller */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.18s;
    z-index: 1;
}

.fw-close-btn:hover {
    background: #e0e0e0;
    color: #111;
}

/* Maximize/Minimize toggle button */
.fw-expand-btn {
    position: absolute;
    top: 10px;
    right: 40px;
    /* Left of close btn */
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    /* Smaller */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.18s;
    z-index: 1;
}

.fw-expand-btn:hover {
    background: #e0e0e0;
    color: #111;
}

/* Views */
.fw-view {
    display: none;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    /* Hide scrollbars as content should fit now */
}

.fw-view.active {
    display: flex;
    animation: fwFadeIn 0.25s ease both;
}

@keyframes fwFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Main Buttons */
.fw-main-buttons {
    margin-bottom: 14px;
}

.fw-btn-large {
    width: 100%;
    background: #5d975a;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 10px;
    transition: background 0.18s;
}

.fw-btn-large span {
    margin-top: 7px;
}

.fw-btn-large:hover {
    background: #4a7d47;
}

.fw-btn-row {
    display: flex;
    gap: 10px;
}

.fw-btn-medium {
    flex: 1;
    background: #395c39;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s;
}

.fw-btn-medium span {
    margin-top: 6px;
}

.fw-btn-medium:hover {
    background: #2e4a2e;
}

/* Fake input */
.fw-ai-prompt p {
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #444;
}

.fw-fake-input {
    border: 1.5px solid #5d975a;
    border-radius: 8px;
    padding: 11px 14px;
    color: #999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    transition: border-color 0.18s;
}

.fw-fake-input i {
    color: #ccc;
    font-size: 15px;
}

.fw-fake-input:hover {
    border-color: #4a7d47;
}

/* Forms */
.fw-form {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.fw-input-row {
    display: flex;
    gap: 10px;
}

.fw-form input,
.fw-form select,
.fw-form textarea {
    width: 100%;
    padding: 6px 11px;
    /* Even more compacted */
    margin-bottom: 6px;
    /* Even more compacted */
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.fw-form input:focus,
.fw-form select:focus,
.fw-form textarea:focus {
    border-color: #5d975a;
}

.fw-form textarea {
    resize: none;
    flex: 1;
    min-height: 50px;
    /* Reduced to fit without scroll */
}

/* Compact minimized forms */
.fw-minimized .fw-input-row {
    flex-direction: row;
    gap: 10px;
}

.fw-minimized .fw-content {
    padding: 10px 16px 14px;
}

.fw-minimized .fw-top-logo {
    margin-bottom: 12px;
}

.fw-minimized .fw-popup-wrapper h2 {
    font-size: 18px;
    margin-bottom: 4px;
}

.fw-minimized .fw-view {
    overflow-y: auto;
    padding-right: 4px;
    /* Space for scrollbar */
}

/* Scrollbar styling for a cleaner look */
.fw-view::-webkit-scrollbar {
    width: 5px;
}

.fw-view::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.fw-view::-webkit-scrollbar-thumb {
    background: #5d975a;
    border-radius: 10px;
}

.fw-privacy-notice {
    font-size: 11px;
    color: #777;
    margin-bottom: 10px;
}

.fw-privacy-notice a {
    color: #5d975a;
    text-decoration: none;
}

.fw-top-logo {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 5px;
    margin-top: 5px;
}

/* Hide top logo when sidebar is visible (maximized mode) */
#fw-popup-wrapper:not(.fw-minimized) .fw-top-logo {
    display: none;
}

.fw-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 6px;
    border-top: 1px solid #eef3ee;
}

.fw-back-btn {
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.fw-back-btn:hover {
    color: #5d975a;
}

.fw-submit-btn {
    background: #5d975a;
    color: #fff;
    border: none;
    padding: 8px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s;
}

.fw-submit-btn:hover {
    background: #4a7d47;
}

/* Chat */
.fw-chat-container {
    padding: 0 !important;
}

.fw-chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fw-chat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 15px;
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.fw-bot {
    background: #f1f3f5;
    color: #212529;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.fw-user {
    background: #406548;
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

/* Suggested Question Buttons */
.fw-chat-quick-replies {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.fw-faq-btn {
    background: #ffffff;
    border: 1px solid #406548;
    color: #406548;
    text-align: left;
    font-size: 0.85rem;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: fit-content;
    max-width: 100%;
}

.fw-faq-btn:hover {
    background: #406548;
    color: #ffffff;
    transform: translateX(3px);
}

.fw-chat-bot-branding {
    font-size: 10px;
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 4px;
}

.fw-quick-replies {
    display: flex;
    flex-direction: column;
    margin-top: 8px;
}

.fw-qr-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.fw-qr-row:last-child {
    margin-bottom: 0;
}

.fw-qr-btn {
    background: #e2efe2;
    color: #3a5e3a;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.18s;
}

.fw-qr-btn i {
    font-size: 16px;
    color: #79a8a3;
}
.fw-chat-msg.fw-typing {
    opacity: 0.6;
    padding: 8px 12px;
}

.fw-chat-msg.fw-typing::after {
    content: '...';
    animation: fw-blink 1s infinite;
}

@keyframes fw-blink {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.fw-qr-btn:hover {
    background: #cde3cd;
}

.fw-chat-input-area {
    border-top: 1px solid #eee;
    padding-top: 12px;
}

.fw-chat-label {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    margin-bottom: 6px;
}

.fw-chat-form {
    position: relative;
}

.fw-chat-form input {
    width: 100%;
    border: 1.5px solid #5d975a;
    border-radius: 8px;
    padding: 10px 44px 10px 14px;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}

.fw-chat-form button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #bbb;
    font-size: 16px;
    cursor: pointer;
    transition: color 0.18s;
}

.fw-chat-form input:focus+button,
.fw-chat-form button:hover {
    color: #5d975a;
}

/* ---- Mobile ---- */
@media (max-width: 720px) {
    .fw-floating-bar {
        width: 100%;
        right: 0;
        border-radius: 0;
    }

    .fw-welcome-tooltip {
        width: calc(100% - 40px);
        right: 20px;
    }

    .fw-popup-wrapper {
        width: 100%;
        right: 0;
        bottom: 56px;
        height: 82vh;
        border-radius: 14px 14px 0 0;
    }

    .fw-sidebar {
        display: none !important;
    }

    .fw-content {
        padding: 20px 18px 16px;
    }

    .fw-expand-btn {
        display: none;
    }
}

/* =========================================
   FORCE LIGHT THEME (Fix for Global Dark Mode)
   ========================================= */
html.dark-mode #fw-popup-wrapper,
html.dark-scheme #fw-popup-wrapper {
    background-color: #ffffff !important;
    color: #333 !important;
    color-scheme: light !important;
}

html.dark-mode #fw-popup-wrapper .fw-sidebar,
html.dark-scheme #fw-popup-wrapper .fw-sidebar {
    background-color: #f7f9f7 !important;
    border-right: 1px solid #eee !important;
    color: #333 !important;
}

html.dark-mode #fw-popup-wrapper .fw-content,
html.dark-scheme #fw-popup-wrapper .fw-content {
    background-color: #ffffff !important;
}

html.dark-mode .fw-welcome-tooltip,
html.dark-scheme .fw-welcome-tooltip {
    background-color: #ffffff !important;
}

/* Fix specific text that global dark mode targets, avoiding icons/buttons */
html.dark-mode #fw-popup-wrapper h2,
html.dark-scheme #fw-popup-wrapper h2,
html.dark-mode #fw-popup-wrapper p,
html.dark-scheme #fw-popup-wrapper p,
html.dark-mode #fw-popup-wrapper p strong,
html.dark-scheme #fw-popup-wrapper p strong,
html.dark-mode #fw-popup-wrapper .fw-brand-title,
html.dark-scheme #fw-popup-wrapper .fw-brand-title,
html.dark-mode #fw-popup-wrapper .fw-chat-label,
html.dark-scheme #fw-popup-wrapper .fw-chat-label,
html.dark-mode #fw-popup-wrapper .fw-chat-label strong,
html.dark-scheme #fw-popup-wrapper .fw-chat-label strong,
html.dark-mode .fw-welcome-tooltip strong,
html.dark-scheme .fw-welcome-tooltip strong,
html.dark-mode .fw-welcome-tooltip p,
html.dark-scheme .fw-welcome-tooltip p {
    color: #1a1a1a !important;
}

html.dark-mode #fw-popup-wrapper .fw-brand-text,
html.dark-scheme #fw-popup-wrapper .fw-brand-text,
html.dark-mode #fw-popup-wrapper .fw-brand-text strong,
html.dark-scheme #fw-popup-wrapper .fw-brand-text strong {
    color: #444 !important;
}

/* Fix Inputs inside widget */
html.dark-mode #fw-popup-wrapper .fw-form input,
html.dark-scheme #fw-popup-wrapper .fw-form input,
html.dark-mode #fw-popup-wrapper .fw-form select,
html.dark-scheme #fw-popup-wrapper .fw-form select,
html.dark-mode #fw-popup-wrapper .fw-form textarea,
html.dark-scheme #fw-popup-wrapper .fw-form textarea,
html.dark-mode #fw-popup-wrapper .fw-chat-form input,
html.dark-scheme #fw-popup-wrapper .fw-chat-form input {
    background-color: #fff !important;
    color: #1a1a1a !important;
}

/* Ensure Chat messages stay perfectly readable */
html.dark-mode #fw-popup-wrapper .fw-bot,
html.dark-scheme #fw-popup-wrapper .fw-bot {
    color: #1a1a1a !important;
}
html.dark-mode #fw-popup-wrapper .fw-user,
html.dark-scheme #fw-popup-wrapper .fw-user {
    color: #fff !important;
}