﻿/* Chat Container */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-message {
    display: flex;
    gap: 12px;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.bot {
    flex-direction: row;
}

.chat-message.user {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0078d4;
}

    .chat-avatar img {
        width: 20px;
        height: 20px;
        object-fit: contain;
    }

.chat-message.user .chat-avatar {
    background: #8661c5;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.chat-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.chat-message.bot .chat-bubble {
    background: #f3f2f1;
    color: #323130;
    border-top-left-radius: 2px;
}

.chat-message.user .chat-bubble {
    background: #0078d4;
    color: white;
    border-top-right-radius: 2px;
}

/* Choice Buttons */
.chat-choices {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.choice-btn {
    background: white;
    border: 1px solid #0078d4;
    color: #0078d4;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    transition: all 0.2s;
}

    .choice-btn:hover {
        background: #0078d4;
        color: white;
        transform: translateX(4px);
    }

    .choice-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

/* Calendar Picker */
.calendar-picker {
    background: white;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    padding: 12px;
    margin-top: 8px;
}

    .calendar-picker input[type="datetime-local"] {
        width: 100%;
        padding: 10px;
        border: 1px solid #d1d1d1;
        border-radius: 4px;
        font-size: 14px;
        font-family: inherit;
    }

    .calendar-picker button {
        margin-top: 8px;
        width: 100%;
        padding: 10px;
        background: #0078d4;
        color: white;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-size: 14px;
        font-weight: 500;
        transition: background 0.2s;
    }

        .calendar-picker button:hover {
            background: #005a9e;
        }

/* Chat Input Area */
.chat-input-area {
    padding: 16px 24px;
    border-top: 1px solid #e1e1e1;
    display: flex;
    gap: 8px;
    background: white;
}

.chat-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d1d1d1;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

    .chat-input:focus {
        outline: none;
        border-color: #0078d4;
    }

    .chat-input:disabled {
        background: #f3f2f1;
        color: #a19f9d;
        cursor: not-allowed;
    }

.chat-send-btn {
    width: 40px;
    height: 40px;
    background: #0078d4;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

    .chat-send-btn:hover:not(:disabled) {
        background: #005a9e;
    }

    .chat-send-btn:disabled {
        background: #d1d1d1;
        cursor: not-allowed;
    }

/* Loading Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #a19f9d;
    animation: typingBounce 1.4s infinite ease-in-out;
}

    .typing-dot:nth-child(1) {
        animation-delay: -0.32s;
    }

    .typing-dot:nth-child(2) {
        animation-delay: -0.16s;
    }

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Dark Theme Support */
[data-theme="dark"] .form-modal-content {
    background: #2d2d2d;
}

[data-theme="dark"] .form-modal-header {
    border-bottom-color: #3a3a3a;
}

    [data-theme="dark"] .form-modal-header h2 {
        color: #ffffff;
    }

[data-theme="dark"] .form-close-btn {
    color: #c8c6c4;
}

    [data-theme="dark"] .form-close-btn:hover {
        background: #3a3a3a;
        color: #ffffff;
    }

[data-theme="dark"] .chat-message.bot .chat-bubble {
    background: #3a3a3a;
    color: #ffffff;
}

[data-theme="dark"] .chat-input-area {
    border-top-color: #3a3a3a;
    background: #2d2d2d;
}

[data-theme="dark"] .chat-input {
    background: #3a3a3a;
    border-color: #4a4a4a;
    color: #ffffff;
}

    [data-theme="dark"] .chat-input:disabled {
        background: #1a1a1a;
        color: #8a8886;
    }

[data-theme="dark"] .choice-btn {
    background: #2d2d2d;
    border-color: #0078d4;
}

    [data-theme="dark"] .choice-btn:hover {
        background: #0078d4;
    }

[data-theme="dark"] .calendar-picker {
    background: #3a3a3a;
    border-color: #4a4a4a;
}

    [data-theme="dark"] .calendar-picker input {
        background: #2d2d2d;
        border-color: #4a4a4a;
        color: #ffffff;
    }

/* Responsive */
@media (max-width: 768px) {
    .form-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .chat-bubble {
        max-width: 80%;
    }
}
