        /* 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 */
            /* Note: Background gradients are applied directly to body element with animations */
            --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 */
            /* Note: Background gradients are applied directly to body element with animations */
            --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;

            /* Simple white background for LIGHT mode */
            background: white;
        }

        /* Light mode specific backgrounds */
        body:not(.dark-mode) .container,
        body:not(.dark-mode) .main-content,
        body:not(.dark-mode) .chat-container,
        body:not(.dark-mode) .input-container {
            background: white;
        }

        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%;
            background: transparent; /* Ensure gradient shows through */
        }

        /* 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%;
            background: transparent; /* Ensure gradient shows through */
        }

        .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: none;  /* Remove max-width to allow full screen */
            padding: 0 0 160px 0; /* Remove horizontal padding */
        }
        
        .welcome-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            width: 100%;
            padding: 30px 16px;
            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: 18px;
            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: 20px;
            line-height: 1.4;
            font-weight: 500;
        }

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

        /* Questions Banner Wrapper */
        .questions-banner-wrapper {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin: 20px 0;
            width: 100vw;  /* Full viewport width */
            position: relative;
            left: 50%;
            right: 50%;
            margin-left: -50vw;
            margin-right: -50vw;
        }
        
        /* Questions Banner Container */
        .questions-banner-container {
            width: 100%;
            height: 3.5rem;
            position: relative;
            overflow: hidden;
            white-space: nowrap;
        }

        .questions-scroll {
            display: flex;
            justify-content: space-around;
            width: fit-content;
            position: absolute;
            top: 0;
            height: 100%;
            align-items: center;
        }
        
        /* Single banner animations */
        #questions-scroll-one {
            animation: loop-immediate 600s linear infinite;
        }

        #questions-scroll-two {
            animation: loop 600s linear infinite;
            animation-delay: 300s;
            opacity: 0;
            animation-fill-mode: both;
        }

        .question-item {
            padding: 0.9rem 1.6rem;
            margin: 0.3rem 0.6rem;
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
            border: 1px solid rgba(102, 126, 234, 0.2);
            color: #e2e8f0;
            border-radius: 24px;
            font-size: 1rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            white-space: nowrap;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        body:not(.dark-mode) .question-item {
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
            border-color: rgba(102, 126, 234, 0.3);
            color: #334155;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        }

        .question-item:hover {
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
            border-color: rgba(102, 126, 234, 0.4);
            transform: scale(1.05);
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
        }


        .questions-banner-fade {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            background: linear-gradient(90deg, 
                rgba(17, 24, 39, 1) 0%, 
                transparent 10%, 
                transparent 90%, 
                rgba(17, 24, 39, 1) 100%);
            z-index: 1;
        }

        body:not(.dark-mode) .questions-banner-fade {
            background: linear-gradient(90deg, 
                rgba(249, 250, 251, 1) 0%, 
                transparent 10%, 
                transparent 90%, 
                rgba(249, 250, 251, 1) 100%);
        }

        @keyframes loop {
            0% { 
                transform: translateX(100%);
                opacity: 1;
            }
            100% { 
                transform: translateX(-100%);
                opacity: 1;
            }
        }
        
        @keyframes loop-immediate {
            0% { 
                transform: translateX(0%);
            }
            100% { 
                transform: translateX(-200%);
            }
        }

        /* Messages Area */
        .messages-container {
            flex: 1;
            overflow-y: auto;
            padding: 80px 20px 140px 20px; /* Even padding for proper centering */
            display: none;
            flex-direction: column;
            gap: 24px;
            scroll-behavior: smooth;
            width: 100%;
            max-width: none; /* Remove max-width constraint */
            margin: 0;
            background: transparent; /* Ensure gradient shows through */
        }

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

        .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;
            width: 100%;
            max-width: 900px;
        }

        @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;
            width: 150px;
            height: 150px;
            margin-left: auto;
            margin-right: auto;
        }
        
        .welcome-animation {
            animation: fadeIn 0.8s ease-out;
            position: relative !important;
            top: auto !important;
            left: auto !important;
            transform: none !important;
        }
        
        .welcome-name-logo {
            width: 130px;
            height: auto;
            object-fit: contain;
            margin-top: -15px; /* Tight spacing to animation above */
            margin-bottom: 15px;
            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;
        }

        /* Education Level Toggle */
        .education-toggle-container {
            display: flex;
            align-items: center;
            gap: 10px;
            width: 100%;
            max-width: 700px;
            margin-bottom: 15px;
            padding: 0;
            justify-content: flex-start;
            position: relative;
            z-index: 10;
        }
        
        .toggle-switch {
            position: relative;
            width: 44px;
            height: 24px;
            cursor: pointer;
        }
        
        .toggle-track {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: #808080;
            border-radius: 12px;
            transition: background 0.3s ease;
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
        }
        
        .toggle-thumb {
            position: absolute;
            top: 2px;
            left: 2px;
            width: 20px;
            height: 20px;
            background: white;
            border-radius: 50%;
            transition: transform 0.3s ease;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        }
        
        .toggle-switch.active .toggle-track {
            background: #606060;
        }
        
        .toggle-switch.active .toggle-thumb {
            transform: translateX(20px);
        }
        
        body.dark-mode .toggle-track {
            background: #606060;
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
        }
        
        body.dark-mode .toggle-switch.active .toggle-track {
            background: #606060;
        }
        
        .toggle-label {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary-light);
            user-select: none;
            transition: opacity 0.3s ease;
        }
        
        body.dark-mode .toggle-label {
            color: var(--text-primary-dark);
        }

        /* Input Area */
        .input-container {
            position: fixed;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 100%;
            max-width: 740px; /* Slightly larger to account for padding */
            padding: 20px;
            padding-bottom: 40px;
            background: transparent;
            transition: all 0.3s ease;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        .input-wrapper {
            display: flex;
            gap: 12px;
            align-items: flex-end;
            width: 100%;
            max-width: 700px;
            margin: 0;
            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);
            position: relative;
        }

        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: 16px;
                padding-bottom: 80px; /* Extra padding on mobile to avoid input overlap */
            }

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

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

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

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

            /* Mobile Infinite Scrolling Banner */
            .questions-banner-container {
                height: 3rem;
                max-width: 100%;
                margin: 15px auto;
            }

            .question-item {
                padding: 0.7rem 1rem;
                font-size: 0.85rem;
                margin: 0.25rem 0.4rem;
            }

            .messages-container {
                padding: 80px 20px 140px 20px; /* Even padding 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;
                padding-bottom: 30px;
                max-width: 100%;
            }
            
            .education-toggle-container {
                width: 100%;
                max-width: none;
                padding: 0;
            }

            .input-wrapper {
                width: 100%;
                max-width: none;
                border-radius: 25px;
            }

            .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 40px 140px 40px; /* Even 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 */
    }
    
    .input-container {
        padding: 30px;
        padding-bottom: 50px;
        max-width: 740px;
    }
}

@media (min-width: 1600px) {
    .messages-container {
        padding: 80px 60px 140px 60px; /* Even 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 */
    }
    
    .input-container {
        padding: 40px;
        padding-bottom: 60px;
        max-width: 740px;
    }
}


/* Category headers */
.category-header {
    cursor: pointer;
    padding: 8px;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 4px;
    transition: background 0.2s;
}

.category-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.category-questions {
    padding: 8px;
    margin-bottom: 10px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    margin-top: 8px;
}

body.dark-mode .category-questions {
    background: rgba(0, 0, 0, 0.2);
}

/* Suggested questions */
.suggested-question {
    padding: 10px 12px;
    margin: 6px 0;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    display: block;
    position: relative;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggested-question:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: translateX(3px);
    border-color: rgba(255, 255, 255, 0.2);
}

.suggested-question::before {
    content: "→";
    position: absolute;
    left: 10px;
    opacity: 0;
    transition: opacity 0.2s, left 0.2s;
}

.suggested-question:hover::before {
    opacity: 1;
    left: 6px;
}

.suggested-question:hover {
    padding-left: 24px;
}

/* 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);
}

/* Spinner Animation for Loading State */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Loading state for play button */
.action-btn .animate-spin {
    display: inline-block;
    width: 16px;
    height: 16px;
}

/* Ensure loading spinner is visible */
.action-btn.loading svg {
    animation: spin 1s linear infinite;
    color: #007bff;
}

/* Make loading spinner more prominent */
.action-btn.loading {
    opacity: 1;
    background-color: rgba(0, 123, 255, 0.1);
}

.action-btn.loading:hover {
    background-color: rgba(0, 123, 255, 0.15);
}

/* Dark mode loading state */
body.dark-mode .action-btn.loading {
    background-color: rgba(59, 130, 246, 0.15);
}

body.dark-mode .action-btn.loading svg {
    color: #3b82f6;
}
