﻿/* Chat button style */
#chatButton {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #007bff;
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: background-color 0.3s;
    z-index: 1000;
    f
}

#chatButton:hover {
    background-color: #0056b3;
}

/* Chat popup styling */
#chatPopup {
    display: none;
    position: fixed;
    bottom: 10px; /* Was 80px, now 116px (80 + 36px ≈ 1 inch closer to bottom) */
    right: 20px;
    width: 320px;
    max-height: 500px; /* Increased height to accommodate */
    background: white;
    border-radius: 8px;
    box-shadow: 0 0 12px rgba(0,0,0,0.2);
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
}

/* Header */
#chatHeader {
    background-color: #007bff;
    color: white;
    padding: 12px;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#chatCloseBtn {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

/* Messages area */
#chatMessages {
    flex-grow: 1;
    padding: 10px;
    overflow-y: auto;
    background: #f9f9f9;
    font-size: 14px;
}

.message {
    margin-bottom: 10px;
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 18px;
    clear: both;
}

.userMessage {
    background-color: #007bff;
    color: white;
    float: right;
}

.apiMessage {
    background-color: #e5e5ea;
    color: black;
    float: left;
}

/* Input area */
#chatInputArea {
    display: flex;
    border-top: 1px solid #ddd;
}

#chatInput {
    flex-grow: 1;
    border: none;
    padding: 10px;
    font-size: 14px;
    resize: none;
    outline: none;
    height: 80px;
}

#chatSendBtn {
}


#chatSendBtn {
    font-size: 10pt;
    height: 45px;
    border-radius: 15px 15px 15px 15px;
    /*         background-color: #007bff; */
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    border: none;
    color: white;
    padding: 0 20px;
    cursor: pointer;
    transition: background-color 0.3s;
}

    #chatSendBtn:hover {
        background-color: #0056b3;
    }

/* C21 MoxiWorks Blue Theme */
:root {
    --primary-blue: #0f2b52;
    --blue-hover: #0d233f;
    --light-blue: #1a3b5e;
    --white: #ffffff;
    --gray-light: #f8f9fa;
    --gray-border: #e9ecef;
    --shadow: rgba(15,43,82,0.12);
    --text-dark: #333333;
}

/* Custom Fonts (Oakes/Typold matching 21goldchoice) */
@font-face {
    font-family: "Oakes";
    font-weight: normal;
    src: local('Arial'), sans-serif;
    font-style: normal;
}

@font-face {
    font-family: "Typold";
    font-weight: bold;
    src: local('Arial Black'), sans-serif;
}

/* Chat Dialog Container - Matches 21goldchoice agent form */
.chat-dialog {
    max-width: 600px;
    margin: 2rem auto;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 8px 32px var(--shadow);
    border: 1px solid var(--gray-border);
    overflow: hidden;
}

/* Header - Matches aos-agent-form-header-message */
.chat-header {
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    color: var(--white);
    padding: 2rem;
    text-align: center;
}

.chat-title {
    font-family: 'Oakes', serif;
    font-size: clamp(1.0rem, 3vw, 1.3rem);
    font-weight: bold;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.5px;
}

.chat-subtitle {
    opacity: 0.95;
    margin: 0;
    font-size: 1.3rem;
}

/* Chat Messages Area */
.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 1.5rem;
    background: #fafbfc;
}

.message {
    margin-bottom: 1.5rem;
    animation: fadeIn 0.3s ease;
}

    .message.bot {
        background: var(--white);
        border-radius: 18px 18px 18px 4px;
        padding: 1rem 1.25rem;
        max-width: 85%;
        margin-left: auto;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        border-bottom: 3px solid var(--primary-blue);
    }

    .message.user {
        background: var(--primary-blue);
        color: var(--white);
        border-radius: 18px 18px 4px 18px;
        padding: 1rem 1.25rem;
        max-width: 85%;
        margin-right: auto;
    }

/* Chat Input Form - Matches mx-form-element */
.chat-input-container {
    padding: 2rem 2rem .5rem 2rem;
    background: var(--white);
    border-top: 1px solid var(--gray-border);
    width: 100%;
    height: 130px;
}

.input-group {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
}

.form-control {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--gray-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    resize: vertical;
    min-height: 60px;
    max-height: 150px;
}

    .form-control:focus {
        outline: none;
        border-color: var(--primary-blue);
        box-shadow: 0 0 0 0.25rem rgba(15,43,82,0.15);
    }

.btn-chat {
    width: 250px;
    height: 130px;
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Typold', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-height: 60px;
}

    .btn-chat:hover:not(:disabled) {
        background: var(--blue-hover);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px var(--shadow);
    }

    .btn-chat:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
    }

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .chat-dialog {
        margin: 1rem;
    }

    .chat-input-container {
        padding: 1.5rem;
    }

    .input-group {
        flex-direction: column;
    }

    .btn-chat {
        width: 100%;
    }

    #chatSendBtn {
        width: 100%;
    }
}

/* Typing indicator */
.typing-indicator {
    display: none;
    padding: 1rem 1.25rem;
    color: var(--text-dark);
    font-style: italic;
}
