﻿/* =========================================
   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 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    min-height: 52px;
    min-width: 52px;
    box-shadow: 0 8px 24px 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: 4px;
    }

/* =========================================
   AI PANEL
========================================= */

.ai-chat-panel {
    position: fixed;
    right: 20px;
    bottom: 90px;
    width: 390px;
    max-width: calc(100vw - 40px);
    height: 650px;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 99999;
    border: 1px solid #dce6f4;
}

    .ai-chat-panel.open {
        display: flex;
    }

/* =========================================
   HEADER
========================================= */

.ai-chat-header {
    background: linear-gradient(135deg,#0d6efd,#0b5ed7);
    color: white;
    padding: 18px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

    .ai-chat-header h2 {
        margin: 0;
        font-size: 20px;
        font-weight: 700;
    }

.ai-subtitle {
    margin-top: 4px;
    font-size: 13px;
    opacity: .9;
}

.ai-chat-header button {
    background: rgba(255,255,255,.12);
    border: none;
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 20px;
    transition: .2s;
}

    .ai-chat-header button:hover {
        background: rgba(255,255,255,.22);
    }

    .ai-chat-header button:focus {
        outline: 3px solid #fff;
    }

/* =========================================
   STATUS
========================================= */

.ai-status {
    background: #eef5ff;
    color: #0d6efd;
    font-size: 13px;
    padding: 10px 16px;
    border-bottom: 1px solid #dce6f4;
}

/* =========================================
   MESSAGES
========================================= */

.ai-chat-messages {
    flex: 1;
    padding: 18px;
    overflow-y: auto;
    background: #f7faff;
    scroll-behavior: smooth;
}

/* =========================================
   MESSAGE
========================================= */

.ai-message {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 18px;
    line-height: 1.7;
    font-size: 15px;
    word-wrap: break-word;
}

.ai-message-user {
    background: linear-gradient(135deg,#0d6efd,#0b5ed7);
    color: white;
    margin-left: 50px;
    border-bottom-right-radius: 6px;
}

.ai-message-bot {
    background: white;
    border: 1px solid #dce6f4;
    color: #222;
    margin-right: 50px;
    border-bottom-left-radius: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,.04);
}

/* =========================================
   LINKS
========================================= */

.ai-message a {
    color: #0d6efd;
    font-weight: 600;
    text-decoration: underline;
}

.ai-message-user a {
    color: #fff;
}

/* =========================================
   FORM
========================================= */

.ai-chat-form {
    padding: 18px;
    border-top: 1px solid #dce6f4;
    background: white;
}

/* =========================================
   TEXTAREA
========================================= */

#aiInput {
    width: 100%;
    resize: none;
    border: 1px solid #cfd7e6;
    border-radius: 14px;
    padding: 14px;
    font-size: 15px;
    line-height: 1.6;
    background: #fff;
    color: #222;
}

    #aiInput::placeholder {
        color: #7a8799;
    }

    #aiInput:focus {
        outline: 3px solid #0d6efd;
        border-color: #0d6efd;
    }


/* =========================================
   LANGUAGE SELECT
========================================= */

.ai-language-select {
    width: 100%;
    margin-top: 12px;
    border: 1px solid #cfd7e6;
    border-radius: 14px;
    padding: 13px 14px;
    font-size: 15px;
    line-height: 1.5;
    background: #fff;
    color: #222;
    cursor: pointer;
}

    .ai-language-select:focus {
        outline: 3px solid #0d6efd;
        border-color: #0d6efd;
    }

    .ai-language-select option {
        color: #222;
    }


/* =========================================
   HELP TEXT
========================================= */

.ai-help-text {
    margin-top: 10px;
    font-size: 13px;
    color: #667085;
    line-height: 1.5;
}

/* =========================================
   ACTIONS
========================================= */

.ai-chat-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

    /* =========================================
   BUTTONS
========================================= */

    .ai-chat-actions button {
        flex: 1;
        border: none;
        border-radius: 14px;
        padding: 13px 14px;
        cursor: pointer;
        background: linear-gradient(135deg,#0d6efd,#0b5ed7);
        color: white;
        font-size: 15px;
        font-weight: 600;
        min-height: 48px;
        transition: .2s ease;
    }

        .ai-chat-actions button:hover {
            transform: translateY(-1px);
        }

        .ai-chat-actions button:focus {
            outline: 3px solid #000;
            outline-offset: 3px;
        }

/* =========================================
   SCREEN READER ONLY
========================================= */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* =========================================
   MOBILE
========================================= */

@media (max-width: 768px) {

    .ai-toggle-btn {
        right: 14px;
        bottom: 14px;
        width: auto;
    }

    .ai-chat-panel {
        right: 10px;
        left: 10px;
        bottom: 80px;
        width: auto;
        height: 82vh;
        border-radius: 18px;
    }

    .ai-message-user {
        margin-left: 20px;
    }

    .ai-message-bot {
        margin-right: 20px;
    }

    .ai-chat-actions {
        flex-direction: column;
    }
}
