/* ==========================================================================
   Anter Chatbot Widget Styles — Anter Consulting Brand Palette
   Palette:
   - Primary Green:      #006944
   - Light Lime Accent:  #dff9ba
   - Vibrant Green:      #34c569
   - Pure White:         #ffffff (Chat body & surfaces)
   - Dark Slate Green:   #1f3832 (Text & dark accents)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&display=swap');

#anter-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    box-sizing: border-box;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

#anter-chat-widget *,
#anter-chat-widget input,
#anter-chat-widget textarea,
#anter-chat-widget select,
#anter-chat-widget button,
#anter-chat-widget option,
#anter-chat-widget optgroup,
#anter-chat-widget label {
    box-sizing: border-box;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    text-decoration: none !important;
}

/* ── Global Theme Isolation: Stop Hello Elementor / theme colours bleeding in ── */
#anter-chat-widget a,
#anter-chat-widget a:hover,
#anter-chat-widget a:visited,
#anter-chat-widget a:focus {
    color: inherit !important;
    text-decoration: none !important;
}

/* Secondary menu buttons — dark text, keep on hover */
#anter-chat-widget .chat-option-btn:not(.chat-option-primary),
#anter-chat-widget .chat-option-btn:not(.chat-option-primary):hover,
#anter-chat-widget .chat-option-btn:not(.chat-option-primary):focus {
    color: #111827 !important;
}

#anter-chat-widget .chat-option-btn:not(.chat-option-primary) .chat-option-label,
#anter-chat-widget .chat-option-btn:not(.chat-option-primary):hover .chat-option-label {
    color: #111827 !important;
}

/* Primary green button — always white text, never red */
#anter-chat-widget .chat-option-btn.chat-option-primary,
#anter-chat-widget .chat-option-btn.chat-option-primary:hover,
#anter-chat-widget .chat-option-btn.chat-option-primary:focus {
    color: #ffffff !important;
}

#anter-chat-widget .chat-option-btn.chat-option-primary .chat-option-label,
#anter-chat-widget .chat-option-btn.chat-option-primary:hover .chat-option-label {
    color: #ffffff !important;
}

/* Submit + back buttons */
#anter-chat-widget .chat-btn-primary,
#anter-chat-widget .chat-btn-primary:hover {
    color: #ffffff !important;
}

#anter-chat-widget .chat-btn-secondary,
#anter-chat-widget .chat-btn-secondary:hover {
    color: #4b5563 !important;
}

/* Floating Launcher Button */
#anter-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #006944 0%, #34c569 100%);
    border: 2px solid #ffffff;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 105, 68, 0.35), 0 2px 8px rgba(31, 56, 50, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
    outline: none;
    position: relative;
}

#anter-chat-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 30px rgba(0, 105, 68, 0.45), 0 4px 12px rgba(52, 197, 105, 0.3);
}

#anter-chat-toggle:active {
    transform: scale(0.96);
}

#anter-chat-toggle svg {
    display: block;
    transition: transform 0.2s ease;
    color: #ffffff;
}

/* Pulse badge indicator */
.anter-chat-badge-pulse {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #34c569;
    border-radius: 50%;
    border: 2.5px solid #ffffff;
    box-shadow: 0 0 8px rgba(52, 197, 105, 0.8);
    animation: chatPulse 2.5s infinite;
}

@keyframes chatPulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* Chat Container Window */
#anter-chat-window {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: auto;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.04);
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
    transform-origin: bottom right;
}

#anter-chat-window.anter-chat-hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.92) translateY(16px);
    pointer-events: none;
}

/* Chat Header */
.anter-chat-header {
    background: #ffffff;
    color: #111827;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.anter-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.anter-chat-header-logo {
    height: 32px;
    max-width: 170px;
    object-fit: contain;
    display: block;
}

.anter-chat-status {
    font-size: 11.5px;
    color: #6b7280;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.status-dot {
    width: 7px;
    height: 7px;
    background: #34c569;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 2px rgba(52, 197, 105, 0.25);
}

#anter-chat-close-btn {
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

#anter-chat-close-btn:hover {
    color: #111827;
    background: #f3f4f6;
    transform: rotate(90deg);
}

/* Chat Body (Message Container) — Pure White Background */
.anter-chat-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #ffffff !important;
}

/* Scrollbar styling */
.anter-chat-body::-webkit-scrollbar {
    width: 5px;
}
.anter-chat-body::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
}
.anter-chat-body::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

/* Bot Messages — Clean White Card, 12px Radius, 1px Neutral Border */
.bot-msg {
    background: #ffffff;
    color: #4b5563;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.55;
    font-weight: 400;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    border: 1px solid #e5e7eb;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    animation: fadeIn 0.28s ease;
}

.bot-msg p {
    margin: 0 0 8px 0;
    color: #4b5563;
    font-weight: 400;
}

.bot-msg p:last-child {
    margin-bottom: 0;
}

.bot-msg strong {
    color: #111827;
    font-weight: 700;
}

.bot-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin-right: 6px;
    color: #006944;
}

.chat-loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 105, 68, 0.2);
    border-top-color: #006944;
    border-radius: 50%;
    animation: chatSpin 0.75s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes chatSpin {
    to { transform: rotate(360deg); }
}

.chat-inline-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #eef8f2;
    color: #006944;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
    border: 1px solid rgba(0, 105, 68, 0.15);
}

.chat-inline-link:hover {
    background: #006944;
    color: #ffffff;
    border-color: #006944;
    transform: translateY(-1px);
}

/* Interactive Option Buttons — Neutral List Style with Green Action Anchors */
.chat-options {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: 2px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    animation: fadeIn 0.35s ease;
}

.chat-option-btn {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    background: #f9fafb !important;
    border: 1px solid #e5e7eb !important;
    color: #111827 !important;
    padding: 12px 14px !important;
    border-radius: 50px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    text-align: left !important;
    transition: all 0.18s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    box-shadow: none !important;
}

.chat-option-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #006944;
    width: 22px;
    height: 22px;
    line-height: 1;
    transition: color 0.18s ease;
}

.chat-option-icon svg {
    display: block;
    width: 18px;
    height: 18px;
    stroke: #006944;
}

.chat-option-label {
    flex: 0 1 auto;
    min-width: 0;
    line-height: 1.35;
    word-break: break-word;
    overflow-wrap: break-word;
    color: #111827;
    font-weight: 600;
}

.chat-option-chevron {
    flex-shrink: 0;
    color: #006944;
    opacity: 0.75;
    margin-left: 6px;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.chat-option-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #111827 !important;
    transform: none;
    box-shadow: none !important;
}

.chat-option-btn:hover .chat-option-label {
    color: #111827 !important;
}

.chat-option-btn:hover .chat-option-icon {
    color: #006944 !important;
}

.chat-option-btn:hover .chat-option-icon svg {
    stroke: #006944 !important;
}

.chat-option-btn:hover .chat-option-chevron {
    opacity: 1;
    transform: translateX(3px);
    color: #006944 !important;
}

/* Primary Hero Option: Fast-Track CV Drop (Elevated with Shadow, Solid Green Fill) */
.chat-option-btn.chat-option-primary {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: #006944;
    border: 1px solid #006944;
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(0, 105, 68, 0.22) !important;
}

.chat-option-btn.chat-option-primary .chat-option-label {
    color: #ffffff;
    font-weight: 600;
}

.chat-option-btn.chat-option-primary .chat-option-icon {
    color: #ffffff;
}

.chat-option-btn.chat-option-primary .chat-option-icon svg {
    width: 19px;
    height: 19px;
    stroke: #ffffff;
    stroke-width: 2.6;
}

.chat-option-btn.chat-option-primary .chat-option-chevron {
    color: #ffffff;
    opacity: 0.85;
}

.chat-option-btn.chat-option-primary:hover {
    background: #005336;
    border-color: #005336;
    color: #ffffff !important;
    box-shadow: 0 5px 14px rgba(0, 105, 68, 0.32) !important;
    transform: translateY(-1px);
}

.chat-option-btn.chat-option-primary:hover .chat-option-label {
    color: #ffffff !important;
}

.chat-option-btn.chat-option-primary:hover .chat-option-icon {
    color: #ffffff !important;
}

.chat-option-btn.chat-option-primary:hover .chat-option-icon svg {
    stroke: #ffffff !important;
}

.chat-option-btn.chat-option-primary:hover .chat-option-chevron {
    opacity: 1;
    transform: translateX(3px);
    color: #ffffff !important;
}

/* Pinned Bottom Strip Footer with Divider */
.anter-chat-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 16px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    font-size: 11.5px;
    color: #6b7280;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.anter-chat-footer .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34c569;
    box-shadow: none;
    margin: 0;
    flex-shrink: 0;
}

/* Forms & Inputs */
.chat-form-group {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: 4px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    animation: fadeIn 0.28s ease;
}

.chat-input,
.chat-select,
.chat-textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 13px;
    background: #ffffff;
    color: #111827;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

.chat-input::placeholder,
.chat-textarea::placeholder {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    color: #9ca3af;
    opacity: 1;
}

.chat-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23006944' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

.chat-select option {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    background: #ffffff;
    color: #111827;
    font-size: 13px;
}

.chat-textarea {
    resize: vertical;
    min-height: 80px;
    max-height: 140px;
    line-height: 1.5;
}

.chat-input:focus,
.chat-select:focus,
.chat-textarea:focus {
    border-color: #006944;
    box-shadow: 0 0 0 3px rgba(0, 105, 68, 0.12);
}

.chat-field-label {
    font-size: 11.5px;
    font-weight: 600;
    color: #374151;
    margin-bottom: -2px;
}

/* File Drop Area */
.chat-file-drop {
    position: relative;
    border: 1.5px dashed #d1d5db;
    background: #f9fafb;
    padding: 18px 14px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.chat-file-drop:hover {
    background: #f0fdf4;
    border-color: #006944;
}

.chat-file-drop input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.chat-file-text {
    font-size: 12.5px;
    color: #111827;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.chat-file-text svg {
    display: block;
    color: #006944;
    stroke: #006944;
}

.chat-file-hint {
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
}

.chat-file-selected-name {
    margin-top: 8px;
    font-size: 11.5px;
    font-weight: 600;
    color: #006944;
    background: #eef8f2;
    padding: 6px 12px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(0, 105, 68, 0.2);
    word-break: break-all;
}

.chat-file-selected-name svg {
    width: 14px;
    height: 14px;
    stroke: #006944;
    display: block;
}

/* Primary and Secondary Buttons */
.chat-btn-primary {
    background: #006944 !important;
    color: #ffffff !important;
    border: 1px solid #006944 !important;
    padding: 12px 18px !important;
    border-radius: 50px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.18s ease !important;
    text-align: center !important;
    box-shadow: 0 3px 10px rgba(0, 105, 68, 0.22) !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.chat-btn-primary:hover {
    background: #005336;
    border-color: #005336;
    color: #ffffff;
    box-shadow: 0 5px 14px rgba(0, 105, 68, 0.32) !important;
    transform: translateY(-1px);
}

.chat-btn-primary:active {
    transform: scale(0.985);
}

.chat-btn-secondary {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    color: #4b5563 !important;
    padding: 11px 16px !important;
    border-radius: 50px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease !important;
    text-align: center !important;
    margin-top: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
}

.chat-btn-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #111827;
}

/* Enquiry Quote Box */
.chat-enquiry-preview {
    font-size: 12px;
    color: #4b5563;
    margin-top: 10px;
    border-left: 3px solid #006944;
    background: #f9fafb;
    padding: 8px 12px;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    line-height: 1.5;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #anter-chat-window {
        bottom: 86px;
        right: 12px;
        left: 12px;
        width: auto;
        height: 80vh;
    }
    #anter-chat-toggle {
        bottom: 16px;
        right: 16px;
    }
}
