/* Custom styles to complement Bootstrap */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: transparent;
 
}

.chat-container {
    width: 100%;
    height: 100%;
    transition: all 0.3s ease;
}

.chat-container.hidden {
    display: none;
}

.chat-window {
    position: fixed;
   
    width: 20%;
    height: 50%;
    margin: 2rem auto;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    overflow: hidden;
    bottom: 2px;
    right: 2px;
        /* Add flex layout */
        display: flex;
        flex-direction: column;
}

.chat-container.enlarged .chat-window {
    height: 90%;
    width: 95%;

}

.chat-header {
    border-radius: 0.5rem 0.5rem 0 0;
    flex-shrink: 0;
}

.chat-history {
    padding: 1rem;
    flex-grow: 1;
    overflow-y: auto; 
    background-color: #f8f9fa;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Message styling */
.message {
    max-width: 75%;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease;
}
/* Add this for the input area */
.chat-input-area {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-top: 1px solid #dee2e6;
    background-color: #fff;
    flex-shrink: 0; /* Prevent shrinking */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-user {
    align-self: flex-end;
}

.message-agent {
    align-self: flex-start;
}

.message-user .message-bubble {
    background-color: #007bff;
    color: white;
    border-radius: 1rem 1rem 0.25rem 1rem;
}

.message-agent .message-bubble {
    background-color: #e9ecef;
    color: #212529;
    border-radius: 1rem 1rem 1rem 0.25rem;
}

.message-bubble {
    padding: 0.75rem 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-sender {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.message-time {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.timestamp {
    font-size: 0.75rem;
    color: #6c757d;
    text-align: center;
    margin: 1rem 0;
    font-style: italic;
}

/* Chat input styling */
.chat-input {
    background-color: #fff;
    border-radius: 0 0 0.5rem 0.5rem;
    box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05);
}

.chat-input .form-control {
    border-radius: 1.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid #ced4da;
}

.chat-input .form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.chat-input .btn {
    border-radius: 1.5rem;
    padding: 0.5rem 1.25rem;
}

/* Toggle buttons */
.chat-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transition: all 0.3s ease;

}

.chat-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.chat-size-btn,
.chat-close-btn {
    border: none;
    background: transparent;
    color: #fff;
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    transition: all 0.2s ease;
}

.chat-size-btn:hover,
.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-close-btn {
    background: rgba(255, 255, 255, 0.1);
}

.chat-header .btn-light {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
}

.chat-header .btn-light:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Scrollbar styling */
.chat-history::-webkit-scrollbar {
    width: 6px;
}

.chat-history::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-history::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.chat-history::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .chat-window {
        width: 95%;
        height: 85vh;
        margin: 0.5rem auto;
    }
    
    .chat-container.enlarged .chat-window {
        height: 95vh;
        width: 100%;
        border-radius: 0;
    }
    
    .message {
        max-width: 85%;
    }
}