        /* Animated gradient backgrounds */
        @keyframes hero-gradient-animation-light {
            0% {
                --c-0: hsla(192, 56%, 59%, 1);
                --y-0: 27%;
                --s-start-0: 16%;
                --s-end-0: 78%;
                --x-0: 37%;
                --y-1: 34%;
                --c-1: hsla(239, 63%, 52%, 1);
                --x-1: 37%;
                --s-start-1: 1%;
                --s-end-1: 76%;
                --s-start-2: 4%;
                --s-end-2: 75%;
                --c-2: hsla(223, 73%, 65%, 1);
                --x-2: 20%;
                --y-2: 96%;
                --s-start-3: 5%;
                --s-end-3: 53%;
                --x-3: 77%;
                --y-3: 74%;
                --c-3: hsla(107, 35%, 81%, 1);
                --y-4: 40%;
                --s-start-4: 10%;
                --s-end-4: 73%;
                --c-4: hsla(110, 57%, 96%, 1);
                --x-4: 89%;
            }
            100% {
                --c-0: hsla(149, 51%, 92%, 1);
                --y-0: 2%;
                --s-start-0: 18%;
                --s-end-0: 69%;
                --x-0: 41%;
                --y-1: 73%;
                --c-1: hsla(201, 69%, 54%, 1);
                --x-1: 0%;
                --s-start-1: 12%;
                --s-end-1: 88%;
                --s-start-2: 9%;
                --s-end-2: 56%;
                --c-2: hsla(205, 39%, 83%, 1);
                --x-2: 24%;
                --y-2: 15%;
                --s-start-3: 5%;
                --s-end-3: 87%;
                --x-3: 9%;
                --y-3: 15%;
                --c-3: hsla(146, 34%, 89%, 1);
                --y-4: 50%;
                --s-start-4: 0%;
                --s-end-4: 89%;
                --c-4: hsla(124, 48%, 95%, 1);
                --x-4: 84%;
            }
        }

        @keyframes hero-gradient-animation-dark {
            0% {
                --x-0: 1%;
                --s-start-0: 5.202913631633715%;
                --s-end-0: 53.01682626841344%;
                --c-0: hsla(212.37, 81%, 25%, 0.61);
                --y-0: 0%;
            }
            100% {
                --x-0: 1%;
                --s-start-0: 5%;
                --s-end-0: 53.00384867488662%;
                --c-0: hsla(212.37, 81%, 25%, 0.32);
                --y-0: 0%;
            }
        }

        /* CSS Properties for animations */
        @property --x-0 { syntax: '<percentage>'; inherits: false; initial-value: 1%; }
        @property --s-start-0 { syntax: '<percentage>'; inherits: false; initial-value: 5.202913631633715%; }
        @property --s-end-0 { syntax: '<percentage>'; inherits: false; initial-value: 53.01682626841344%; }
        @property --c-0 { syntax: '<color>'; inherits: false; initial-value: hsla(212.37, 81%, 25%, 0.61); }
        @property --y-0 { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
        @property --y-1 { syntax: '<percentage>'; inherits: false; initial-value: 34%; }
        @property --c-1 { syntax: '<color>'; inherits: false; initial-value: hsla(239, 63%, 52%, 1); }
        @property --x-1 { syntax: '<percentage>'; inherits: false; initial-value: 37%; }
        @property --s-start-1 { syntax: '<percentage>'; inherits: false; initial-value: 1%; }
        @property --s-end-1 { syntax: '<percentage>'; inherits: false; initial-value: 76%; }
        @property --s-start-2 { syntax: '<percentage>'; inherits: false; initial-value: 4%; }
        @property --s-end-2 { syntax: '<percentage>'; inherits: false; initial-value: 75%; }
        @property --c-2 { syntax: '<color>'; inherits: false; initial-value: hsla(223, 73%, 65%, 1); }
        @property --x-2 { syntax: '<percentage>'; inherits: false; initial-value: 20%; }
        @property --y-2 { syntax: '<percentage>'; inherits: false; initial-value: 96%; }
        @property --s-start-3 { syntax: '<percentage>'; inherits: false; initial-value: 5%; }
        @property --s-end-3 { syntax: '<percentage>'; inherits: false; initial-value: 53%; }
        @property --x-3 { syntax: '<percentage>'; inherits: false; initial-value: 77%; }
        @property --y-3 { syntax: '<percentage>'; inherits: false; initial-value: 74%; }
        @property --c-3 { syntax: '<color>'; inherits: false; initial-value: hsla(107, 35%, 81%, 1); }
        @property --y-4 { syntax: '<percentage>'; inherits: false; initial-value: 40%; }
        @property --s-start-4 { syntax: '<percentage>'; inherits: false; initial-value: 10%; }
        @property --s-end-4 { syntax: '<percentage>'; inherits: false; initial-value: 73%; }
        @property --c-4 { syntax: '<color>'; inherits: false; initial-value: hsla(110, 57%, 96%, 1); }
        @property --x-4 { syntax: '<percentage>'; inherits: false; initial-value: 89%; }

        :root {
            /* Light Mode Colors */
            --bg-gradient-light: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
            --panel-bg-light: rgba(255, 255, 255, 0.9);
            --panel-border-light: rgba(0, 0, 0, 0.1);
            --text-primary-light: #1e293b;
            --text-secondary-light: #64748b;
            --text-tertiary-light: #94a3b8;
            
            /* Dark Mode Colors */
            --bg-gradient-dark: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
            --panel-bg-dark: rgba(30, 41, 59, 0.9);
            --panel-border-dark: rgba(255, 255, 255, 0.1);
            --text-primary-dark: #ffffff;
            --text-secondary-dark: #e2e8f0;
            --text-tertiary-dark: #94a3b8;
            
            /* Accent Colors */
            --accent-primary: #3b82f6;
            --accent-secondary: #10b981;
            --accent-hover: rgba(59, 130, 246, 0.1);
            --success-color: #10b981;
            --error-color: #ef4444;
            --warning-color: #f59e0b;
        }

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

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
            min-height: 100vh;
            overflow: hidden;
            position: relative;
            color: var(--text-primary-light);
            transition: color 0.3s ease;
            
            /* Beautiful multi-gradient animated background for LIGHT mode */
            --c-0: hsla(192, 56%, 59%, 1);
            --y-0: 27%;
            --x-0: 37%;
            --y-1: 34%;
            --c-1: hsla(239, 63%, 52%, 1);
            --x-1: 37%;
            --c-2: hsla(223, 73%, 65%, 1);
            --x-2: 20%;
            --y-2: 96%;
            --x-3: 77%;
            --y-3: 74%;
            --c-3: hsla(107, 35%, 81%, 1);
            --y-4: 40%;
            --c-4: hsla(110, 57%, 96%, 1);
            --x-4: 89%;
            
            background-color: hsla(246, 56%, 88%, 1);
            background-image: 
                url("data:image/svg+xml,%3Csvg viewBox='0 0 3000 3000' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E"),
                radial-gradient(circle at var(--x-0) var(--y-0), var(--c-0) var(--s-start-0), transparent var(--s-end-0)),
                radial-gradient(circle at var(--x-1) var(--y-1), var(--c-1) var(--s-start-1), transparent var(--s-end-1)),
                radial-gradient(circle at var(--x-2) var(--y-2), var(--c-2) var(--s-start-2), transparent var(--s-end-2)),
                radial-gradient(circle at var(--x-3) var(--y-3), var(--c-3) var(--s-start-3), transparent var(--s-end-3)),
                radial-gradient(circle at var(--x-4) var(--y-4), var(--c-4) var(--s-start-4), transparent var(--s-end-4));
            animation: hero-gradient-animation-light 10s linear infinite alternate;
            background-blend-mode: overlay, normal, normal, normal, normal, normal;
        }

        body.dark-mode {
            color: var(--text-primary-dark);
            
            /* Simple animated gradient for DARK mode */
            --x-0: 1%;
            --c-0: hsla(212.37, 81%, 25%, 0.61);
            --y-0: 0%;
            background-color: hsla(213.18, 65%, 6%, 1);
            background-image: radial-gradient(circle at var(--x-0) var(--y-0), var(--c-0) var(--s-start-0), transparent var(--s-end-0));
            animation: hero-gradient-animation-dark 10s linear infinite alternate;
            background-blend-mode: normal;
        }

        .container {
            display: flex;
            height: 100vh;
            position: relative;
            width: 100%;
        }

        /* Settings Sidebar */
        .sidebar {
            width: 320px;
            background: var(--panel-bg-light);
            backdrop-filter: blur(20px);
            border-right: 1px solid var(--panel-border-light);
            padding: 24px;
            overflow-y: auto;
            transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
            transform: translateX(-100%);
            position: fixed;
            top: 0;
            left: 0;
            height: 100vh;
            z-index: 1000;
            box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
        }

        body.dark-mode .sidebar {
            background: var(--panel-bg-dark);
            border-right: 1px solid var(--panel-border-dark);
            box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
        }

        .sidebar.open {
            transform: translateX(0);
        }

        .sidebar-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 30px;
            padding-bottom: 20px;
            border-bottom: 1px solid var(--panel-border-light);
            transition: border-color 0.3s ease;
        }

        body.dark-mode .sidebar-header {
            border-bottom: 1px solid var(--panel-border-dark);
        }

        .sidebar-title {
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary-light);
            transition: color 0.3s ease;
        }

        body.dark-mode .sidebar-title {
            color: var(--text-primary-dark);
        }

        .close-sidebar {
            background: none;
            border: none;
            color: var(--text-secondary-light);
            font-size: 24px;
            cursor: pointer;
            opacity: 0.7;
            transition: opacity 0.2s ease, color 0.3s ease;
        }

        body.dark-mode .close-sidebar {
            color: var(--text-secondary-dark);
        }

        .close-sidebar:hover {
            opacity: 1;
        }

        .sidebar-section {
            margin-bottom: 24px;
        }

        .section-title {
            color: var(--text-secondary-light);
            font-size: 12px;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-bottom: 16px;
            opacity: 0.7;
            transition: color 0.3s ease;
        }

        body.dark-mode .section-title {
            color: var(--text-secondary-dark);
        }

        .settings-group {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .setting-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px;
            background: rgba(0, 0, 0, 0.05);
            border-radius: 12px;
            transition: all 0.2s ease;
            cursor: pointer;
        }

        body.dark-mode .setting-item {
            background: rgba(255, 255, 255, 0.1);
        }

        .setting-item:hover {
            background: rgba(0, 0, 0, 0.1);
        }

        body.dark-mode .setting-item:hover {
            background: rgba(255, 255, 255, 0.15);
        }

        .setting-label {
            color: var(--text-primary-light);
            font-size: 14px;
            font-weight: 500;
            transition: color 0.3s ease;
        }

        body.dark-mode .setting-label {
            color: var(--text-primary-dark);
        }

        .setting-toggle {
            width: 44px;
            height: 24px;
            background: rgba(100, 116, 139, 0.3);
            border-radius: 12px;
            position: relative;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        body.dark-mode .setting-toggle {
            background: rgba(255, 255, 255, 0.2);
        }

        .setting-toggle.active {
            background: var(--accent-secondary);
        }

        .setting-toggle::after {
            content: '';
            position: absolute;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: white;
            top: 2px;
            left: 2px;
            transition: all 0.3s ease;
        }

        .setting-toggle.active::after {
            transform: translateX(20px);
        }

        .account-info {
            padding: 20px;
            background: rgba(0, 0, 0, 0.05);
            border-radius: 16px;
            margin-bottom: 16px;
            transition: background 0.3s ease;
        }

        body.dark-mode .account-info {
            background: rgba(255, 255, 255, 0.1);
        }

        .account-avatar {
            width: 48px;
            height: 48px;
            background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            color: white;
            font-size: 18px;
            margin-bottom: 12px;
        }

        .account-name {
            color: var(--text-primary-light);
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 4px;
            transition: color 0.3s ease;
        }

        body.dark-mode .account-name {
            color: var(--text-primary-dark);
        }

        .account-email {
            color: var(--text-secondary-light);
            font-size: 13px;
            transition: color 0.3s ease;
        }

        body.dark-mode .account-email {
            color: var(--text-secondary-dark);
        }

        /* Session Status Badge */
        .session-status {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            background: rgba(16, 185, 129, 0.1);
            border-radius: 8px;
            margin-bottom: 16px;
        }

        .session-status-dot {
            width: 8px;
            height: 8px;
            background: var(--success-color);
            border-radius: 50%;
            animation: pulse 2s infinite;
        }

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

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

        /* Main Chat Area */
        .chat-main {
            flex: 1;
            display: flex;
            flex-direction: column;
            position: relative;
            min-height: 100vh;
            width: 100%;
        }

        .settings-toggle {
            position: fixed;
            top: 20px;
            left: 20px;
            background: var(--panel-bg-light);
            backdrop-filter: blur(20px);
            border: 1px solid var(--panel-border-light);
            color: var(--text-secondary-light);
            cursor: pointer;
            transition: all 0.2s ease;
            padding: 12px;
            border-radius: 12px;
            opacity: 0.9;
            z-index: 999;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        body.dark-mode .settings-toggle {
            background: var(--panel-bg-dark);
            border: 1px solid var(--panel-border-dark);
            color: var(--text-secondary-dark);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        }

        .settings-toggle:hover {
            opacity: 1;
            background: var(--accent-hover);
            transform: translateY(-1px);
        }

        body.dark-mode .settings-toggle:hover {
            background: rgba(255, 255, 255, 0.15);
        }

        .hamburger-line {
            width: 20px;
            height: 2px;
            background: currentColor;
            margin: 3px 0;
            border-radius: 1px;
            transition: all 0.2s ease;
        }

        /* API Status Indicator */
        .api-status {
            position: fixed;
            top: 20px;
            right: 20px;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 16px;
            background: var(--panel-bg-light);
            backdrop-filter: blur(20px);
            border: 1px solid var(--panel-border-light);
            border-radius: 12px;
            font-size: 12px;
            z-index: 999;
            transition: all 0.3s ease;
        }

        body.dark-mode .api-status {
            background: var(--panel-bg-dark);
            border: 1px solid var(--panel-border-dark);
        }

        .api-status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            transition: background 0.3s ease;
        }

        .api-status.connected .api-status-dot {
            background: var(--success-color);
        }

        .api-status.disconnected .api-status-dot {
            background: var(--error-color);
        }

        .api-status.checking .api-status-dot {
            background: var(--warning-color);
            animation: pulse 1s infinite;
        }

        /* Welcome Content */
        #welcomeContent {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 100%;
        }
        
        .welcome-wrapper {
            width: 100%;
            max-width: 700px;
            margin: 0 auto;
            padding: 0 20px 180px 20px; /* Added bottom padding to prevent overlap with input */
        }
        
        .welcome-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            width: 100%;
            padding: 40px 20px;
            animation: fadeIn 0.8s ease-out;
        }

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

        /* Old animation styles - removed to prevent conflicts */

        .welcome-text-content {
            z-index: 2;
            position: relative;
        }

        .welcome-greeting {
            font-size: 24px;
            font-weight: 600;
            color: var(--text-primary-light);
            margin-bottom: 12px;
            margin-top: 10px;
            line-height: 1.3;
            display: block;
        }

        body.dark-mode .welcome-greeting {
            color: var(--text-primary-dark);
        }

        .welcome-subtext {
            font-size: 18px;
            color: var(--text-secondary-light);
            margin-bottom: 30px;
            line-height: 1.4;
            font-weight: 500;
        }

        body.dark-mode .welcome-subtext {
            color: var(--text-secondary-dark);
        }

        .welcome-features {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            justify-content: center;
            margin-top: 20px;
        }

        .welcome-feature {
            padding: 8px 16px;
            background: rgba(59, 130, 246, 0.1);
            border: 1px solid rgba(59, 130, 246, 0.2);
            border-radius: 20px;
            font-size: 13px;
            color: #ffffff;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        
        .welcome-feature:hover {
            background: rgba(59, 130, 246, 0.2);
            border-color: rgba(59, 130, 246, 0.4);
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(59, 130, 246, 0.2);
        }

        /* Messages Area */
        .messages-container {
            flex: 1;
            overflow-y: auto;
            padding: 80px 120px 140px 200px; /* Increased left padding to center messages */
            display: none;
            flex-direction: column;
            gap: 24px;
            scroll-behavior: smooth;
            width: 100%;
            max-width: none; /* Remove max-width constraint */
            margin: 0;
        }

        .messages-container.active {
            display: flex !important;
            align-items: flex-start;
            justify-content: flex-start;
        }

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

        .messages-container::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.05);
        }

        body.dark-mode .messages-container::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.05);
        }

        .messages-container::-webkit-scrollbar-thumb {
            background: var(--text-tertiary-light);
            border-radius: 4px;
        }

        body.dark-mode .messages-container::-webkit-scrollbar-thumb {
            background: var(--text-tertiary-dark);
        }

        /* Enhanced Floating Messages */
        .message {
            display: flex;
            position: relative;
            animation: messageFloat 0.6s ease-out;
            margin-bottom: 8px;
        }

        @keyframes messageFloat {
            from {
                opacity: 0;
                transform: translateY(30px) scale(0.9);
            }
            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        .message.user {
            justify-content: flex-end;
            margin-left: 10%; /* Reduced margin to accommodate wider bubbles */
        }

        .message.assistant {
            justify-content: flex-start;
            margin-right: 10%; /* Reduced margin to accommodate wider bubbles */
        }

        .message-bubble {
            max-width: 94%; /* Increased from 75% (25% increase) */
            min-width: 200px;
            width: fit-content;
            padding: 20px 24px;
            border-radius: 24px;
            position: relative;
            backdrop-filter: blur(25px);
            border: 1px solid transparent;
            box-shadow: 
                0 8px 32px rgba(0, 0, 0, 0.06),
                0 4px 16px rgba(0, 0, 0, 0.04),
                0 2px 8px rgba(0, 0, 0, 0.02);
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            transform: translateZ(0);
            overflow: visible; /* Ensure content isn't clipped */
        }

        body.dark-mode .message-bubble {
            box-shadow: 
                0 8px 32px rgba(0, 0, 0, 0.2),
                0 4px 16px rgba(0, 0, 0, 0.1),
                0 2px 8px rgba(0, 0, 0, 0.05);
        }

        .message-bubble:hover {
            transform: translateY(-2px) scale(1.01);
            box-shadow: 
                0 12px 40px rgba(0, 0, 0, 0.08),
                0 6px 20px rgba(0, 0, 0, 0.06),
                0 3px 12px rgba(0, 0, 0, 0.04);
        }

        body.dark-mode .message-bubble:hover {
            box-shadow: 
                0 12px 40px rgba(0, 0, 0, 0.3),
                0 6px 20px rgba(0, 0, 0, 0.15),
                0 3px 12px rgba(0, 0, 0, 0.08);
        }

        .message.user .message-bubble {
            background: linear-gradient(135deg, 
                rgba(59, 130, 246, 0.1) 0%, 
                rgba(99, 102, 241, 0.15) 100%);
            border: 1px solid rgba(59, 130, 246, 0.2);
            color: var(--text-primary-light);
            border-bottom-right-radius: 8px;
        }

        body.dark-mode .message.user .message-bubble {
            background: linear-gradient(135deg, 
                rgba(59, 130, 246, 0.15) 0%, 
                rgba(99, 102, 241, 0.2) 100%);
            border: 1px solid rgba(59, 130, 246, 0.25);
            color: var(--text-primary-dark);
        }

        .message.assistant .message-bubble {
            background: linear-gradient(135deg, 
                rgba(255, 255, 255, 0.9) 0%, 
                rgba(248, 250, 252, 0.95) 100%);
            border: 1px solid rgba(226, 232, 240, 0.4);
            color: var(--text-primary-light);
            border-bottom-left-radius: 8px;
        }

        body.dark-mode .message.assistant .message-bubble {
            background: linear-gradient(135deg, 
                rgba(30, 41, 59, 0.9) 0%, 
                rgba(51, 65, 85, 0.95) 100%);
            border: 1px solid rgba(71, 85, 105, 0.4);
            color: var(--text-primary-dark);
        }

        .message-header {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 12px;
            padding-bottom: 10px;
            border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        }

        body.dark-mode .message-header {
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        }

        .message-logo {
            width: 20px;
            height: 20px;
            object-fit: contain;
        }

        .message-sender-name {
            font-size: 14px;
            font-weight: 600;
            opacity: 0.9;
            color: var(--text-secondary-light);
        }

        body.dark-mode .message-sender-name {
            color: var(--text-secondary-dark);
        }

        .message.user .message-header {
            justify-content: flex-end;
        }

        .message.user .message-sender-name {
            color: #3b82f6;
        }

        body.dark-mode .message.user .message-sender-name {
            color: #60a5fa;
        }

        .message-content {
            line-height: 1.7;
            font-size: 16px;
            word-wrap: break-word;
            word-break: break-word;
            overflow-wrap: break-word;
            white-space: pre-wrap;
            max-width: 100%;
        }

        .message-content h3, .message-content h4 {
            margin-top: 16px;
            margin-bottom: 8px;
        }

        .message-content ul, .message-content ol {
            margin-left: 20px;
            margin-top: 8px;
            margin-bottom: 8px;
        }

        .message-content strong {
            font-weight: 600;
        }

        .message-content p {
            margin: 0.5em 0;
            word-wrap: break-word;
        }

        .message-content code {
            background: rgba(0, 0, 0, 0.05);
            padding: 2px 6px;
            border-radius: 4px;
            font-family: 'Consolas', 'Monaco', monospace;
            font-size: 14px;
            word-break: break-all;
        }

        body.dark-mode .message-content code {
            background: rgba(255, 255, 255, 0.1);
        }

        .message-content pre {
            background: rgba(0, 0, 0, 0.05);
            padding: 12px;
            border-radius: 8px;
            overflow-x: auto;
            max-width: 100%;
        }

        body.dark-mode .message-content pre {
            background: rgba(255, 255, 255, 0.05);
        }

        .message-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-top: 12px;
            padding-top: 8px;
            border-top: 1px solid rgba(0, 0, 0, 0.05);
        }

        body.dark-mode .message-footer {
            border-top: 1px solid rgba(255, 255, 255, 0.05);
        }

        .message-time {
            font-size: 11px;
            opacity: 0.6;
            color: var(--text-tertiary-light);
        }

        body.dark-mode .message-time {
            color: var(--text-tertiary-dark);
        }

        .message-actions {
            display: flex;
            gap: 8px;
            align-items: center;
        }

        .action-btn {
            background: rgba(0, 0, 0, 0.03);
            border: 1px solid rgba(0, 0, 0, 0.08);
            color: var(--text-tertiary-light);
            cursor: pointer;
            padding: 6px 8px;
            border-radius: 8px;
            transition: all 0.2s ease;
            font-size: 12px;
            opacity: 0.7;
        }

        body.dark-mode .action-btn {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: var(--text-tertiary-dark);
        }

        .action-btn:hover {
            opacity: 1;
            background: rgba(0, 0, 0, 0.08);
            transform: scale(1.05);
        }

        body.dark-mode .action-btn:hover {
            background: rgba(255, 255, 255, 0.12);
        }

        .action-btn.liked {
            color: var(--success-color);
            background: rgba(16, 185, 129, 0.1);
            opacity: 1;
        }

        .action-btn.disliked {
            color: var(--error-color);
            background: rgba(239, 68, 68, 0.1);
            opacity: 1;
        }

        .action-btn.copied {
            color: var(--success-color);
            background: rgba(16, 185, 129, 0.1);
            opacity: 1;
        }
        
        .simplified-badge {
            display: inline-block;
            padding: 4px 10px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border-radius: 12px;
            font-size: 12px;
            font-weight: 600;
            margin-bottom: 12px;
        }
        
        @keyframes spin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }
        
        .spin {
            animation: spin 1s linear infinite;
        }

        /* Thinking Indicator with Custom Animation */
        .thinking-indicator {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 8px 0;
            min-width: 200px;
            width: fit-content;
        }
        
        .message.assistant .thinking-indicator {
            justify-content: flex-start;
        }
        
        .message.assistant .message-bubble {
            width: fit-content;
            min-width: 250px;
        }

        .thinking-indicator lottie-player {
            flex-shrink: 0;
        }

        .thinking-text {
            font-size: 15px;
            color: var(--text-secondary-light);
            font-weight: 500;
            white-space: nowrap;
        }

        body.dark-mode .thinking-text {
            color: var(--text-secondary-dark);
        }

        /* Logo Styles */
        .logo-image {
            width: 40px;
            height: 40px;
            object-fit: contain;
        }

        .welcome-logo {
            width: 200px;
            height: 200px;
            object-fit: contain;
            margin-bottom: 30px;
            animation: fadeIn 0.8s ease-out;
        }
        
        .welcome-animation-container {
            display: flex;
            justify-content: center;
            align-items: center;
            margin-bottom: 0;
            position: relative;
        }
        
        .welcome-animation {
            animation: fadeIn 0.8s ease-out;
            position: relative !important;
            top: auto !important;
            left: auto !important;
            transform: none !important;
        }
        
        .welcome-name-logo {
            width: 250px;
            height: auto;
            object-fit: contain;
            margin-top: -25px; /* Tight spacing to animation above */
            margin-bottom: 20px;
            animation: fadeIn 0.8s ease-out;
        }

        .sidebar .account-avatar {
            background: transparent;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .sidebar .account-avatar img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .logo-light, .logo-dark {
            transition: opacity 0.3s ease;
        }

        /* Hide/show logos based on theme */
        body:not(.dark-mode) .logo-dark {
            display: none !important;
        }

        body.dark-mode .logo-light {
            display: none !important;
        }

        body.dark-mode .logo-dark {
            display: block !important;
        }

        /* Input Area */
        .input-container {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            padding: 20px 20px 40px 20px;
            background: transparent;
            transition: all 0.3s ease;
        }

        .input-wrapper {
            display: flex;
            gap: 12px;
            align-items: flex-end;
            max-width: 700px;
            margin: 0 auto;
            background: rgba(255, 255, 255, 0.95);
            border-radius: 30px;
            padding: 8px 8px 8px 20px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
            backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        body.dark-mode .input-wrapper {
            background: rgba(30, 41, 59, 0.95);
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
        }

        .message-input {
            flex: 1;
            background: transparent;
            border: none;
            outline: none;
            padding: 12px 0;
            color: var(--text-primary-light);
            resize: none;
            max-height: 120px;
            font-family: inherit;
            line-height: 1.4;
            font-size: 16px;
        }

        body.dark-mode .message-input {
            color: var(--text-primary-dark);
        }

        .message-input::placeholder {
            color: var(--text-tertiary-light);
            font-weight: 400;
        }

        body.dark-mode .message-input::placeholder {
            color: var(--text-tertiary-dark);
        }

        .send-button {
            background: linear-gradient(135deg, #FFA922, #FF8C00);
            border: none;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
            box-shadow: 0 4px 12px rgba(255, 169, 34, 0.3);
            flex-shrink: 0;
        }

        .send-button:hover:not(:disabled) {
            transform: translateY(-1px);
            box-shadow: 0 6px 16px rgba(255, 169, 34, 0.4);
        }

        .send-button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .send-button svg {
            width: 18px;
            height: 18px;
            color: white;
        }

        /* Toast Notifications */
        .toast {
            position: fixed;
            bottom: 140px;
            right: 20px;
            background: var(--panel-bg-light);
            border: 1px solid var(--panel-border-light);
            border-radius: 12px;
            padding: 12px 20px;
            backdrop-filter: blur(25px);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
            z-index: 10000;
            transform: translateY(100px);
            opacity: 0;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 8px;
            color: var(--text-primary-light);
            font-size: 14px;
            font-weight: 500;
        }

        body.dark-mode .toast {
            background: var(--panel-bg-dark);
            border: 1px solid var(--panel-border-dark);
            color: var(--text-primary-dark);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
        }

        .toast.show {
            transform: translateY(0);
            opacity: 1;
        }

        .toast.success {
            border-left: 4px solid var(--success-color);
        }

        .toast.error {
            border-left: 4px solid var(--error-color);
        }

        .toast.warning {
            border-left: 4px solid var(--warning-color);
        }

        /* Mobile Responsiveness */
        @media (max-width: 768px) {
            .sidebar {
                width: 280px;
            }

            .api-status {
                top: 60px;
                right: 10px;
                padding: 6px 12px;
                font-size: 11px;
            }

            .welcome-content {
                padding: 20px;
                padding-bottom: 100px; /* Extra padding on mobile to avoid input overlap */
            }

            .welcome-animation {
                top: -60px;
            }

            .welcome-animation lottie-player {
                width: 140px !important;
                height: 140px !important;
            }

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

            .welcome-subtext {
                font-size: 16px;
                margin-bottom: 20px;
            }

            .messages-container {
                padding: 80px 20px 140px 50px; /* Some left padding even on mobile */
            }

            .message.user {
                margin-left: 20px;
            }

            .message.assistant {
                margin-right: 20px;
            }

            .message-bubble {
                max-width: 95%; /* Increased for mobile */
                min-width: 150px;
                padding: 16px 20px;
            }

            .input-container {
                padding: 15px;
            }

            .input-wrapper {
                max-width: 100%;
            }

            .message-input {

/* Additional fixes for welcome screen and message positioning */
#welcomeContent[style*="display: none"] {
    display: none !important;
}

.messages-container.active {
    display: flex !important;
}

.message.user {
    justify-content: flex-end !important;
}

.message.assistant {
    justify-content: flex-start !important;
}

.message.assistant .thinking-indicator {
    width: auto;
}

/* Responsive improvements for larger screens */
@media (min-width: 1200px) {
    .messages-container {
        padding: 80px 100px 140px 180px; /* Increased left padding for centering */
    }
    
    .message-bubble {
        max-width: 81%; /* Increased from 65% (25% increase) */
    }
    
    .message.user {
        margin-left: 15%; /* Adjusted for wider bubbles */
    }
    
    .message.assistant {
        margin-right: 15%; /* Adjusted for wider bubbles */
    }
}

@media (min-width: 1600px) {
    .messages-container {
        padding: 80px 150px 140px 250px; /* More left padding for wider screens */
    }
    
    .message-bubble {
        max-width: 75%; /* Increased from 60% (25% increase) */
    }
    
    .message.user {
        margin-left: 20%; /* Adjusted for wider bubbles */
    }
    
    .message.assistant {
        margin-right: 20%; /* Adjusted for wider bubbles */
    }
}

/* Version Labels */
.sidebar-version {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 11px;
    color: rgba(107, 114, 128, 0.6);
    letter-spacing: 0.5px;
    padding: 8px;
}

body.dark-mode .sidebar-version {
    color: rgba(156, 163, 175, 0.6);
}
