/* Modern BeBot-style Interface */
:root {
    --primary-bg: #0a0a0b;
    --secondary-bg: #1a1a1b;
    --sidebar-bg: #f8f9fa;
    --sidebar-text: #6b7280;
    --sidebar-active: #6366f1;
    --border-color: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --highlight-color: #6366f1;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-orb: radial-gradient(circle, #a855f7 0%, #3b82f6 70%);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

[data-bs-theme="dark"] {
    --sidebar-bg: #1f2937;
    --sidebar-text: #9ca3af;
    --border-color: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
}

[data-bs-theme="light"] {
    --primary-bg: #ffffff;
    --secondary-bg: #f8f9fa;
    --sidebar-bg: #ffffff;
    --sidebar-text: #374151;
    --sidebar-active: #6366f1;
    --border-color: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --highlight-color: #6366f1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--primary-bg);
    color: var(--text-primary);
    overflow: hidden;
}

html, body {
    height: 100%;
    min-height: 100%;
    overflow-y: auto;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.app-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: 600;
    font-size: 18px;
    color: var(--text-primary);
}

.app-logo i {
    color: var(--highlight-color);
    font-size: 20px;
}

.logo-image {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: contain;
}

.logo-image-large {
    width: 120px;
    height: auto;
    border-radius: 12px;
    object-fit: contain;
}

.theme-toggle {
    background: transparent !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
}

.theme-toggle:hover {
    background: var(--border-color) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.theme-toggle i {
    font-size: 16px;
    color: var(--text-primary) !important;
}

.sidebar-search {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    gap: 8px;
}

.search-box i {
    color: var(--text-muted);
    font-size: 14px;
}

.search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 14px;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-box kbd {
    background: var(--border-color);
    color: var(--text-muted);
    border: none;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 500;
}

.sidebar-nav {
    padding: 16px 12px;
    border-bottom: 1px solid var(--border-color);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.nav-item:hover {
    background: var(--secondary-bg);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--highlight-color);
    color: white;
}

.nav-item.action-button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 4px 0;
    cursor: pointer;
    user-select: none;
    justify-content: center;
    text-align: center;
}

.nav-item.action-button:hover {
    background: rgba(108, 99, 255, 0.1);
    border-color: rgba(108, 99, 255, 0.3);
    color: var(--highlight-color);
    transform: translateY(-1px);
}

.nav-item i {
    width: 18px;
    font-size: 16px;
}

.sidebar-section {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding: 0 12px;
}

.recent-item {
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.recent-item:hover {
    background: var(--secondary-bg);
}

/* User Info Section */
.user-info {
    padding: 16px 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-avatar {
    text-align: center;
    color: var(--sidebar-text);
}

.user-details {
    text-align: center;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 4px;
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 12px;
    background: rgba(108, 99, 255, 0.1);
    border: 1px solid rgba(108, 99, 255, 0.2);
    display: inline-block;
    text-align: center;
    width: 100%;
}

.user-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.user-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid;
    transition: all 0.2s ease;
}

/* Light mode user action buttons */
[data-bs-theme="light"] .user-actions .btn-outline-light {
    color: #374151;
    border-color: #374151;
    background-color: transparent;
}

[data-bs-theme="light"] .user-actions .btn-outline-light:hover {
    color: #ffffff;
    background-color: #374151;
    border-color: #374151;
}

[data-bs-theme="light"] .user-actions .btn-outline-danger {
    color: #dc3545;
    border-color: #dc3545;
    background-color: transparent;
}

[data-bs-theme="light"] .user-actions .btn-outline-danger:hover {
    color: #ffffff;
    background-color: #dc3545;
    border-color: #dc3545;
}

/* Dark mode user action buttons */
[data-bs-theme="dark"] .user-actions .btn-outline-light {
    color: #f8f9fa;
    border-color: rgba(248, 249, 250, 0.5);
    background-color: transparent;
}

[data-bs-theme="dark"] .user-actions .btn-outline-light:hover {
    color: #000000;
    background-color: #f8f9fa;
    border-color: #f8f9fa;
}

[data-bs-theme="dark"] .user-actions .btn-outline-danger {
    color: #dc3545;
    border-color: rgba(220, 53, 69, 0.5);
    background-color: transparent;
}

[data-bs-theme="dark"] .user-actions .btn-outline-danger:hover {
    color: #ffffff;
    background-color: #dc3545;
    border-color: #dc3545;
}

.recent-date {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 2px;
}

.recent-text {
    font-size: 13px;
    color: var(--sidebar-text);
    line-height: 1.4;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.user-greeting {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    margin-left: 8px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--primary-bg);
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--primary-bg);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.chat-title i {
    color: var(--highlight-color);
    font-size: 18px;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    background: var(--secondary-bg);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.btn-icon:hover {
    border-color: var(--highlight-color);
    color: var(--highlight-color);
}

.btn-dark {
    background: var(--text-primary);
    color: var(--primary-bg);
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-dark:hover {
    background: var(--text-secondary);
}

.user-menu {
    display: flex;
    align-items: center;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.welcome-screen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.welcome-content {
    text-align: center;
    max-width: 600px;
    position: relative;
}

.gradient-orb {
    width: 120px;
    height: 120px;
    background: var(--gradient-orb);
    border-radius: 50%;
    margin: 0 auto 40px;
    opacity: 0.8;
    filter: blur(1px);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.welcome-title {
    font-size: 48px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.welcome-subtitle {
    font-size: 32px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.highlight {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.suggestion-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 20px;
    margin-bottom: 40px;
    color: var(--text-muted);
    font-size: 14px;
}

.suggestion-prompt i {
    color: var(--highlight-color);
}

.action-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    border-color: var(--highlight-color);
    color: var(--highlight-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.action-btn i {
    color: var(--highlight-color);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 80%;
    animation: fadeIn 0.3s ease-out;
}

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

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

.message-content {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 12px 16px;
    color: var(--text-primary);
    line-height: 1.5;
}

.user-message .message-content {
    background: var(--highlight-color);
    color: white;
    border-color: var(--highlight-color);
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--highlight-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: var(--text-primary);
    color: var(--primary-bg);
}

/* Status Panel */
.status-panel {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin: 20px;
    display: flex;
    gap: 16px;
    justify-content: center;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.status-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    background: var(--border-color);
    color: var(--text-muted);
}

.status-badge.success {
    background: #10b981;
    color: white;
}

.status-badge.error {
    background: #ef4444;
    color: white;
}

/* Input Area */
.input-area {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: var(--primary-bg);
}

.input-container {
    max-width: 800px;
    margin: 0 auto;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 12px 16px;
    gap: 12px;
    transition: border-color 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--highlight-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-icon {
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.input-icon:hover {
    color: var(--highlight-color);
}

.message-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.5;
    resize: none;
}

.message-input::placeholder {
    color: var(--text-muted);
}

.send-button {
    background: var(--text-primary) !important;
    color: var(--primary-bg) !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 10px 16px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    width: auto !important;
    height: auto !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: none !important;
}

.send-button:hover {
    background: var(--text-secondary) !important;
    color: var(--primary-bg) !important;
    transform: scale(1.05);
}

.send-button:disabled {
    background: var(--border-color) !important;
    color: var(--text-muted) !important;
    cursor: not-allowed;
    transform: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 240px;
    }

    .welcome-title {
        font-size: 36px;
    }

    .welcome-subtitle {
        font-size: 24px;
    }

    .action-buttons {
        flex-direction: column;
        align-items: center;
    }

    .action-btn {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .sidebar {
        display: none;
    }

    .top-bar {
        padding: 12px 16px;
    }

    .input-area {
        padding: 16px;
    }
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Loading States */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: var(--secondary-bg);
    border-radius: 16px;
    margin: 8px 0;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

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

/* Status Panel Styles */
.status-panel {
    flex-direction: column;
    gap: 8px;
    background: var(--secondary-bg);
    border-radius: 8px;
    padding: 16px;
    border: 1px solid var(--border-color);
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.status-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-badge.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-check-btn {
    background: var(--highlight-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.status-check-btn:hover {
    background: #5a52d5;
    transform: translateY(-1px);
}

.form-switch .form-check-input {
    background-color: var(--border-color);
    border: 2px solid var(--border-color);
    width: 2.5em;
    height: 1.3em;
    border-radius: 1.3em;
    transition: background 0.2s, border 0.2s;
    box-shadow: none;
}

.form-switch .form-check-input:checked {
    background-color: var(--text-primary);
    border-color: var(--text-primary);
}

.form-switch .form-check-input:focus {
    box-shadow: 0 0 0 2px var(--text-secondary);
    border-color: var(--text-secondary);
}

.form-switch .form-check-input:checked::before {
    background-color: var(--primary-bg);
    border-radius: 50%;
}

.form-switch .form-check-input::before {
    content: '';
    display: block;
    width: 1em;
    height: 1em;
    background: var(--primary-bg);
    border-radius: 50%;
    transition: background 0.2s, transform 0.2s;
    transform: translateX(0.15em);
}

.form-switch .form-check-input:checked::before {
    transform: translateX(1.2em);
}
