/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #2b2b2b;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Main container */
.chat-container {
    width: 100%;
    max-width: 800px;
    height: 90vh;
    background-color: #363636;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    margin: 20px;
}

/* Header styles */
.chat-header {
    background-color: #7b2cbf;
    color: white;
    padding: 20px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h1 {
    font-size: 1.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.chat-controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    padding: 8px 16px;
    background-color: #4a4a4a;
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    font-size: 0.9rem;
}

.control-btn:hover {
    background-color: #5a5a5a;
    transform: scale(1.05);
}

.control-btn:active {
    transform: scale(0.95);
}

/* Messages container */
.messages-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Individual message styles */
.message {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 15px;
    margin: 5px 0;
    word-wrap: break-word;
}

.user-message {
    background-color: #9d4edd;
    color: white;
    align-self: flex-end;
    border-radius: 15px 15px 0 15px;
    white-space: pre-wrap;
}

.bot-message {
    background-color: #4a4a4a;
    color: white;
    align-self: flex-start;
    border-radius: 15px 15px 15px 0;
    white-space: pre-wrap;
    line-height: 1.5;
}

/* Message formatting */
.bot-message ul {
    margin: 8px 0;
    padding-left: 20px;
    list-style-type: disc;
}

.bot-message li {
    margin: 4px 0;
    color: white;
}

.bot-message strong {
    color: #c77dff;
    font-weight: 600;
}

.bot-message em {
    color: #cccccc;
    font-style: italic;
}

/* Input form */
.input-form {
    display: flex;
    padding: 20px;
    gap: 10px;
    background-color: #2b2b2b;
    border-radius: 0 0 10px 10px;
}

.input-form input {
    flex-grow: 1;
    padding: 12px;
    border: none;
    border-radius: 20px;
    background-color: #4a4a4a;
    color: white;
    outline: none;
}

.input-form input::placeholder {
    color: #aaa;
}

.input-form button {
    padding: 12px 24px;
    background-color: #7b2cbf;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
}

.input-form button:hover {
    background-color: #9d4edd;
    transform: scale(1.05);
}

.input-form button:active {
    transform: scale(0.95);
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 10px 15px;
    background-color: #4a4a4a;
    border-radius: 15px;
    width: fit-content;
    margin: 10px 0;
    align-self: flex-start;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: #fff;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

.hidden {
    display: none !important;
}

/* Scrollbar styling */
.messages-container::-webkit-scrollbar {
    width: 8px;
}

.messages-container::-webkit-scrollbar-track {
    background: #2b2b2b;
}

.messages-container::-webkit-scrollbar-thumb {
    background: #7b2cbf;
    border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: #9d4edd;
}

/* Responsive styles */
@media (max-width: 600px) {
    .chat-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .chat-controls {
        justify-content: space-between;
    }
    
    .control-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}