﻿/* =========================================
   ADA AI ASSISTANT
   FINAL COMPLETE CSS
========================================= */


/* =========================================
   RESET
========================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}


/* =========================================
   AI TOGGLE BUTTON
========================================= */

.ai-toggle-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 99999;
    background: linear-gradient(135deg,#0d6efd,#0b5ed7);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 14px 22px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 10px 30px rgba(13,110,253,.35);
    transition: .25s ease;
}

    .ai-toggle-btn:hover {
        transform: translateY(-2px);
    }

    .ai-toggle-btn:focus {
        outline: 3px solid #000;
        outline-offset: 3px;
    }


/* =========================================
   AI PANEL
========================================= */

.ai-chat-panel {
    position: fixed;
    right: 20px;
    bottom: 90px;
    width: 390px;
    height: 650px;
    max-width: calc(100vw - 40px);
    background: #fff;
    border-radius: 22px;
    border: 1px solid #dce6f4;
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
    overflow: hidden;
    z-index: 999999;
    display: none;
    flex-direction: column;
}

    .ai-chat-panel.open {
        display: flex;
    }


/* =========================================
   HEADER
========================================= */

.ai-chat-header {
    background: linear-gradient(135deg,#0d6efd,#0b5ed7);
    color: #fff;
    padding: 18px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-shrink: 0;
}

    .ai-chat-header h2 {
        margin: 0;
        font-size: 22px;
        font-weight: 700;
        line-height: 1.2;
    }

.ai-subtitle {
    margin-top: 6px;
    font-size: 13px;
    opacity: .92;
    line-height: 1.5;
}

.ai-chat-header button {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 12px;
    background: rgba(255,255,255,.15);
    color: #fff;
    cursor: pointer;
    font-size: 20px;
    flex-shrink: 0;
}

    .ai-chat-header button:focus {
        outline: 3px solid #fff;
    }


/* =========================================
   STATUS
========================================= */

.ai-status {
    padding: 10px 16px;
    background: #eef5ff;
    border-bottom: 1px solid #dce6f4;
    color: #0d6efd;
    font-size: 13px;
    flex-shrink: 0;
}


/* =========================================
   CHAT BODY
========================================= */

.ai-chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px;
    background: #f7faff;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
}


/* =========================================
   MESSAGE
========================================= */

.ai-message {
    padding: 14px 16px;
    border-radius: 18px;
    line-height: 1.6;
    font-size: 15px;
    max-width: 85%;
    word-break: break-word;
}

.ai-message-user {
    background: linear-gradient(135deg,#0d6efd,#0b5ed7);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 6px;
}

.ai-message-bot {
    background: #fff;
    color: #222;
    border: 1px solid #dce6f4;
    align-self: flex-start;
    border-bottom-left-radius: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,.04);
}


/* =========================================
   FORM
========================================= */

.ai-chat-form {
    flex-shrink: 0;
    padding: 18px;
    border-top: 1px solid #dce6f4;
    background: #fff;
}


/* =========================================
   TEXTAREA
========================================= */

#aiInput {
    width: 100%;
    min-height: 90px;
    max-height: 140px;
    resize: none;
    border: 1px solid #cfd7e6;
    border-radius: 14px;
    padding: 14px;
    font-size: 15px;
    line-height: 1.5;
    font-family: inherit;
    background: #fff;
    color: #222;
}

    #aiInput:focus {
        outline: 3px solid #0d6efd;
        border-color: #0d6efd;
    }

    #aiInput::placeholder {
        color: #7a8799;
    }


/* =========================================
   LANGUAGE
========================================= */

.ai-language-select {
    width: 100%;
    margin-top: 12px;
    border: 1px solid #cfd7e6;
    border-radius: 14px;
    padding: 13px 14px;
    font-size: 15px;
    background: #fff;
    color: #222;
}

    .ai-language-select:focus {
        outline: 3px solid #0d6efd;
        border-color: #0d6efd;
    }


/* =========================================
   HELP
========================================= */

.ai-help-text {
    margin-top: 10px;
    font-size: 13px;
    color: #667085;
    line-height: 1.5;
}


/* =========================================
   BUTTONS
========================================= */

.ai-chat-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

    .ai-chat-actions button {
        flex: 1;
        border: none;
        border-radius: 14px;
        min-height: 48px;
        padding: 13px 14px;
        background: linear-gradient(135deg,#0d6efd,#0b5ed7);
        color: #fff;
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
    }

        .ai-chat-actions button:focus {
            outline: 3px solid #000;
            outline-offset: 3px;
        }


/* =========================================
   SR ONLY
========================================= */

.sr-only {
    position: relative;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}


/* =========================================
   MOBILE
========================================= */

@media screen and (max-width:768px) {

    html,
    body {
        width: 100%;
        height: 100%;
        overflow-x: hidden;
    }

        body.ai-open {
            overflow: hidden;
        }

    /* PANEL */

    .ai-chat-panel {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        border-radius: 0 !important;
        margin: 0 !important;
        border: none !important;
    }

    /* HEADER */

    .ai-chat-header {
        padding: 14px;
    }

        .ai-chat-header h2 {
            font-size: 20px;
        }

    .ai-subtitle {
        font-size: 12px;
    }

    /* STATUS */

    .ai-status {
        padding: 10px 14px;
    }

    /* CHAT */

    .ai-chat-messages {
        padding: 12px;
        gap: 12px;
    }

    .ai-message {
        font-size: 14px;
        max-width: 92%;
        padding: 12px 14px;
    }

    /* FORM */

    .ai-chat-form {
        padding: 12px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }

    /* INPUT */

    #aiInput {
        min-height: 70px;
        max-height: 100px;
        font-size: 16px;
        padding: 12px;
    }

    .ai-language-select {
        font-size: 16px;
    }

    /* BUTTONS */

    .ai-chat-actions {
        flex-direction: column;
    }

        .ai-chat-actions button {
            width: 100%;
        }

    /* TOGGLE BUTTON */

    .ai-toggle-btn {
        right: 12px;
        bottom: 12px;
        padding: 12px 18px;
        font-size: 14px;
    }

    body.ai-open .ai-toggle-btn {
        display: none;
    }
}
