:root {
    --primary-color: #0b1e3a;
    --header-text-color: #ffffff;
    --container-bg: #f5f9ff;
    --user-bg: var(--primary-color);
    --user-text: #ffffff;
    --bot-bg: #eef3ff;
    --bot-text: #111111;
    --system-bg: #fff3cd;
    --input-border: #c9d8f0;

    /* Toggle button defaults */
    --toggle-bg: var(--primary-color);
    --toggle-text: #ffffff;
    --toggle-hover: #123a70;
    --toggle-icon: #ffffff;
}


.ai-identity-error {
    min-height: 18px;
    color: #d32f2f;
    font-size: 13px;
    margin-bottom: 8px;
}

.ai-end-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 12px;
    margin-left: 6px;
    border-radius: 6px;
    cursor: pointer;
}

.ai-end-btn:hover {
    background: #c0392b;
}

#ai-chat-container {
    position: fixed;
    bottom: 90px;
    right: 20px;

    width: 340px;
    height: 500px;

    background: var(--container-bg);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    font-family: Arial, sans-serif;
    overflow: hidden;

    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
}

#ai-chat-container.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}


#ai-chat-header {
    background: var(--primary-color);
    color: var(--header-text-color);
    padding: 15px;
    border-radius: 12px 12px 0 0;
}

#ai-contact-box {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

#ai-contact-box input {
    width: 100%;
    margin-bottom: 6px;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--input-border);
    background: var(--container-bg);
    color: #111;
}


#ai-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    font-size: 14px;
}

/* Message base */
.ai-message {
    margin-bottom: 10px;
    padding: 10px 14px;
    border-radius: 16px;
    max-width: 75%;
    word-wrap: break-word;
    border: none;
}

/* USER */
.ai-user {
    background: var(--user-bg);
    color: var(--user-text);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* AI (left side) */
/* AI */
.ai-bot {
    background: var(--bot-bg);
    color: var(--bot-text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

/* SYSTEM */
.ai-system {
    background: var(--system-bg);
    color: #333;
    align-self: center;
    font-size: 13px;
}

/* Center screens */
.ai-center-screen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Card style */
.ai-card {
    background: var(--bot-bg);
    padding: 20px;
    border-radius: 14px;
    width: 90%;
    text-align: center;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.ai-card-title {
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--bot-text);
}

/* Modern input */
.ai-input {
    width: 100%;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--input-border);
    background: white;
    font-size: 14px;
}

/* Primary button */
.ai-primary-btn {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: none;
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.ai-primary-btn:hover {
    opacity: 0.9;
}



#ai-chat-input-container {
    display: flex;
    padding: 10px;
    border-top: 1px solid #ddd;
}

#ai-chat-input {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--input-border);
    background: var(--container-bg);
    color: #111;
}


#ai-chat-send {
    margin-left: 8px;
    padding: 10px 14px;
    border-radius: 6px;
    border: none;
    background: var(--primary-color);
    color: var(--header-text-color);
    cursor: pointer;
}

#ai-chat-send:hover {
    opacity: 0.9;
}

#ai-chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;

    display: flex;
    align-items: center;
    gap: 8px;

    padding: 12px 18px;
    border-radius: 30px;

    background: var(--toggle-bg);
    color: var(--toggle-text);

    border: none;
    font-size: 14px;
    font-weight: 600;

    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    transition: all 0.2s ease;
}

#ai-chat-toggle:hover {
    background: var(--toggle-hover);
    transform: translateY(-2px);
}

#ai-chat-toggle svg {
    width: 18px;
    height: 18px;
    fill: var(--toggle-icon);
    flex: 0 0 auto;
}


#ai-chat-toggle:hover {
    background: var(--toggle-hover, var(--primary-color));
    transform: translateY(-2px);
}

#ai-chat-toggle .ai-chat-icon {
    font-size: 18px;
}


#ai-chat-toggle:hover {
    transform: scale(1.05);
}

#ai-chat-toggle img.ai-chat-custom-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* === Align SEND + END buttons === */

#ai-chat-send,
#ai-end-session {
    height: 38px;
    padding: 0 14px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#ai-chat-send {
    border-radius: 6px;
}

#ai-end-session {
    border-radius: 6px;
}