/* Proflight AI Chatbot Interface */

/* Theme Variables */
:root {
    --proflight-primary: #567996;
    --proflight-secondary: #F4C20B;
    --proflight-text: #777777;
    --proflight-accent: #FFFFFF;
    --proflight-heading: #134675;
    --proflight-font: "Nunito Sans", Sans-serif;
}

/* Speech Bubble Launcher */
.proflight-chatbot-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--proflight-primary) 0%, var(--proflight-heading) 100%);
    border-radius: 50%;
    border: 3px solid var(--proflight-secondary);
    padding: 0;
    font-family: var(--proflight-font);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    line-height: 1;
    color: var(--proflight-accent);
    box-shadow: 0 6px 18px rgba(19, 70, 117, 0.35);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 9998;
}

/* Pulsing rings that draw the eye to the launcher on page load. */
.proflight-chatbot-bubble::before,
.proflight-chatbot-bubble::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 3px solid var(--proflight-secondary);
    pointer-events: none;
    opacity: 0;
    animation: proflight-bubble-ring 2.6s cubic-bezier(0.2, 0.6, 0.35, 1) infinite;
}

.proflight-chatbot-bubble::after {
    animation-delay: 1.3s;
}

@keyframes proflight-bubble-ring {
    0% {
        transform: scale(0.95);
        opacity: 0.9;
    }
    70% {
        opacity: 0;
    }
    100% {
        transform: scale(1.75);
        opacity: 0;
    }
}

.proflight-chatbot-bubble-icon {
    display: block;
    line-height: 1;
}

/* Stop the rings once the visitor has opened the chat. */
.proflight-chatbot-bubble-attention::before,
.proflight-chatbot-bubble-attention::after {
    animation: none;
    opacity: 0;
}

.proflight-chatbot-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 24px rgba(19, 70, 117, 0.45);
}

.proflight-chatbot-bubble:hover::before,
.proflight-chatbot-bubble:hover::after {
    animation: none;
}

.proflight-chatbot-bubble:hover .proflight-chatbot-tooltip,
.proflight-chatbot-bubble:focus-visible .proflight-chatbot-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -10px);
}

/* Keyboard focus ring */
.proflight-chatbot-bubble:focus-visible {
    outline: 3px solid var(--proflight-secondary);
    outline-offset: 4px;
}

.proflight-chatbot-tooltip {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 50%;
    background: var(--proflight-heading);
    color: var(--proflight-accent);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 0);
    transition: all 0.3s ease;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.proflight-chatbot-tooltip-title {
    font-weight: 700;
    font-size: 14px;
    line-height: 1.3;
}

.proflight-chatbot-tooltip-sub {
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
    opacity: 0.9;
}

.proflight-chatbot-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    width: 8px;
    height: 8px;
    margin-top: -4px;
    margin-left: -4px;
    background: var(--proflight-heading);
    transform: rotate(45deg);
}

.proflight-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 420px;
    width: 420px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    background: var(--proflight-accent);
    font-family: var(--proflight-font);
    display: none;
    flex-direction: column;
    height: 680px;
    z-index: 9999;
}

.proflight-chatbot-container.open {
    display: flex;
}

.proflight-chatbot-header {
    background: linear-gradient(135deg, var(--proflight-primary) 0%, var(--proflight-heading) 100%);
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.proflight-chatbot-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.proflight-chatbot-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--proflight-accent);
    flex: 1;
    text-align: left;
}

/* PRO BOT wordmark: PRO in the website blue, BOT in the website yellow.
   PRO uses a lighter tint of #567996 so it stays legible on the blue
   gradient header. */
.proflight-chatbot-title {
    letter-spacing: 0.5px;
}

.proflight-chatbot-title-pro {
    color: #A6CBE8;
}

.proflight-chatbot-title-bot {
    color: var(--proflight-secondary);
}

.proflight-chatbot-minimize {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--proflight-accent);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.proflight-chatbot-minimize:hover {
    background: rgba(255, 255, 255, 0.2);
}

.proflight-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.proflight-chatbot-message {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
    animation: slideIn 0.3s ease-out;
}

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

.proflight-chatbot-message.user {
    align-items: flex-end;
}

.proflight-chatbot-message.loading {
    align-items: flex-start;
}

.proflight-chatbot-message.loading .proflight-chatbot-loading {
    background: #f5f5f5;
    padding: 12px 16px;
    border-radius: 10px;
    border-bottom-left-radius: 4px;
}

.proflight-chatbot-message-content {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.proflight-chatbot-message-content p {
    margin: 0.5em 0;
}

.proflight-chatbot-message-content p:first-child {
    margin-top: 0;
}

.proflight-chatbot-message-content p:last-child {
    margin-bottom: 0;
}

.proflight-chatbot-message-content strong {
    font-weight: 600;
    color: inherit;
}

.proflight-chatbot-message-content br {
    display: block;
    content: '';
}

.proflight-chatbot-message.user .proflight-chatbot-message-content {
    background: var(--proflight-primary);
    color: var(--proflight-accent);
    border-bottom-right-radius: 4px;
}

.proflight-chatbot-message.assistant .proflight-chatbot-message-content {
    background: #f5f5f5;
    color: var(--proflight-text);
    border-bottom-left-radius: 4px;
}

.proflight-chatbot-message.error .proflight-chatbot-message-content {
    background: #fee;
    color: #c33;
}

.proflight-chatbot-message.system .proflight-chatbot-message-content {
    background: #efefef;
    color: #666;
    font-size: 13px;
    font-style: italic;
}

/* Choice cards: fallback (no information) and session-ended states.
   These are system transitions rather than ProBot answers, so the wording
   is shown in the Proflight blue to set it apart from the grey answers.
   The card background is white so the blue keeps enough contrast (4.6:1)
   to stay readable at this text size.

   The selectors repeat .assistant on purpose: the answer bubble rule
   (.proflight-chatbot-message.assistant .proflight-chatbot-message-content)
   is three classes deep, so a shorter selector here would lose and the
   transition text would stay grey. */
.proflight-chatbot-message-options {
    width: 100%;
}

.proflight-chatbot-message.assistant.proflight-chatbot-message-options .proflight-chatbot-message-content {
    max-width: 100%;
    background: #ffffff;
    color: var(--proflight-primary);
}

/* A superseded card keeps its text but loses its buttons. */
.proflight-chatbot-message.assistant.proflight-chatbot-message-options-archived .proflight-chatbot-message-content {
    max-width: 100%;
    background: #fbfcfd;
    color: var(--proflight-primary);
}

.proflight-chatbot-support-hours {
    margin-top: 6px;
    font-size: 12px;
    font-style: italic;
    color: var(--proflight-primary);
}

.proflight-chatbot-options-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    width: 100%;
}

.proflight-chatbot-option-btn {
    flex: 1 1 auto;
    padding: 9px 14px;
    border: 1px solid var(--proflight-heading);
    border-radius: 18px;
    background: var(--proflight-accent);
    color: var(--proflight-heading);
    font-family: var(--proflight-font);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: all 0.2s ease;
}

.proflight-chatbot-option-btn-primary {
    background: var(--proflight-heading);
    border-color: var(--proflight-heading);
    color: var(--proflight-accent);
}

.proflight-chatbot-option-btn-primary:hover:not(:disabled) {
    background: var(--proflight-primary);
    border-color: var(--proflight-primary);
}

.proflight-chatbot-option-btn-secondary:hover:not(:disabled) {
    background: #eef3f8;
}

.proflight-chatbot-option-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.proflight-chatbot-option-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

.proflight-chatbot-loading {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 8px 0;
}

.proflight-chatbot-loading-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--proflight-primary);
    animation: bounce 1.4s infinite;
    box-shadow: 0 2px 4px rgba(86, 121, 150, 0.2);
}

.proflight-chatbot-loading-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.proflight-chatbot-loading-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

.proflight-chatbot-input-area {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    background: #fafafa;
}

.proflight-chatbot-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--proflight-font);
    outline: none;
    transition: border-color 0.2s ease;
}

.proflight-chatbot-input:focus {
    border-color: var(--proflight-primary);
    box-shadow: 0 0 0 2px rgba(86, 121, 150, 0.1);
}

.proflight-chatbot-input::placeholder {
    color: var(--proflight-text);
}

.proflight-chatbot-send {
    padding: 10px 20px;
    background: var(--proflight-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.proflight-chatbot-send:hover:not(:disabled) {
    background: var(--proflight-heading);
    box-shadow: 0 2px 8px rgba(86, 121, 150, 0.3);
}

.proflight-chatbot-send:active:not(:disabled) {
    transform: scale(0.98);
}

.proflight-chatbot-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.proflight-chatbot-question-count {
    font-size: 12px;
    color: #999;
    text-align: center;
    padding: 8px;
    border-top: 1px solid #f0f0f0;
}

/* Action Buttons */
.proflight-chatbot-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
    background: #fafafa;
}

.proflight-chatbot-action-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--proflight-secondary);
    background: var(--proflight-accent);
    color: var(--proflight-primary);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--proflight-font);
    white-space: nowrap;
}

.proflight-chatbot-action-btn:hover {
    background: var(--proflight-secondary);
    color: var(--proflight-heading);
    box-shadow: 0 2px 6px rgba(244, 194, 11, 0.2);
}

.proflight-chatbot-action-btn:active {
    transform: scale(0.98);
}

/* Suggestion / topic menu */
.proflight-chatbot-suggestions {
    background: #f8fafc;
    border-top: 1px solid #e0e0e0;
    padding: 6px 12px;
    flex-shrink: 0;
}

.proflight-chatbot-suggestions-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 6px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--proflight-heading);
    cursor: pointer;
    font-family: var(--proflight-font);
}

.proflight-chatbot-suggestions-chevron {
    transition: transform 0.2s ease;
    font-size: 12px;
    color: var(--proflight-primary);
}

.proflight-chatbot-suggestions.collapsed .proflight-chatbot-suggestions-chevron {
    transform: rotate(-90deg);
}

.proflight-chatbot-suggestions-body {
    max-height: 200px;
    overflow-y: auto;
    padding-top: 4px;
}

.proflight-chatbot-suggestions.collapsed .proflight-chatbot-suggestions-body {
    display: none;
}

.proflight-chatbot-suggestions-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--proflight-heading);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Intro line shown above the topic buttons */
.proflight-chatbot-suggestions-hint {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
    font-size: 12px;
    line-height: 1.35;
    color: #55606b;
}

.proflight-chatbot-back-btn {
    background: none;
    border: none;
    color: var(--proflight-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font-family: var(--proflight-font);
    text-decoration: none;
}

.proflight-chatbot-back-btn:hover {
    color: var(--proflight-heading);
    text-decoration: underline;
}

.proflight-chatbot-suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.proflight-chatbot-topic-btn,
.proflight-chatbot-submenu-btn {
    display: inline-block;
    box-sizing: border-box;
    padding: 6px 11px;
    border: 1px solid #d0d7de;
    background: #ffffff;
    color: var(--proflight-heading);
    border-radius: 16px;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    font-family: var(--proflight-font);
    text-align: left;
}

.proflight-chatbot-topic-btn:hover,
.proflight-chatbot-submenu-btn:hover {
    background: var(--proflight-secondary);
    border-color: var(--proflight-secondary);
    color: var(--proflight-heading);
    text-decoration: none;
}

.proflight-chatbot-submenu-btn {
    display: inline-block;
    border-radius: 16px;
}

.proflight-chatbot-topic-btn:active,
.proflight-chatbot-submenu-btn:active {
    transform: scale(0.98);
}

/* Responsive */
@media (max-width: 600px) {
    .proflight-chatbot-container {
        max-width: calc(100vw - 40px);
        width: calc(100vw - 40px);
        height: 78vh;
        margin: 0;
    }

    .proflight-chatbot-message-content {
        max-width: 90%;
    }

    /* Choice buttons read better stacked on narrow screens. */
    .proflight-chatbot-options-actions {
        flex-direction: column;
    }

    .proflight-chatbot-option-btn {
        width: 100%;
    }
}

/* Respect the visitor's motion preferences */
@media (prefers-reduced-motion: reduce) {
    .proflight-chatbot-bubble::before,
    .proflight-chatbot-bubble::after {
        animation: none;
    }

    .proflight-chatbot-bubble:hover {
        transform: none;
    }
}

/* Messages scrollbar styling */
.proflight-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.proflight-chatbot-messages::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.proflight-chatbot-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.proflight-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}
