

.chat-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 80vh;
    max-height: 700px;
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.bot-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.bot-avatar {
    font-size: 40px;
    background: rgba(255, 255, 255, 0.2);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bot-info h2 {
    margin: 0;
    font-size: 24px;
}

.status {
    font-size: 14px;
    opacity: 0.9;
}

.status.online::before {
    content: '●';
    color: #4ade80;
    margin-right: 5px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f7f9fc;
}

.message {
    margin-bottom: 15px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* .message-content {
    display: inline-block;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 75%;
    word-wrap: break-word;
    line-height: 1.4;
    
} */
.message-content {
    display: inline-block;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 75%;
    word-wrap: break-word;
    line-height: 1.4;
    white-space: pre-wrap;
}
.bot-message .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-left-radius: 4px;
}

.admin-message .message-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.user-message {
    text-align: right;
}
.admin-message {
    text-align: left;
}
.user-message .message-content {
    background: #e5e7eb;
    color: #1f2937;
    border-bottom-right-radius: 4px;
}

.message-info {
    font-size: 11px;
    color: #6b7280;
    margin-top: 5px;
    display: block;
}

.bot-message .message-info {
    margin-left: 5px;
}

.user-message .message-info {
    margin-right: 5px;
}

.typing-indicator {
    padding: 10px 20px;
    background: #f7f9fc;
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    margin: 0 2px;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

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

.chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

#messageForm {
    display: flex;
    gap: 10px;
}

#messageInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

#messageInput:focus {
    border-color: #667eea;
}

#sendBtn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

#sendBtn:hover {
    transform: scale(1.05);
}

#sendBtn:active {
    transform: scale(0.95);
}

/* Modal Styles */
.modal-chatbot {
    display: block;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-chatbot-content {
    background: white;
    margin: 15% auto;
    padding: 40px;
    border-radius: 20px;
    max-width: 400px;
    text-align: center;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-chatbot-content h2 {
    color: #667eea;
    margin-bottom: 10px;
}

.modal-chatbot-content p {
    color: #6b7280;
    margin-bottom: 20px;
}

#usernameForm {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#usernameInput {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
}

#usernameInput:focus {
    border-color: #667eea;
}

#usernameForm button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s;
}

#usernameForm button:hover {
    transform: translateY(-2px);
}

/* Reply Preview */
.reply-preview {
    background: #f3f4f6;
    border-left: 3px solid #667eea;
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reply-preview-content {
    flex: 1;
}

.reply-preview-header {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
}

.reply-icon {
    font-size: 14px;
}

.reply-to {
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
}

.reply-preview-message {
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}

.reply-cancel {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
    padding: 5px 10px;
    transition: color 0.2s;
}

.reply-cancel:hover {
    color: #ef4444;
}

/* Reply Message Styling */
.message.has-reply {
    margin-top: 10px;
}

.reply-reference {
    background: rgba(0, 0, 0, 0.1);
    border-left: 3px solid rgba(255, 255, 255, 0.5);
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.reply-reference:hover {
    background: rgba(0, 0, 0, 0.15);
}

.reply-reference-header {
    font-weight: 600;
    margin-bottom: 3px;
    opacity: 0.9;
}

.reply-reference-message {
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-message .reply-reference {
    background: rgba(0, 0, 0, 0.05);
    border-left-color: rgba(0, 0, 0, 0.2);
}

.user-message .reply-reference:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Message Context Menu */
.message-actions {
    display: none;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 5px;
    z-index: 10;
}

.message {
    position: relative;
}

.message:hover .message-actions {
    display: flex;
    gap: 5px;
}

.message-action-btn {
    background: none;
    border: none;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    border-radius: 5px;
    transition: background 0.2s;
}

.message-action-btn:hover {
    background: #f3f4f6;
}

.message-action-btn.reply {
    color: #667eea;
}

/* Scrollbar Styles */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Responsive Design */
@media (max-width: 600px) {
    .container-chatbot {
        padding: 0;
    }
    
    .chat-container {
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .message-content {
        max-width: 85%;
    }
}

/* Authentication styles */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #667eea;
    font-weight: 600;
}

.logout-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: #c82333;
}

.auth-options {
    text-align: center;
}

.auth-section {
    margin-bottom: 30px;
}

.auth-section h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.auth-section p {
    color: #7f8c8d;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.auth-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.auth-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s;
}

.login-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.register-btn {
    background: #28a745;
    color: white;
}

.auth-btn:hover {
    transform: translateY(-2px);
}

.divider {
    margin: 25px 0;
    position: relative;
    text-align: center;
}

.divider span {
    background: white;
    padding: 0 15px;
    color: #adb5bd;
    font-size: 0.9rem;
    font-weight: 600;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e6ed;
    z-index: -1;
}

.guest-section {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.guest-section h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.guest-section p {
    color: #7f8c8d;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.guest-start-btn {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 10px;
}

.guest-start-btn:hover {
    background: #138496;
}

/* User status indicators */
.user-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 8px;
}

.user-badge.member {
    background: #d4edda;
    color: #155724;
}

.user-badge.guest {
    background: #fff3cd;
    color: #856404;
}

/* Previous message styles */
.previous-message {
    opacity: 0.8;
    border-left: 3px solid #17a2b8;
    padding-left: 10px;
}

.previous-message-indicator {
    font-size: 0.8rem;
    color: #17a2b8;
    margin-bottom: 5px;
    font-weight: 600;
}

/* System message styles */
.system-message {
    text-align: center;
    margin: 15px 0;
}

.system-message .message-content {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: inline-block;
}

.system-message .message-info {
    display: none;
}
