/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    height: 100%;
    color: #333;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Edit Bot Modal should appear above Manage Bot Modal */
#editBotModal {
    z-index: 1001;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
}

.modal-header h2 .logo-img-small {
    height: 1.25rem;
    width: auto;
    object-fit: contain;
    margin-right: 8px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #f8f9fa;
    color: #333;
}

.modal-body {
    padding: 1.5rem;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
    flex: 1;
    overflow-x: hidden;
}

/* Bot Modal Specific Styles */
#botModal .modal-content {
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

#botModal .modal-header {
    flex-shrink: 0;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

#botModal .modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem;
}

#botModal .modal-body::-webkit-scrollbar {
    width: 8px;
}

#botModal .modal-body::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 4px;
}

#botModal .modal-body::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 4px;
}

#botModal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.8rem;
}

.info-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #495057;
}

.info-box i {
    color: #667eea;
}

.info-box code {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8em;
}

.setup-steps {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.setup-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #495057;
}

.setup-step:last-child {
    margin-bottom: 0;
}

.setup-step i {
    color: #28a745;
    font-size: 1rem;
    width: 16px;
    text-align: center;
}

.setup-step span {
    flex: 1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

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

/* Login Styles */
#loginModal .modal-content {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.login-container {
    padding: 2rem;
    text-align: center;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    max-height: calc(90vh - 0px);
}

.login-container::-webkit-scrollbar {
    width: 8px;
}

.login-container::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 4px;
}

.login-container::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 4px;
}

.login-container::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

.login-header {
    margin-bottom: 2rem;
}

.login-header i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.login-header .logo-img {
    height: 3rem;
    width: auto;
    object-fit: contain;
    margin-bottom: 1rem;
}

.login-header h2 {
    color: #333;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #666;
    font-size: 0.9rem;
}

/* Authentication styles moved to public/css/supabase/auth.css */

.form-group {
    position: relative;
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-group i {
    position: absolute;
    left: 0.75rem;
    top: 2.25rem;
    color: #999;
}

#loginBtn {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease;
}

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

#loginBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.error-message {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 1rem;
    min-height: 1.2rem;
}

.success-message {
    color: #27ae60;
    font-size: 0.9rem;
    margin-top: 1rem;
    min-height: 1.2rem;
}

/* Main Application Layout */
#mainApp {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: 100%;
    width: 100%;
    overflow-x: hidden;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
    transition: all 0.3s ease;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-left i {
    font-size: 1.5rem;
    color: #667eea;
}

.header-left .logo-img {
    height: 1.5rem;
    width: auto;
    object-fit: contain;
    margin-right: 10px;
}

.header-left h1 {
    color: #333;
    font-size: 1.5rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #667eea;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    z-index: 101;
    position: relative;
    flex-shrink: 0;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000; /* Higher than header (100) and modals (1000) */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow: hidden;
}

.mobile-menu.active {
    display: block;
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 10001; /* Ensure content is above backdrop */
}

.mobile-menu.active .mobile-menu-content {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    flex-shrink: 0;
}

.mobile-menu-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
}

.mobile-menu-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.mobile-menu-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.mobile-menu-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.mobile-menu-item {
    margin-bottom: 1rem;
}

.mobile-menu-label {
    display: block;
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.mobile-bot-select {
    width: 100%;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.bot-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bot-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
    min-width: 150px;
}

#refreshBotsBtn {
    padding: 0.5rem 0.75rem;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

#refreshBotsBtn:hover {
    background: #5a6268;
}

#refreshBotsBtn:disabled {
    background: #adb5bd;
    cursor: not-allowed;
}

.bot-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e74c3c;
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: #27ae60;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 1rem;
    min-height: calc(100vh - 80px); /* Account for header height */
    transition: all 0.3s ease;
}

/* Files Sidebar */
.files-sidebar {
    width: 300px;
    min-width: 250px;
    max-width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.sidebar-header h3 {
    margin: 0;
    color: #333;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 4px;
}

.files-list {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.no-files-message {
    text-align: center;
    color: #666;
    padding: 2rem 1rem;
}

.no-files-message i {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-files-message p {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.no-files-message small {
    font-size: 0.8rem;
    opacity: 0.7;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.2s;
}

.file-item:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.file-icon {
    margin-right: 0.75rem;
    color: #667eea;
    font-size: 1.1rem;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.file-size {
    font-size: 0.8rem;
    color: #666;
}

.file-status {
    margin-left: 0.5rem;
    font-size: 0.8rem;
}

.file-status.synced {
    color: #28a745;
}

.file-status.pending {
    color: #ffc107;
}

.file-status.error {
    color: #dc3545;
}

/* Chat Area */
.chat-area {
    flex: 1;
    min-width: 0; /* Allow flex item to shrink below content size */
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(100vh - 280px); /* Account for header and input area */
    min-height: 300px;
}

.welcome-message {
    text-align: center;
    color: #666;
    padding: 2rem;
}

.welcome-message i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.welcome-message h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.welcome-message p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.whatsapp-help-box {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.whatsapp-help-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.35);
}

.whatsapp-help-box i {
    font-size: 2.25rem;
    color: white;
    flex-shrink: 0;
    margin-top: 0.125rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.whatsapp-help-content {
    flex: 1;
}

.whatsapp-help-content strong {
    display: block;
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.whatsapp-help-content p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.98;
}

.whatsapp-help-content p strong {
    display: inline;
    font-weight: 600;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin: 0;
}

.welcome-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #333;
}

.feature-item i {
    color: #667eea;
    font-size: 1.2rem;
}

/* Use Cases Modal */
.large-modal {
    max-width: 900px;
    width: 95%;
}

.use-cases-tabs {
    margin-top: 20px;
}

.tab-buttons {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #e9ecef;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.tab-panel h3 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 1.5rem;
}

.use-case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.use-case-item {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s ease;
}

.use-case-item:hover {
    transform: translateY(-3px);
}

.use-case-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 1.5rem;
}

.use-case-item h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #333;
}

.use-case-item ul {
    list-style: none;
    text-align: left;
}

.use-case-item li {
    padding: 6px 0;
    color: #666;
    position: relative;
    padding-left: 20px;
    font-size: 0.9rem;
}

.use-case-item li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 20px 30px;
    border-top: 1px solid #e9ecef;
}

.message {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.75rem;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

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

.message.assistant .message-avatar {
    background: #f8f9fa;
    color: #667eea;
    border: 2px solid #e9ecef;
}

.message-content {
    flex: 1;
    max-width: 70%;
}

.message.user .message-content {
    text-align: right;
}

.message-bubble {
    padding: 1rem 1.25rem;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.5;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 6px;
}

.message.assistant .message-bubble {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 6px;
}

.message-time {
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.5rem;
}

/* Message Content Formatting */
.message-bubble h1,
.message-bubble h2,
.message-bubble h3 {
    margin: 1rem 0 0.5rem 0;
    font-weight: 600;
    line-height: 1.3;
}

.message-bubble h1 {
    font-size: 1.4rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.message-bubble h2 {
    font-size: 1.2rem;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.3rem;
}

.message-bubble h3 {
    font-size: 1.1rem;
}

.message-bubble p {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.message-bubble ul,
.message-bubble ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.message-bubble li {
    margin: 0.25rem 0;
    line-height: 1.5;
}

.message-bubble code {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    color: #e83e8c;
}

.message-bubble pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin: 0.75rem 0;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
}

.message-bubble pre code {
    background: none;
    padding: 0;
    color: #333;
    font-size: inherit;
}

.message-bubble strong {
    font-weight: 600;
    color: #495057;
}

.message-bubble em {
    font-style: italic;
    color: #6c757d;
}

.message-bubble a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.message-bubble a:hover {
    text-decoration: underline;
}

.message-bubble blockquote {
    border-left: 4px solid #667eea;
    margin: 0.75rem 0;
    padding: 0.5rem 0 0.5rem 1rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 0 4px 4px 0;
    font-style: italic;
}

/* Dark theme for assistant messages */
.message.assistant .message-bubble code {
    background: rgba(0, 0, 0, 0.1);
    color: #e83e8c;
}

.message.assistant .message-bubble pre {
    background: #f1f3f4;
    border-color: #dadce0;
}

.message.assistant .message-bubble pre code {
    color: #333;
}

/* Light theme for user messages */
.message.user .message-bubble code {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.message.user .message-bubble pre {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.message.user .message-bubble pre code {
    color: #fff;
}

.message.user .message-bubble strong {
    color: #fff;
}

.message.user .message-bubble em {
    color: rgba(255, 255, 255, 0.9);
}

.message.user .message-bubble a {
    color: #fff;
    text-decoration: underline;
}

.message.user .message-time {
    text-align: right;
}

/* Chat Input */
.chat-input-container {
    padding: 1.5rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.chat-input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

#messageInput {
    flex: 1;
    min-height: 44px;
    max-height: 120px;
    padding: 0.75rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 22px;
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.3s ease;
}

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

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

.send-btn:hover:not(:disabled) {
    transform: scale(1.05);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #666;
}

.char-count {
    font-weight: 500;
}

.typing-indicator {
    display: none;
    align-items: center;
    gap: 0.25rem;
}

.typing-indicator i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #667eea;
    animation: typing 1.4s infinite;
}

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

.typing-indicator i:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 1px solid #667eea;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-spinner {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.loading-spinner i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 1rem;
}


/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        max-width: 100%;
        padding: 0.75rem;
    }
    
    .files-sidebar {
        width: 280px;
        min-width: 200px;
    }
}

@media (max-width: 992px) {
    .header-right {
        gap: 0.4rem;
    }
    
    .bot-selector {
        flex-wrap: wrap;
        gap: 0.4rem;
    }
    
    .bot-select {
        min-width: 120px;
        font-size: 0.85rem;
    }
    
    .btn {
        padding: 0.4rem 0.7rem;
        font-size: 0.85rem;
    }
    
    .header-left h1 {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .files-sidebar {
        width: 100%;
        order: 2;
        max-height: 250px;
        min-width: 100%;
    }
    
    .chat-area {
        order: 1;
        min-height: 60vh;
        width: 100%;
    }
    
    .header {
        padding: 0.75rem 0;
    }
    
    .header-content {
        padding: 0 0.5rem;
        flex-wrap: nowrap;
        gap: 0.5rem;
        justify-content: space-between;
    }
    
    .header-left {
        flex: 1;
        min-width: 120px;
    }
    
    .header-left h1 {
        font-size: 1.1rem;
    }
    
    .header-left i {
        font-size: 1.2rem;
    }
    
    .mobile-menu-btn {
        display: flex !important;
        order: 2;
        margin-left: auto;
    }
    
    .header-right {
        display: none !important;
    }
    
    .bot-selector {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .bot-select {
        flex: 1;
        min-width: 150px;
    }
    
    .status-indicator {
        font-size: 0.8rem;
    }
    
    .btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .btn i {
        margin-right: 0.3rem;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .chat-messages {
        padding: 1rem;
        max-height: calc(100vh - 320px);
    }
    
    .welcome-message {
        padding: 1.5rem 1rem;
    }
    
    .whatsapp-help-box {
        padding: 1rem;
        margin-top: 1.5rem;
        flex-direction: column;
        text-align: center;
    }
    
    .whatsapp-help-box i {
        margin-top: 0;
        margin-bottom: 0.5rem;
    }
    
    .whatsapp-help-content {
        text-align: left;
    }
    
    .whatsapp-help-content strong {
        font-size: 1rem;
    }
    
    .whatsapp-help-content p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .header-left h1 {
        font-size: 1rem;
    }
    
    .mobile-menu-btn {
        display: flex !important;
        order: 2;
        margin-left: auto;
    }
    
    .header-right {
        display: none !important;
    }
    
    .bot-selector {
        flex-direction: column;
    }
    
    .bot-select {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
        margin-bottom: 0.25rem;
    }
    
    .main-content {
        padding: 0.25rem;
    }
    
    .chat-messages {
        padding: 0.75rem;
    }
    
    .welcome-message {
        padding: 1rem 0.75rem;
    }
    
    .welcome-message h3 {
        font-size: 1.1rem;
    }
    
    .welcome-message p {
        font-size: 0.95rem;
    }
    
    .whatsapp-help-box {
        padding: 0.875rem;
        margin-top: 1.25rem;
        flex-direction: column;
        text-align: center;
    }
    
    .whatsapp-help-box i {
        font-size: 1.5rem;
        margin-top: 0;
        margin-bottom: 0.5rem;
    }
    
    .whatsapp-help-content {
        text-align: left;
    }
    
    .whatsapp-help-content strong {
        font-size: 0.95rem;
    }
    
    .whatsapp-help-content p {
        font-size: 0.85rem;
    }
}

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

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

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

/* Bot Management Modal Styles */
.modal-content.large {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Manage Bot Modal Specific Styles (Combined: Settings, Upload, Sync) */
#manageBotModal .modal-content {
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

#manageBotModal .modal-header {
    flex-shrink: 0;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

#manageBotModal .modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
}

#manageBotModal .modal-body::-webkit-scrollbar {
    width: 8px;
}

#manageBotModal .modal-body::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 4px;
}

#manageBotModal .modal-body::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 4px;
}

#manageBotModal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* Tab Styles */
.manage-bot-tabs {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    background: #f8f9fa;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
}

.manage-bot-tabs .tab-btn {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    color: #666;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.manage-bot-tabs .tab-btn:hover {
    background: #e9ecef;
    color: #333;
}

.manage-bot-tabs .tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
    font-weight: 600;
}

.manage-bot-tabs .tab-btn i {
    font-size: 0.9rem;
}

.tab-content {
    display: none;
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

.tab-content.active {
    display: block;
}

.tab-content::-webkit-scrollbar {
    width: 8px;
}

.tab-content::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 4px;
}

.tab-content::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 4px;
}

.tab-content::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* User Profile Modal Specific Styles */
#userProfileModal .modal-content {
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

#userProfileModal .modal-header {
    flex-shrink: 0;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

#userProfileModal .modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem;
    padding-bottom: 1rem;
}

#userProfileModal .modal-body::-webkit-scrollbar {
    width: 8px;
}

#userProfileModal .modal-body::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 4px;
}

#userProfileModal .modal-body::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

#userProfileModal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #667eea;
}

.user-profile-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.user-profile-section:last-of-type {
    border-bottom: none;
    margin-bottom: 1rem;
}

.user-profile-section h3 {
    margin: 0 0 1rem 0;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-profile-section h3 i {
    color: #667eea;
}

.info-card {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border: 1px solid #e0e7ff;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.info-card.loading {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 1.5rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.info-item:last-child {
    border-bottom: none;
}

.info-item i {
    color: #667eea;
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
}

.info-item strong {
    color: #333;
    font-weight: 600;
    min-width: 120px;
    font-size: 0.9rem;
}

.info-item span {
    color: #666;
    flex: 1;
    font-size: 0.9rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

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

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

.verification-section {
    background: #f8f9ff;
    border: 2px dashed #e0e7ff;
    border-radius: 10px;
    padding: 1.25rem;
    margin-top: 1.25rem;
    display: none;
    animation: slideIn 0.3s ease-out;
}

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

.bot-info-section,
.file-upload-section,
.files-list-section,
.sync-section,
.whatsapp-phone-section {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
}

.files-list-section {
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

.section-header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header-with-action h3 {
    margin: 0;
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.files-list-section .files-list {
    flex: 1;
    overflow-y: auto;
    max-height: 350px;
    padding: 0.5rem 0;
}

.files-list-section .files-list::-webkit-scrollbar {
    width: 6px;
}

.files-list-section .files-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.files-list-section .files-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.files-list-section .files-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.delete-section {
    margin-bottom: 0;
    padding: 1.25rem;
    border-top: 2px solid #fee;
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-radius: 0 0 8px 8px;
    background-color: #fff5f5;
}

.bot-info-section h3,
.file-upload-section h3,
.files-list-section h3,
.sync-section h3,
.whatsapp-phone-section h3,
.delete-section h3 {
    margin-bottom: 0.75rem;
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    flex-wrap: wrap;
}

/* Bot name in Manage Data section - handle long names */
#fileUploadBotName {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    display: inline-block;
    word-break: break-word;
}

.section-description {
    margin-bottom: 1rem;
    color: #6c757d;
    font-size: 0.875rem;
    line-height: 1.5;
}

.bot-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-item label {
    font-weight: 600;
    color: #6c757d;
    font-size: 0.9rem;
}

.detail-item span {
    color: #495057;
    word-break: break-all;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.processing {
    background: #fff3cd;
    color: #856404;
}

.status-badge.failed {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.unknown {
    background: #e2e3e5;
    color: #6c757d;
}

.capability-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.capability-badge .capability-icon {
    font-size: 0.9rem;
}

/* Capabilities Grid for Bot Creation Form */
.capabilities-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.capability-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    font-size: 0.9rem;
}

.capability-checkbox:hover {
    background-color: #f8f9fa;
}

.capability-checkbox input[type="checkbox"] {
    margin: 0;
    margin-right: 0.5rem;
    cursor: pointer;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.capability-checkbox span {
    user-select: none;
    line-height: 1.4;
}

.path-text {
    font-family: 'Courier New', monospace;
    background: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* File Upload Styles */
.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #f0f4ff;
}

.upload-content i {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.upload-content p {
    margin: 0.5rem 0;
    color: #495057;
}

.upload-hint {
    font-size: 0.9rem;
    color: #6c757d;
}

.upload-progress {
    margin-top: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 0.9rem;
    color: #495057;
    font-weight: 600;
}

.uploaded-files {
    margin-top: 1rem;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.chunk-info {
    margin-top: 0.25rem;
    color: #6c757d;
    font-size: 0.8rem;
}

.chunk-info i {
    margin-right: 0.25rem;
    color: #667eea;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-info i {
    color: #667eea;
}

.file-name {
    font-weight: 500;
    color: #495057;
}

.file-size {
    font-size: 0.8rem;
    color: #6c757d;
}

.file-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-status.success {
    color: #27ae60;
}

.file-status.error {
    color: #e74c3c;
}

.file-status.uploading {
    color: #667eea;
}

/* Sync Section Styles */
.sync-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.sync-status {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f8f9fa;
}

.status-item:last-child {
    border-bottom: none;
}

.status-item label {
    font-weight: 600;
    color: #6c757d;
    font-size: 0.9rem;
}

.status-item span {
    color: #495057;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    flex-shrink: 0;
}

/* WhatsApp Phone Section Styles */
.whatsapp-phone-section {
    margin-bottom: 1.5rem;
}

.current-value-display {
    margin-bottom: 1.25rem;
    padding: 0.75rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.current-value-display label {
    display: block;
    font-weight: 600;
    color: #6c757d;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.current-value-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.95rem;
    color: #495057;
}

.current-value-box i {
    color: #25d366;
    font-size: 1.1rem;
}

.whatsapp-phone-section .form-group {
    margin-bottom: 1rem;
}

.whatsapp-phone-controls {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.whatsapp-phone-controls .btn {
    flex: 1;
    min-width: 140px;
}

/* Responsive Design for Bot Management */
@media (max-width: 768px) {
    .modal-content.large {
        max-width: 95%;
        margin: 1rem;
    }
    
    #userProfileModal .modal-content {
        max-width: 95%;
        max-height: 95vh;
        margin: 0.5rem;
        width: calc(100% - 1rem);
    }
    
    #userProfileModal .modal-header {
        padding: 1rem 1.25rem;
    }
    
    #userProfileModal .modal-body {
        padding: 1rem;
        padding-bottom: 0.75rem;
    }
    
    .user-profile-section {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }
    
    .info-card {
        padding: 1rem;
    }
    
    .info-item {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .btn-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    #manageBotModal .modal-content {
        max-width: 95%;
        max-height: 95vh;
        margin: 0.5rem;
    }
    
    #manageBotModal .modal-header {
        padding: 1rem 1.25rem;
    }
    
    #manageBotModal .modal-body {
        padding: 0;
    }
    
    .manage-bot-tabs .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    .tab-content {
        padding: 1rem;
    }
    
    .bot-details {
        grid-template-columns: 1fr;
    }
    
    .sync-controls {
        flex-direction: column;
    }
    
    .whatsapp-phone-controls {
        flex-direction: column;
    }
    
    .whatsapp-phone-controls .btn {
        width: 100%;
        min-width: unset;
    }
    
    .bot-info-section,
    .file-upload-section,
    .files-list-section,
    .sync-section,
    .whatsapp-phone-section,
    .delete-section {
        padding: 1rem;
        margin-bottom: 1.25rem;
    }
    
    /* Long bot names in Manage Data section */
    .bot-info-section h3 {
        flex-wrap: wrap;
        font-size: 1rem;
    }
    
    #fileUploadBotName {
        word-break: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }
    
    .files-list-section {
        max-height: 300px;
    }
    
    .files-list-section .files-list {
        max-height: 250px;
    }
    
    /* Bot Modal Mobile Styles */
    #botModal .modal-content {
        max-width: 95%;
        max-height: 95vh;
        margin: 0.5rem;
        width: calc(100% - 1rem);
    }
    
    #botModal .modal-header {
        padding: 1rem 1.25rem;
    }
    
    #botModal .modal-body {
        padding: 1rem;
    }
    
    /* User Profile Modal Mobile Styles */
    #userProfileModal .modal-content {
        max-width: 100%;
        max-height: 100vh;
        margin: 0;
        width: 100%;
        border-radius: 0;
        height: 100vh;
    }
    
    #userProfileModal .modal-header {
        padding: 0.75rem 1rem;
    }
    
    #userProfileModal .modal-body {
        padding: 0.75rem;
        padding-bottom: 0.5rem;
    }
    
    .user-profile-section {
        margin-bottom: 1.25rem;
        padding-bottom: 0.75rem;
    }
    
    .user-profile-section h3 {
        font-size: 1rem;
    }
    
    .info-card {
        padding: 0.75rem;
    }
    
    .info-item {
        font-size: 0.9rem;
        padding: 0.5rem 0;
    }
    
    .info-item strong {
        font-size: 0.85rem;
    }
    
    .form-group {
        margin-bottom: 0.75rem;
    }
    
    .form-control {
        font-size: 0.9rem;
        padding: 0.625rem 0.75rem;
    }
    
    .btn-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-group .btn {
        width: 100%;
        padding: 0.75rem 1rem;
    }
    
    .verification-section {
        padding: 1rem;
    }
}

/* Delete Bot Section - Already defined above, removing duplicate */

.delete-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.delete-warning i {
    color: #856404;
    margin-right: 0.5rem;
}

.delete-warning p {
    margin: 0 0 0.5rem 0;
    color: #856404;
    font-weight: 500;
}

.delete-warning ul {
    margin: 0.5rem 0 0 1.5rem;
    color: #856404;
}

.delete-warning li {
    margin-bottom: 0.25rem;
}

.delete-controls {
    display: flex;
    justify-content: center;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.btn-danger:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Delete Confirmation Modal */
#deleteConfirmationModal .modal-content {
    max-width: 600px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.confirmation-warning {
    text-align: center;
    padding: 1rem 0;
}

.confirmation-warning i {
    font-size: 3rem;
    color: #dc3545;
    margin-bottom: 1rem;
}

.confirmation-warning h3 {
    color: #dc3545;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.bot-to-delete {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: left;
}

.bot-to-delete p {
    margin: 0.5rem 0;
    font-size: 1rem;
}

.bot-to-delete strong {
    color: #495057;
}

.deletion-impact {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: left;
}

.deletion-impact h4 {
    color: #856404;
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.deletion-impact ul {
    margin: 0.5rem 0 0 1.5rem;
    color: #856404;
}

.deletion-impact li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.deletion-impact li i {
    color: #dc3545;
    width: 16px;
}

.confirmation-input {
    margin: 1.5rem 0;
    text-align: left;
}

.confirmation-input label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
}

.confirmation-input input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.confirmation-input input:focus {
    outline: none;
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.modal-footer .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
}

.modal-footer .btn-secondary {
    background-color: #6c757d;
    color: white;
}

.modal-footer .btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

.modal-footer .btn-danger {
    background-color: #dc3545;
    color: white;
}

.modal-footer .btn-danger:hover:not(:disabled) {
    background-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* Responsive Design for Delete Modal */
@media (max-width: 768px) {
    #deleteConfirmationModal .modal-content {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    .confirmation-warning h3 {
        font-size: 1.25rem;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

/* User Requests Modal Styles */
.user-requests-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.user-requests-controls .filter-group {
    flex: 1;
    min-width: 150px;
}

.user-requests-controls .filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.user-requests-controls .form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

.user-requests-list {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Single-line data item */
.data-item-line {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.data-item-line:hover {
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.data-item-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.data-emoji {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.data-type {
    font-weight: 600;
    color: #495057;
    flex-shrink: 0;
    min-width: 120px;
}

.data-status {
    font-size: 0.9rem;
    flex-shrink: 0;
}

.data-summary {
    flex: 1;
    color: #6c757d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0 0.5rem;
}

.data-date {
    font-size: 0.85rem;
    color: #adb5bd;
    flex-shrink: 0;
    display: none; /* Hide date to simplify display */
}

.data-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-icon {
    background: transparent;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

.btn-icon:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
}

.btn-icon.btn-danger {
    color: #dc3545;
    border-color: #f5c6cb;
}

.btn-icon.btn-danger:hover {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.user-request-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.user-request-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.user-request-item.status-pending {
    border-left: 4px solid #ffc107;
}

.user-request-item.status-in-progress {
    border-left: 4px solid #17a2b8;
}

.user-request-item.status-resolved {
    border-left: 4px solid #28a745;
}

.user-request-item.status-cancelled {
    border-left: 4px solid #dc3545;
    opacity: 0.7;
}

.user-request-item.status-persisted {
    border-left: 4px solid #6f42c1;
    background: linear-gradient(to right, rgba(111, 66, 193, 0.05), transparent);
}

.request-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.request-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.request-emoji {
    font-size: 1.5rem;
}

.request-type-text {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.request-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-emoji {
    font-size: 1rem;
}

.request-status.status-pending {
    background: #fff3cd;
    color: #856404;
}

.request-status.status-in-progress {
    background: #d1ecf1;
    color: #0c5460;
}

.request-status.status-resolved {
    background: #d4edda;
    color: #155724;
}

.request-status.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.request-status.status-persisted {
    background: #e2d9f3;
    color: #6f42c1;
}

.request-body {
    margin-bottom: 1rem;
}

.request-question {
    margin-bottom: 1rem;
}

.request-question strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-size: 0.9rem;
}

.request-question p {
    color: #333;
    line-height: 1.6;
    margin: 0;
}

.request-question-toggle {
    margin-bottom: 1rem;
}

.toggle-message-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    color: #667eea;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
}

.toggle-message-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.toggle-message-btn i {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.request-question.hidden {
    display: none;
}

.request-question:not(.hidden) {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.request-question:not(.hidden) p {
    color: #555;
    font-size: 0.9rem;
    margin: 0;
}

.request-metadata {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.request-metadata strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-size: 0.9rem;
}

.request-metadata pre {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.request-admin-notes {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #fff3cd;
    border-radius: 6px;
    border-left: 3px solid #ffc107;
}

.request-admin-notes strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #856404;
    font-size: 0.9rem;
}

.request-admin-notes p {
    color: #856404;
    margin: 0;
    line-height: 1.6;
}

.request-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e9ecef;
    font-size: 0.85rem;
    color: #666;
}

.request-dates {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.request-dates span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.request-bot {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #667eea;
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
    margin: 0;
}

.error-message {
    text-align: center;
    padding: 2rem;
    color: #dc3545;
}

.error-message i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: #667eea;
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .user-requests-controls {
        flex-direction: column;
    }
    
    .user-requests-controls .filter-group {
        width: 100%;
    }
    
    .request-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .request-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}
