﻿/* ==========================================================
   Najdi24 AI CHAT - PART 1
========================================================== */

:root {
    --ai-primary: #ff6b00;
    --ai-secondary: #ff9d00;
    --ai-bg: #0b1220;
    --ai-surface: #111827;
    --ai-card: #17233a;
    --ai-text: #ffffff;
    --ai-muted: #94a3b8;
    --ai-border: rgba(255,255,255,.08);
    --ai-gradient: linear-gradient(135deg,#ff6b00,#ff9d00);
    --ai-shadow: 0 25px 70px rgba(0,0,0,.45);
}

* {
    box-sizing: border-box;
}

/* ======================================
BUTTON
====================================== */

.ai-chat-button {
    position: fixed;
    right: 28px;
    bottom: 28px;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--ai-gradient);
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 20px 45px rgba(255,107,0,.35);
    transition: .3s;
    z-index: 999999;
}

    .ai-chat-button:hover {
        transform: translateY(-5px) scale(1.05);
        box-shadow: 0 30px 60px rgba(255,107,0,.45);
    }

/* ======================================
WINDOW
====================================== */

.ai-chat {
    position: fixed;
    right: 28px;
    bottom: 110px;
    width: 430px;
    height: 720px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 28px;
    background: var(--ai-bg);
    border: 1px solid var(--ai-border);
    box-shadow: var(--ai-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(.96);
    transition: .35s;
    z-index: 999998;
}

    .ai-chat.open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
    }

/* ======================================
HEADER
====================================== */

.ai-header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px;
    background: var(--ai-card);
    border-bottom: 1px solid var(--ai-border);
    overflow: hidden;
}

    .ai-header::before {
        content: "";
        position: absolute;
        width: 220px;
        height: 220px;
        right: -120px;
        top: -120px;
        background: #ff6b00;
        filter: blur(120px);
        opacity: .15;
    }

.ai-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 2;
}

.ai-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--ai-gradient);
    color: #fff;
    font-weight: 700;
    font-size: 18px;
}

.ai-title {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}

.ai-subtitle {
    color: var(--ai-muted);
    font-size: 13px;
    margin-top: 3px;
}

.ai-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 2;
}

.ai-status {
    color: #22c55e;
    font-size: 14px;
    font-weight: 600;
}

.ai-close {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    color: #fff;
    cursor: pointer;
    transition: .3s;
}

    .ai-close:hover {
        background: #ff6b00;
    }

/* ======================================
BODY
====================================== */

.ai-body {
    flex: 1;
    overflow-y: auto;
    background: var(--ai-surface);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

    .ai-body::-webkit-scrollbar {
        width: 7px;
    }

    .ai-body::-webkit-scrollbar-thumb {
        background: #334155;
        border-radius: 20px;
    }
/* ======================================
WELCOME
====================================== */

.ai-welcome {
    text-align: center;
}

.welcome-icon {
    width: 90px;
    height: 90px;
    margin: 0 auto 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ai-gradient);
    font-size: 42px;
    color: #fff;
    box-shadow: 0 20px 45px rgba(255,107,0,.30);
}

.ai-welcome h3 {
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
}

.ai-welcome p {
    color: var(--ai-muted);
    line-height: 1.8;
    margin-bottom: 30px;
}

/* ======================================
SUGGESTIONS
====================================== */

.ai-suggestions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 35px;
}

.ai-chip {
    border: none;
    background: #17233a;
    color: #fff;
    padding: 12px 18px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
    transition: .3s;
    border: 1px solid rgba(255,255,255,.06);
}

    .ai-chip:hover {
        background: var(--ai-gradient);
        transform: translateY(-2px);
    }

/* ======================================
INFO CARD
====================================== */

.ai-card {
    background: #17233a;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 20px;
    padding: 24px;
    text-align: left;
}

    .ai-card strong {
        display: block;
        color: #fff;
        margin-bottom: 12px;
        font-size: 18px;
    }

    .ai-card p {
        color: var(--ai-muted);
        line-height: 1.8;
        margin-bottom: 22px;
    }

.ai-card-button {
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
    padding: 15px;
    border-radius: 14px;
    background: var(--ai-gradient);
    color: #fff;
    font-weight: 700;
    transition: .3s;
}

    .ai-card-button:hover {
        color: #fff;
        transform: translateY(-2px);
    }

/* ======================================
ADMIN / WORKER
====================================== */

.ai-card.admin {
    text-align: center;
    color: #ef4444;
    font-weight: 700;
    font-size: 20px;
}

.ai-card.worker {
    text-align: center;
    color: #22c55e;
    font-weight: 700;
    font-size: 20px;
}

/* ======================================
MESSAGES
====================================== */

.ai-message {
    display: flex;
    margin-bottom: 18px;
    animation: fadeMessage .25s ease;
}

    .ai-message.user {
        justify-content: flex-end;
    }

    .ai-message.assistant {
        justify-content: flex-start;
    }

.ai-bubble {
    max-width: 82%;
    padding: 16px 18px;
    border-radius: 20px;
    line-height: 1.7;
    font-size: 15px;
    white-space: pre-wrap;
    word-break: break-word;
}

.ai-message.user .ai-bubble {
    background: var(--ai-gradient);
    color: #fff;
    border-bottom-right-radius: 6px;
}

.ai-message.assistant .ai-bubble {
    background: #17233a;
    color: #fff;
    border: 1px solid rgba(255,255,255,.06);
    border-bottom-left-radius: 6px;
}
/* ======================================
FOOTER
====================================== */

.ai-footer {
    padding: 18px;
    background: #17233a;
    border-top: 1px solid rgba(255,255,255,.08);
}

.ai-input {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

    .ai-input textarea {
        flex: 1;
        resize: none;
        min-height: 54px;
        max-height: 140px;
        padding: 14px 18px;
        border-radius: 18px;
        border: 1px solid rgba(255,255,255,.08);
        background: #0b1220;
        color: #fff;
        font-family: inherit;
        font-size: 15px;
        line-height: 1.6;
        outline: none;
        transition: .25s;
    }

        .ai-input textarea:focus {
            border-color: #ff6b00;
            box-shadow: 0 0 0 4px rgba(255,107,0,.12);
        }

        .ai-input textarea::placeholder {
            color: #94a3b8;
        }

.ai-send {
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 18px;
    background: var(--ai-gradient);
    color: #fff;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    flex-shrink: 0;
    transition: .3s;
}

    .ai-send:hover {
        transform: translateY(-3px);
        box-shadow: 0 18px 40px rgba(255,107,0,.35);
    }

    .ai-send:active {
        transform: scale(.96);
    }

/* ======================================
TYPING
====================================== */

.ai-typing {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    animation: typing 1.2s infinite;
}

    .ai-dot:nth-child(2) {
        animation-delay: .2s;
    }

    .ai-dot:nth-child(3) {
        animation-delay: .4s;
    }

@keyframes typing {

    0% {
        opacity: .3;
        transform: translateY(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-4px);
    }

    100% {
        opacity: .3;
        transform: translateY(0);
    }
}

/* ======================================
ANIMATIONS
====================================== */

@keyframes fadeMessage {

    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-chat {
    animation: fadeMessage .25s ease;
}

/* ======================================
RESPONSIVE
====================================== */

@media (max-width:768px) {

    .ai-chat {
        width: 100%;
        height: 100%;
        right: 0;
        bottom: 0;
        border-radius: 0;
    }

    .ai-chat-button {
        right: 18px;
        bottom: 18px;
        width: 62px;
        height: 62px;
    }

    .ai-header {
        padding: 18px;
    }

    .ai-body {
        padding: 18px;
    }

    .ai-footer {
        padding: 16px;
    }

    .ai-title {
        font-size: 17px;
    }

    .ai-subtitle {
        font-size: 12px;
    }

    .ai-bubble {
        max-width: 92%;
    }
}

/* ======================================
SMALL MOBILE
====================================== */

@media (max-width:480px) {

    .welcome-icon {
        width: 72px;
        height: 72px;
        font-size: 34px;
    }

    .ai-welcome h3 {
        font-size: 22px;
    }

    .ai-chip {
        width: 100%;
    }

    .ai-card {
        padding: 18px;
    }
}