/*
|--------------------------------------------------------------------------
| ADM Passenger Assistant
|--------------------------------------------------------------------------
*/

.adm-assistant {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9990;
    font-family: Arial;
}

/* Floating button */

.adm-assistant-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    padding: 15px 21px;
    border: none;
    border-radius: 50px;
    background: #ffff00;
    color: #172b3a;
    font-family: Arial;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 5px 22px rgba(0, 0, 0, .18);
    transition: background .2s ease, transform .2s ease;
}

.adm-assistant-toggle:hover {
    background: #e5b300;
    transform: translateY(-2px);
}

.adm-assistant-toggle:focus-visible {
    outline: 3px solid #102d46;
    outline-offset: 3px;
}

.adm-assistant-toggle i {
    font-size: 21px;
}

.adm-assistant-toggle.is-active {
    border-radius: 50px;
}

/* Chat panel */

.adm-assistant-panel {
    position: absolute;
    right: 0;
    bottom: 76px;
    display: flex;
    flex-direction: column;
    width: 380px;
    max-width: calc(100vw - 28px);
    height: 560px;
    max-height: calc(100dvh - 120px);
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 12px 45px rgba(0, 0, 0, .19);
}

.adm-assistant-panel[hidden] {
    display: none;
}

/* Header */

.adm-assistant-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    padding: 17px;
    color: #ffffff;
    background: #102d46;
}

.adm-assistant-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 43px;
    height: 43px;
    flex-shrink: 0;
    border-radius: 13px;
    background: #ffff00;
    color: #102d46;
    font-size: 19px;
}

.adm-assistant-header-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.adm-assistant-header-info strong {
    font-size: 14px;
}

.adm-assistant-header-info span {
    font-size: 11px;
    color: #cbd5e1;
}

.adm-assistant-status {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 4px;
    border-radius: 50%;
    background: #22c55e;
}

.adm-assistant-header button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    flex-shrink: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
}

.adm-assistant-header button:hover {
    background: rgba(255, 255, 255, .12);
}

.adm-assistant-header button:focus-visible {
    outline: 2px solid #ffff00;
    outline-offset: 2px;
}

/* Messages */

.adm-assistant-messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px 15px;
    background: #f8fafc;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.adm-assistant-messages::-webkit-scrollbar {
    width: 6px;
}

.adm-assistant-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.adm-assistant-message {
    max-width: 88%;
    padding: 12px 14px;
    border-radius: 13px;
    font-size: 13px;
    line-height: 1.65;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.adm-assistant-message.assistant {
    align-self: flex-start;
    background: #ffffff;
    color: #334155;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 3px;
}

.adm-assistant-message.user {
    align-self: flex-end;
    background: #102d46;
    color: #ffffff;
    border-bottom-right-radius: 3px;
}

.adm-assistant-message.typing {
    color: #64748b;
    font-style: italic;
}

/* Suggestions */

.adm-assistant-suggestions {
    display: flex;
    flex-wrap: wrap;
    flex-shrink: 0;
    gap: 7px;
    max-height: 120px;
    overflow-y: auto;
    padding: 10px 14px;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
}

.adm-assistant-suggestions[hidden] {
    display: none;
}

.adm-assistant-suggestions button {
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #ffffff;
    color: #334155;
    font-family: Arial;
    font-size: 11px;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
}

.adm-assistant-suggestions button:hover {
    border-color: #d6b900;
    background: #fffde5;
}

.adm-assistant-suggestions button:focus-visible {
    outline: 2px solid #102d46;
    outline-offset: 2px;
}

/* Input */

.adm-assistant-form {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
    padding: 12px 14px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
}

.adm-assistant-form input {
    flex: 1;
    min-width: 0;
    height: 43px;
    padding: 0 13px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    outline: none;
    font-family: Arial;
    font-size: 13px;
    color: #334155;
}

.adm-assistant-form input:focus {
    border-color: #d6b900;
    box-shadow: 0 0 0 3px rgba(255, 255, 0, .13);
}

.adm-assistant-form button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 43px;
    height: 43px;
    flex-shrink: 0;
    border: none;
    border-radius: 9px;
    background: #102d46;
    color: #ffffff;
    cursor: pointer;
}

.adm-assistant-form button:hover {
    background: #1e4564;
}

.adm-assistant-form button:focus-visible {
    outline: 2px solid #d6b900;
    outline-offset: 3px;
}

.adm-assistant-form button:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* Footer */

.adm-assistant-footer {
    flex-shrink: 0;
    padding: 8px;
    background: #ffffff;
    color: #94a3b8;
    font-size: 10px;
    text-align: center;
}

/* Mobile */

@media (max-width: 480px) {

    .adm-assistant {
        right: 14px;
        bottom: 14px;
    }

    .adm-assistant-toggle {
        padding: 14px 17px;
    }

    .adm-assistant-panel {
        position: fixed;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        height: min(650px, 88dvh);
        max-height: 88dvh;
        border-radius: 18px 18px 0 0;
    }

}

/* Very small screens */

@media (max-width: 360px) {

    .adm-assistant {
        right: 10px;
        bottom: 10px;
    }

    .adm-assistant-panel {
        height: 90dvh;
        max-height: 90dvh;
    }

    .adm-assistant-header {
        padding: 13px;
    }

    .adm-assistant-messages {
        padding: 14px 11px;
    }

    .adm-assistant-message {
        max-width: 94%;
    }

    .adm-assistant-suggestions {
        padding: 9px 10px;
    }

    .adm-assistant-form {
        padding: 10px;
    }

}