* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #ffffff 0%, #ffffff 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.chatbot-wrapper {
    display: flex;
    gap: 20px;
    width: 100%;
    max-width: 500px;
}

.chatbot-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 600px;
    height: 90vh;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
    border-radius: 15px 15px 0 0;
    position: relative;
}

.chatbot-header h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.chatbot-header p {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.header-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f7f7f7;
}
.suggestion-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px;
}

.suggestion-btn {
    padding: 8px 12px;
    background: #e0e9f7;
    border: 1px solid #bcd4ff;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 14px;
}

.suggestion-btn:hover {
    background: #d4e6ff;
}

.suggestion-group, .related-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 8px 0;
}

.suggestion-label {
    width: 100%;
    font-size: 12px;
    color: #555;
    margin-bottom: 6px;
}

.suggestion-more {
    padding: 6px 10px;
    background: transparent;
    border: 1px dashed #ccc;
    border-radius: 6px;
    cursor: pointer;
    color: #555;
}

.related-intent {
    width: 100%;
    font-size: 12px;
    color: #333;
    font-weight: 600;
    margin-top: 6px;
}

.message {
    display: flex;
    margin-bottom: 15px;
    animation: slideIn 0.3s ease-in-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message p {
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
    max-width: 80%;
    font-size: 15px;
    line-height: 1.5;
}

.bot-message {
    justify-content: flex-start;
}

.bot-message p {
    background: #e3f2fd;
    color: #1976d2;
    border-bottom-left-radius: 4px;
}

.user-message {
    justify-content: flex-end;
}

.user-message p {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-metadata {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
    text-align: right;
}

.user-message .message-metadata {
    text-align: right;
}

.bot-message .message-metadata {
    text-align: left;
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

#chatForm {
    display: flex;
    gap: 10px;
}

#userInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
}

#userInput:focus {
    border-color: #667eea;
}

button {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(0);
}

.chat-info {
    padding: 10px 20px;
    background: #f7f7f7;
    text-align: center;
    border-top: 1px solid #e0e0e0;
    color: #999;
}

/* Loading indicator */
.loading {
    display: flex;
    align-items: center;
    gap: 5px;
}

.loading span {
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    animation: bounce 1.4s infinite;
}

.loading span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    40% {
        opacity: 1;
        transform: translateY(-10px);
    }
}

/* Responsive design */
@media (max-width: 600px) {
    .chatbot-container {
        border-radius: 0;
        height: 100vh;
        max-height: 100vh;
    }

    .message p {
        max-width: 90%;
    }

    .chatbot-header h1 {
        font-size: 24px;
    }

    #userInput {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .chatbot-wrapper {
        flex-direction: column;
    }

    .memory-panel {
        display: none !important;
    }
}

/* Memory Panel */
.memory-panel {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 300px;
    height: 90vh;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 15px 15px 0 0;
}

.panel-header h3 {
    font-size: 18px;
    margin: 0;
}

.close-panel {
    background: transparent;
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-panel:hover {
    opacity: 0.8;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f9f9f9;
}

#memoryContent {
    font-size: 13px;
    line-height: 1.6;
}

.memory-item {
    background: white;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.memory-item strong {
    color: #667eea;
    display: block;
    margin-bottom: 5px;
}

.memory-item.user-info {
    border-left-color: #764ba2;
}

.memory-item.user-info strong {
    color: #764ba2;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex !important;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 15px 15px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 22px;
}

.close-modal {
    background: transparent;
    color: white;
    border: none;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    opacity: 0.8;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.history-message {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 8px;
    background: #f5f5f5;
}

.history-message.user {
    background: #e3f2fd;
    margin-left: 20px;
}

.history-message.bot {
    background: #f3e5f5;
    margin-right: 20px;
}

.history-role {
    font-weight: bold;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.history-message.user .history-role {
    color: #1976d2;
}

.history-message.bot .history-role {
    color: #7b1fa2;
}

/* Context Info */
.context-info {
    padding: 15px;
    background: #fff3cd;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    max-height: 150px;
    overflow-y: auto;
}

.context-info h4 {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: #856404;
}

#contextDetails {
    font-size: 12px;
    color: #856404;
    line-height: 1.6;
}

.context-item {
    margin-bottom: 5px;
    padding: 5px;
}

/* Reset and History Buttons */
.reset-btn, .history-btn {
    padding: 8px 15px !important;
    font-size: 12px !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    transition: all 0.3s;
}

.reset-btn:hover, .history-btn:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: none !important;
}

@media (max-width: 1200px) {
    .memory-panel {
        display: none;
    }
}

