/* css/components/ai-panel.css */

.ai-panel {
    position: fixed;
    top: 50px;
    bottom: 50px;
    left: var(--sp-4);
    right: auto;

    width: 380px;
    max-width: calc(100vw - 32px);

    background: linear-gradient(180deg, #FCFBE0 0%, #EDEE9E 55%, #E3E166 100%);
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;

    display: flex;
    flex-direction: column;

    z-index: 1000;
    transform-origin: bottom left;
    transform: scale(0.85) translateY(16px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
                opacity 0.25s ease,
                visibility 0s linear 0.35s;
}

.ai-panel.is-open {
    transform: scale(1) translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
                opacity 0.25s ease;
}

.ai-panel.is-fullscreen {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
}

[dir="rtl"] .ai-panel {
    left: auto;
    right: var(--sp-4);
    transform-origin: bottom right;
}

[dir="rtl"] .ai-panel.is-fullscreen {
    right: 0;
    left: 0;
}

.chatbot-float-btn.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.7);
}

.ai-panel__header {
    display: flex;
    justify-content: flex-end;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-3) 0;
    flex-shrink: 0;
}

.ai-panel__icon-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #000;
    transition: background var(--transition-fast);
}

.ai-panel__icon-btn:hover {
    background: rgba(255, 255, 255, 0.85);
}

.ai-panel__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: var(--sp-2) var(--sp-4) var(--sp-4);
}

.ai-panel__greeting {
    font-family: var(--font-body, inherit);
    font-size: 1.4rem;
    font-weight: 700;
    color: #111;
    line-height: 1.2;
    margin-bottom: var(--sp-4);
}

.ai-panel__hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    margin-bottom: var(--sp-5);
}

.ai-panel__robot {
    width: 120px;
    height: 120px;
    object-fit: contain;
    flex-shrink: 0;
}

.ai-panel__cta-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.ai-cta {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.ai-cta__icon {
    flex-shrink: 0;
}

.ai-cta--chat {
    background: #111;
    color: #fff;
}

.ai-cta--call {
    background: var(--clr-saffron);
    color: #111;
}

.ai-panel__history-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sp-2);
}

.ai-panel__history-head h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #111;
}

.ai-panel__history-head a {
    font-size: 0.8rem;
    color: #333;
    text-decoration: none;
}

.ai-history-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 16px;
    padding: 10px 12px;
}

.ai-history-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ai-history-icon--dark {
    background-color: #111;
}

.ai-history-icon--call {
    background-color: var(--clr-saffron);
    color: #111;
}
.ai-history-icon--message {
    background-color: #111;
    color: #fff;
}

.ai-history-icon-mask {
    width: 16px;
    height: 16px;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    background-color: currentColor;
}

.ai-history-icon--file {
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: #111;
}

.ai-history-text {
    flex: 1;
    font-size: 0.78rem;
    color: #222;
}
.ai-history-menu {
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
    font-size: 1rem;
}

@media (max-width: 480px) {
    .ai-panel {
        top: 50px;
        bottom: 50px;
        left: var(--sp-2);
        width: calc(100vw - 24px);
    }

    [dir="rtl"] .ai-panel {
        right: var(--sp-2);
    }
}

/* ============================================================
   Icones fichiers (masks) - AIHome + AIChat
   ============================================================ */

.ai-cta__icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    background-color: currentColor;
}

.icon-chat {
    -webkit-mask-image: url('../../images/icons/eng_chat.png');
    mask-image: url('../../images/icons/eng_chat.png');
}

.icon-call {
    -webkit-mask-image: url('../../images/icons/eng_call.png');
    mask-image: url('../../images/icons/eng_call.png');
}

[dir="rtl"] .icon-chat {
    -webkit-mask-image: url('../../images/icons/Ara_chat.png');
    mask-image: url('../../images/icons/Ara_chat.png');
}

[dir="rtl"] .icon-call {
    -webkit-mask-image: url('../../images/icons/Ara_call.png');
    mask-image: url('../../images/icons/Ara_call.png');
}

/* ---- Composer (AIChat) ---- */

.ai-chat__tool-icon,
.ai-chat__mic-icon,
.ai-chat__send-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    background-color: currentColor;
}

.icon-attach {
    -webkit-mask-image: url('../../images/icons/eng_fils.png');
    mask-image: url('../../images/icons/eng_fils.png');
}

.icon-mic {
    -webkit-mask-image: url('../../images/icons/eng_mic.png');
    mask-image: url('../../images/icons/eng_mic.png');
}

.icon-send {
    -webkit-mask-image: url('../../images/icons/send-eng.png');
    mask-image: url('../../images/icons/send_arabe.png');
}

[dir="rtl"] .icon-attach {
    -webkit-mask-image: url('../../images/icons/Ara_fils.png');
    mask-image: url('../../images/icons/Ara_fils.png');
}

[dir="rtl"] .icon-mic {
    -webkit-mask-image: url('../../images/icons/ara_mic.png');
    mask-image: url('../../images/icons/ara_mic.png');
}

[dir="rtl"] .icon-send {
    -webkit-mask-image: url('../../images/icons/send_arabe.png');
    mask-image: url('../../images/icons/send-eng.png');
}

.icon-camera {
    -webkit-mask-image: url('../../images/icons/eng_cam.png');
    mask-image: url('../../images/icons/eng_cam.png');
}

[dir="rtl"] .icon-camera {
    -webkit-mask-image: url('../../images/icons/ara_cam.png');
    mask-image: url('../../images/icons/ara_cam.png');
}


.ai-history-menu-wrapper {
    position: relative;
    flex-shrink: 0;
}

.ai-history-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    min-width: 130px;
    padding: 4px;
    display: none;
    flex-direction: column;
    z-index: 10;
}

.ai-history-dropdown.is-open {
    display: flex;
}

[dir="rtl"] .ai-history-dropdown {
    right: auto;
    left: 0;
}

.ai-history-dropdown__item {
    background: none;
    border: none;
    text-align: left;
    padding: 8px 10px;
    font-size: 0.78rem;
    color: #222;
    cursor: pointer;
    border-radius: 6px;
}

[dir="rtl"] .ai-history-dropdown__item {
    text-align: right;
}

.ai-history-dropdown__item:hover {
    background: rgba(0, 0, 0, 0.06);
}

.ai-history-dropdown__item--danger {
    color: #c0392b;
}
EOF
Output

.ai-history-menu-wrapper {
    position: relative;
    flex-shrink: 0;
}

.ai-history-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    min-width: 130px;
    padding: 4px;
    display: none;
    flex-direction: column;
    z-index: 10;
}

.ai-history-dropdown.is-open {
    display: flex;
}

[dir="rtl"] .ai-history-dropdown {
    right: auto;
    left: 0;
}

.ai-history-dropdown__item {
    background: none;
    border: none;
    text-align: left;
    padding: 8px 10px;
    font-size: 0.78rem;
    color: #222;
    cursor: pointer;
    border-radius: 6px;
}

[dir="rtl"] .ai-history-dropdown__item {
    text-align: right;
}

.ai-history-dropdown__item:hover {
    background: rgba(0, 0, 0, 0.06);
}

.ai-history-dropdown__item--danger {
    color: #c0392b;
}

.ai-panel__suggestions {
    margin-top: var(--sp-2);
}

.ai-suggestions-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-suggestion-item {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 14px;
    padding: 10px 14px;
    font-size: 0.8rem;
    color: #222;
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.ai-suggestion-item:hover {
    background: #fff;
    transform: translateX(2px);
}

[dir="rtl"] .ai-suggestion-item:hover {
    transform: translateX(-2px);
}




