 :root {
            /* Educap Brand Colors */
            --educap-purple-dark: #2D1B4E;
            --educap-purple-medium: #3D2A5C;
            --educap-purple-light: #4A3B6B;
            --educap-purple-ultra-light: #E8E3F0;
            --educap-gold: #F5C842;
            --educap-gold-light: #F9D871;
            --educap-gold-dark: #E6B830;
            
            /* Main Gradients - Dark Theme */
            --gradient-primary: linear-gradient(135deg, #1A1625 0%, #2D1B4E 50%, #3D2A5C 100%);
            --gradient-gold: linear-gradient(135deg, #F5C842 0%, #F9D871 100%);
            --gradient-purple-light: linear-gradient(120deg, #2D1B4E 0%, #3D2A5C 100%);
            --gradient-surface: linear-gradient(180deg, #0F0F1A 0%, #1A1625 100%);
            --gradient-accent: linear-gradient(45deg, #4A3B6B 0%, #F5C842 100%);
            
            /* Dark Theme Colors */
            --gray-50: #0F0F1A;
            --gray-100: #1A1625;
            --gray-200: #2D1B4E;
            --gray-300: #3D2A5C;
            --gray-400: #6B7280;
            --gray-500: #9CA3AF;
            --gray-600: #D1D5DB;
            --gray-700: #E4E7EB;
            --gray-800: #F4F6F8;
            --gray-900: #FAFBFC;
            
            --surface-primary: #1A1625;
            --surface-secondary: #0F0F1A;
            --surface-accent: #2D1B4E;
            --text-primary: #F4F6F8;
            --text-secondary: #D1D5DB;
            --text-muted: #9CA3AF;
            
            /* Shadows - Dark Theme */
            --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
            --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
            --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
            --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
            --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
            
            --radius-sm: 6px;
            --radius-md: 12px;
            --radius-lg: 16px;
            --radius-xl: 24px;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
        }

        body {
            font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
            background: var(--gradient-surface);
            color: var(--text-primary);
            display: flex;
            height: 100vh;
            overflow: hidden;
            line-height: 1.6;
        }

        /* Sidebar */
        .sidebar {
            width: 300px;
            background: var(--surface-primary);
            border-right: 1px solid var(--gray-200);
            display: flex;
            flex-direction: column;
            position: relative;
            box-shadow: var(--shadow-sm);
        }

        .sidebar-header {
            padding: 24px;
            background: var(--gradient-primary);
            color: white;
            position: relative;
            overflow: hidden;
        }

        .sidebar-header::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>') repeat;
            z-index: 0;
        }

        .logo {
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: 'Space Grotesk', sans-serif;
            font-size: 22px;
            font-weight: 700;
            position: relative;
            z-index: 1;
            cursor: pointer;
            transition: all 0.2s ease;
            border-radius: var(--radius-md);
            padding: 8px;
        }

        .logo:hover {
            transform: scale(1.05);
            background: rgba(255, 255, 255, 0.1);
        }

        .logo-image {
            height: 32px;
            width: auto;
            filter: brightness(0) invert(1);
            transition: filter 0.3s ease;
        }

        .new-chat-btn {
            margin: 20px 20px 10px;
            padding: 14px 18px;
            background: var(--gradient-gold);
            border: 2px solid var(--educap-gold-dark);
            border-radius: var(--radius-lg);
            display: flex;
            align-items: center;
            gap: 12px;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            font-family: 'Poppins', sans-serif;
            font-size: 14px;
            font-weight: 600;
            color: var(--educap-purple-dark);
            position: sticky;
            top: 0;
            z-index: 10;
            overflow: hidden;
            box-shadow: 0 8px 20px rgba(245, 200, 66, 0.4);
        }

        .new-chat-btn::before {
            content: '';
            position: absolute;
            inset: 0;
            background: var(--gradient-accent);
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .new-chat-btn:hover {
            border-color: var(--educap-gold);
            transform: translateY(-2px);
            box-shadow: 0 12px 28px rgba(245, 200, 66, 0.6);
            background: var(--gradient-gold);
            color: var(--educap-purple-dark);
        }

        .new-chat-btn:hover::before {
            opacity: 0;
        }

        .new-chat-btn span, .new-chat-btn i {
            position: relative;
            z-index: 1;
        }

        .chat-list {
            flex: 1;
            overflow-y: auto;
            padding: 10px 20px 20px;
        }

        .chat-item {
            padding: 12px 16px;
            margin-bottom: 6px;
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            gap: 12px;
            position: relative;
            font-size: 14px;
            color: var(--text-secondary);
        }

        .chat-item:hover {
            background: var(--surface-accent);
            color: var(--text-primary);
            transform: translateX(4px);
        }

        .chat-item.active {
            background: var(--gradient-primary);
            color: white;
            box-shadow: var(--shadow-sm);
        }

        .chat-item .title {
            flex: 1;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            font-weight: 500;
        }

        .delete-btn {
            opacity: 0;
            transition: opacity 0.2s ease;
            background: none;
            border: none;
            color: inherit;
            cursor: pointer;
            padding: 4px 6px;
            border-radius: var(--radius-sm);
            font-size: 12px;
        }

        .delete-btn:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        .chat-item:hover .delete-btn {
            opacity: 1;
        }

        /* Main Content Area */
        .main-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            background: var(--gradient-surface);
            position: relative;
            max-width: 900px;
            margin: 0 auto;
            box-shadow: var(--shadow-sm);
            height: 100vh;
            overflow: hidden;
        }

        .chat-header {
            padding: 20px 30px;
            background: var(--surface-primary);
            border-bottom: 1px solid var(--gray-200);
            display: flex;
            align-items: center;
            justify-content: space-between;
            box-shadow: var(--shadow-xs);
        }

        .chat-title {
            font-family: 'Space Grotesk', sans-serif;
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary);
            background: var(--gradient-accent);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            display: flex;
            align-items: center;
            gap: 12px;
            cursor: pointer;
            transition: all 0.2s ease;
            border-radius: var(--radius-md);
            padding: 8px;
        }

        .chat-title:hover {
            transform: scale(1.05);
            background: var(--gray-100);
        }

        .chat-title-logo {
            height: 24px;
            width: auto;
        }

        .close-btn {
            background: none;
            border: none;
            font-size: 18px;
            color: var(--text-muted);
            cursor: pointer;
            padding: 8px;
            border-radius: var(--radius-sm);
            transition: all 0.2s ease;
        }

        .close-btn:hover {
            background: var(--gray-100);
            color: var(--educap-purple-medium);
            transform: scale(1.1);
        }

        /* Welcome Screen */
        .welcome-screen {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 40px 30px 20px;
            text-align: center;
            overflow-y: auto;
            min-height: 0;
        }

        .welcome-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            max-width: 500px;
            width: 100%;
        }

        .bot-avatar {
            width: 80px;
            height: 80px;
            background: var(--gradient-purple-light);
            border-radius: 50%;
            margin-bottom: 20px;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: var(--shadow-lg);
            border: 3px solid var(--surface-primary);
        }

        .bot-avatar::before {
            content: '';
            position: absolute;
            inset: -6px;
            border-radius: 50%;
            background: var(--gradient-accent);
            z-index: -1;
            opacity: 0.15;
        }

        .bot-eyes {
            display: flex;
            gap: 12px;
        }

        .eye {
            width: 14px;
            height: 10px;
            background: var(--educap-purple-dark);
            border-radius: 8px;
            position: relative;
        }

        .eye::after {
            content: '';
            position: absolute;
            top: 2px;
            right: 2px;
            width: 4px;
            height: 4px;
            background: var(--educap-gold);
            border-radius: 50%;
        }

        .welcome-title {
            font-family: 'Space Grotesk', sans-serif;
            font-size: 22px;
            font-weight: 300;
            color: var(--text-secondary);
            margin-bottom: 6px;
        }

        .welcome-subtitle {
            font-family: 'Space Grotesk', sans-serif;
            font-size: 32px;
            font-weight: 700;
            background: var(--gradient-accent);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-bottom: 12px;
            line-height: 1.2;
        }

        .welcome-description {
            font-size: 15px;
            color: var(--text-muted);
            margin-bottom: 30px;
            max-width: 480px;
            font-weight: 400;
        }

        /* ========================================
           ACTION CARDS - 2x2 GRID (FIXED)
           ======================================== */
        .action-cards {
            display: grid;
            grid-template-columns: repeat(2, 1fr) !important;
            grid-template-rows: repeat(2, auto);
            gap: 12px;
            margin-bottom: 25px;
            width: 100%;
            max-width: 320px;
            padding: 0 10px;
        }

        .action-card {
            background: var(--surface-primary);
            border: 1px solid var(--gray-200);
            border-radius: var(--radius-md);
            padding: 16px 12px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: var(--shadow-sm);
            position: relative;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-height: 90px;
            max-height: 120px;
            aspect-ratio: unset !important;
        }

        .action-card::before {
            content: '';
            position: absolute;
            inset: 0;
            background: var(--gradient-accent);
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .action-card:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
            border-color: var(--educap-purple-medium);
        }

        .action-card:hover::before {
            opacity: 0.08;
        }

        .action-card:active {
            transform: scale(0.97);
        }

        .action-card .icon {
            font-size: 24px;
            margin-bottom: 6px;
            display: block;
            position: relative;
            z-index: 1;
            transition: transform 0.3s ease;
        }

        .action-card:hover .icon {
            transform: scale(1.1);
        }

        .action-card .title {
            font-family: 'Space Grotesk', sans-serif;
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 2px;
            position: relative;
            z-index: 1;
        }

        .action-card .subtitle {
            font-size: 11px;
            color: var(--text-muted);
            font-weight: 400;
            position: relative;
            z-index: 1;
        }

        /* ========================================
           TABLET (768px - 1024px)
           ======================================== */
        @media (max-width: 1024px) {
            .action-cards {
                max-width: 300px;
                gap: 10px;
            }

            .action-card {
                padding: 14px 10px;
                min-height: 85px;
            }

            .action-card .icon {
                font-size: 22px;
            }

            .action-card .title {
                font-size: 13px;
            }

            .action-card .subtitle {
                font-size: 10px;
            }
        }

        /* ========================================
           MOBILE (max-width: 768px) - FIXED!
           ======================================== */
        @media (max-width: 768px) {
            .action-cards {
                display: grid !important;
                grid-template-columns: repeat(2, 1fr) !important;
                grid-template-rows: repeat(2, auto) !important;
                gap: 10px !important;
                max-width: 280px;
                margin: 0 auto 20px auto;
                padding: 0;
            }

            .action-card {
                padding: 14px 10px;
                min-height: 80px !important;
                max-height: 100px !important;
                aspect-ratio: unset !important;
                border-radius: 12px;
            }

            .action-card .icon {
                font-size: 20px;
                margin-bottom: 5px;
            }

            .action-card .title {
                font-size: 12px;
                margin-bottom: 1px;
            }

            .action-card .subtitle {
                font-size: 9px;
            }

            .action-card:hover {
                transform: none;
            }

            .action-card:active {
                transform: scale(0.95);
                box-shadow: var(--shadow-md);
            }

            /* 🔧 User Message Mobile Fix */
            .message.user {
                display: flex !important;
                justify-content: flex-end !important;
                margin-bottom: 12px !important;
            }
            
            .message.user .message-content {
                max-width: 85% !important;
            }
            
            .message.user .message-bubble {
                background: linear-gradient(135deg, #4A3B6B 0%, #F5C842 100%) !important;
                color: white !important;
                padding: 10px 14px !important;
                border-radius: 16px 16px 4px 16px !important;
                display: inline-block !important;
                width: auto !important;
                max-width: 100% !important;
            }
            
            .message.user .message-text {
                font-size: 13px !important;
                line-height: 1.4 !important;
            }
        }

        /* ========================================
           SMALL MOBILE (max-width: 480px)
           ======================================== */
        @media (max-width: 480px) {
            .action-cards {
                display: grid !important;
                grid-template-columns: repeat(2, 1fr) !important;
                gap: 8px !important;
                max-width: 240px;
                margin-bottom: 15px;
            }

            .action-card {
                padding: 12px 8px;
                min-height: 70px !important;
                max-height: 90px !important;
                border-radius: 10px;
            }

            .action-card .icon {
                font-size: 18px;
                margin-bottom: 4px;
            }

            .action-card .title {
                font-size: 11px;
            }

            .action-card .subtitle {
                font-size: 8px;
            }
        }

        /* ========================================
           EXTRA SMALL (max-width: 360px)
           ======================================== */
        @media (max-width: 360px) {
            .action-cards {
                max-width: 220px;
                gap: 6px;
            }

            .action-card {
                padding: 10px 6px;
                min-height: 65px !important;
                max-height: 80px !important;
            }

            .action-card .icon {
                font-size: 16px;
                margin-bottom: 3px;
            }

            .action-card .title {
                font-size: 10px;
            }

            .action-card .subtitle {
                font-size: 7px;
            }
        }

        /* ========================================
           TOUCH DEVICES
           ======================================== */
        @media (hover: none) and (pointer: coarse) {
            .action-card:hover {
                transform: none;
                box-shadow: var(--shadow-sm);
            }

            .action-card:hover::before {
                opacity: 0;
            }

            .action-card:hover .icon {
                transform: none;
            }

            .action-card:active {
                transform: scale(0.95);
                box-shadow: var(--shadow-md);
                border-color: var(--educap-purple-medium);
            }

            .action-card:active::before {
                opacity: 0.1;
            }
        }

        /* Chat Messages */
        .chat-container {
            flex: 1;
            overflow-y: auto;
            padding: 20px 60px;
            display: none;
            max-width: 700px;
            margin: 0 auto;
            width: 100%;
            min-height: 0;
        }

        .message {
            margin-bottom: 20px;
            display: flex;
            gap: 12px;
            animation: slideInMessage 0.4s ease-out;
        }

        @keyframes slideInMessage {
            from {
                opacity: 0;
                transform: translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

/* ========================================
   USER MESSAGE BUBBLES - SIMPLE FIX
   ======================================== */
.message.user {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.message.user .message-content {
    max-width: 80%;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #4A3B6B 0%, #F5C842 100%);
    color: white;
    padding: 12px 18px;
    border-radius: 18px 18px 4px 18px;
    display: inline-block;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message.user .message-text {
    font-size: 14px;
    line-height: 1.5;
}

        .message.bot {
            justify-content: flex-start;
            align-items: flex-start;
        }

      .assistant-icon {
   width: 48px;
    height: 48px;
    margin-top: 4px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

        /* 🔧 ENHANCED: dotLottie player styling */
        .assistant-icon dotlottie-wc {
            width: 100% !important;
            height: 100% !important;
        }

        .message-content {
            max-width: 75%;
        }

        .message-bubble {
            padding: 16px 20px;
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-sm);
            position: relative;
        }

        .message.bot .message-bubble {
            background: var(--surface-primary);
            border: 1px solid var(--gray-200);
        }

        .message-text {
            font-size: 14px;
            line-height: 1.6;
            font-weight: 400;
            word-wrap: break-word;
        }

        /* 🔧 ENHANCED: Better formatting for bold, italic, and lists */
        .message-text p {
            margin: 0 0 12px 0;
            line-height: 1.6;
        }

        .message-text p:last-child {
            margin-bottom: 0;
        }

        .message-text ul {
            margin: 12px 0;
            padding-left: 0;
            list-style: none;
        }

        .message-text li {
            margin-bottom: 8px;
            padding-left: 20px;
            position: relative;
            line-height: 1.5;
        }

        .message-text li::before {
            content: "•";
            color: var(--educap-purple-medium);
            font-weight: bold;
            position: absolute;
            left: 0;
            top: 0;
        }

        /* 🔧 ENHANCED: Bold text styling */
        .message-text strong {
            font-weight: 700;
            color: var(--educap-gold);
            background: linear-gradient(135deg, var(--educap-gold) 0%, var(--educap-gold-light) 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        /* 🔧 ENHANCED: Italic text styling */
        .message-text em {
            font-style: italic;
            color: var(--educap-gold-light);
            font-weight: 500;
            position: relative;
        }

        .message-text em::after {
            content: '';
            position: absolute;
            bottom: -1px;
            left: 0;
            right: 0;
            height: 1px;
            background: linear-gradient(90deg, transparent 0%, var(--educap-gold-light) 50%, transparent 100%);
            opacity: 0.3;
        }

        .message-text ul + p,
        .message-text p + ul {
            margin-top: 16px;
        }

        .message-text h3, .message-text h4 {
            color: var(--educap-gold);
            margin: 16px 0 8px 0;
            font-weight: 600;
        }

        .typing-indicator {
            display: flex;
            gap: 4px;
            padding: 6px 0;
            align-items: center;
        }

        .typing-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--educap-purple-medium);
            animation: typing 1.6s 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%, 80%, 100% { 
                transform: scale(0.9); 
                opacity: 0.6; 
            }
            40% { 
                transform: scale(1.1); 
                opacity: 1; 
            }
        }

        /* Input Area */
        .input-container {
            padding: 20px 60px 30px;
            background: var(--surface-primary);
            border-top: 1px solid var(--gray-200);
            max-width: 700px;
            margin: 0 auto;
            width: 100%;
            position: relative;
            z-index: 10;
        }

        .input-wrapper {
            position: relative;
        }

        .message-input {
            width: 100%;
            border: 2px solid var(--gray-200);
            border-radius: var(--radius-xl);
            padding: 16px 60px 16px 24px;
            font-family: 'Poppins', sans-serif;
            font-size: 14px;
            font-weight: 400;
            resize: none;
            outline: none;
            background: var(--surface-primary);
            box-shadow: var(--shadow-sm);
            transition: all 0.3s ease;
            min-height: 56px;
            max-height: 120px;
            line-height: 1.5;
            color: var(--text-primary);
        }

        /* ========================================
           FIX: Hide scrollbar in message input completely
           ======================================== */
        .message-input {
            overflow-y: auto;
            overflow-x: hidden;
            -ms-overflow-style: none;
        }

        .message-input::-webkit-scrollbar {
            width: 0px;
            height: 0px;
            display: none;
            background: transparent;
        }

        .message-input::-webkit-scrollbar-track {
            background: transparent;
            display: none;
        }

        .message-input::-webkit-scrollbar-thumb {
            background: transparent;
            display: none;
        }

        .message-input::-webkit-scrollbar-thumb:hover {
            background: transparent;
            display: none;
        }

        .message-input::placeholder {
            color: var(--text-muted);
            font-weight: 400;
        }

        .message-input:focus {
            border-color: var(--educap-purple-medium);
            box-shadow: 0 0 0 4px rgba(74, 59, 107, 0.1);
        }

        .input-actions {
            position: absolute;
            right: 12px;
            top: 50%;
            transform: translateY(-50%);
        }

        .send-btn {
            width: 36px;
            height: 36px;
            background: var(--gradient-accent);
            border: none;
            border-radius: 50%;
            color: white;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: var(--shadow-md);
        }

        .send-btn:hover {
            transform: scale(1.1);
            box-shadow: var(--shadow-lg);
        }

        .send-btn:active {
            transform: scale(0.95);
        }

        .footer-text {
            text-align: center;
            margin-top: 16px;
            font-size: 12px;
            color: var(--text-muted);
            font-weight: 400;
        }

        .footer-link {
            color: var(--educap-purple-medium);
            text-decoration: none;
            font-weight: 500;
            transition: color 0.2s ease;
        }

        .footer-link:hover {
            color: var(--educap-purple-dark);
            text-decoration: underline;
        }

        /* Custom Scrollbar */
        .chat-list::-webkit-scrollbar,
        .chat-container::-webkit-scrollbar {
            width: 6px;
        }

        .chat-list::-webkit-scrollbar-track,
        .chat-container::-webkit-scrollbar-track {
            background: transparent;
        }

        .chat-list::-webkit-scrollbar-thumb,
        .chat-container::-webkit-scrollbar-thumb {
            background: var(--gray-300);
            border-radius: 3px;
        }

        .chat-list::-webkit-scrollbar-thumb:hover,
        .chat-container::-webkit-scrollbar-thumb:hover {
            background: var(--educap-purple-medium);
        }

        /* Mobile Responsive */
        /* ========================================
   ENHANCED MOBILE RESPONSIVE STYLES
   ======================================== */

/* Tablet - Medium screens */
@media (max-width: 1024px) {
    .main-content {
        max-width: 100%;
    }

    .chat-container {
        padding: 20px 40px;
    }

    .input-container {
        padding: 20px 40px 30px;
    }

    .welcome-screen {
        padding: 50px 25px 35px;
    }
}

/* Mobile - Small screens */
@media (max-width: 768px) {
    /* Sidebar - Off-canvas menu */
    .sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        height: 100%;
        z-index: 1000;
        transition: left 0.3s ease;
        width: 280px;
    }

    .sidebar.open {
        left: 0;
    }

    /* Overlay when sidebar is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* Main content takes full width */
    .main-content {
        width: 100%;
        max-width: none;
        margin: 0;
    }

    /* Header adjustments */
    .chat-header {
        padding: 15px 20px;
    }

    .chat-title {
        font-size: 16px;
        padding: 6px;
    }

    .chat-title-logo {
        height: 20px;
    }

    /* Welcome screen */
    .welcome-screen {
        padding: 20px 15px 15px;
        justify-content: flex-start;
        padding-top: 30px;
    }

    .welcome-content {
        max-width: 100%;
        align-items: center;
    }

    .bot-avatar {
        width: 50px;
        height: 50px;
        margin-bottom: 12px;
    }

    .welcome-title {
        font-size: 16px;
        margin-bottom: 4px;
    }

    .welcome-subtitle {
        font-size: 22px;
        margin-bottom: 8px;
    }

    .welcome-description {
        font-size: 12px;
        margin-bottom: 15px;
        padding: 0 10px;
    }

    /* Action cards - single column */
    .action-cards {
        grid-template-columns: 1fr;
        gap: 10px;
        max-width: 100%;
    }

    .action-card {
        padding: 16px 14px;
    }

    .action-card .icon {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .action-card .title {
        font-size: 14px;
    }

    .action-card .subtitle {
        font-size: 11px;
    }

    /* Chat container */
    .chat-container {
        padding: 15px 15px;
        max-width: none;
    }

    /* Messages */
    .message {
        margin-bottom: 15px;
        gap: 8px;
    }

    .assistant-icon {
        width: 32px;
        height: 32px;
        margin-top: 2px;
    }

    .message-content {
        max-width: 85%;
    }

    .message-bubble {
        padding: 12px 14px;
    }

    .message-text {
        font-size: 13px;
    }

    /* Input area */
    .input-container {
        padding: 15px 15px 20px;
        max-width: none;
    }

    .message-input {
        padding: 14px 50px 14px 18px;
        font-size: 14px;
        min-height: 48px;
        border-radius: var(--radius-lg);
    }

    .send-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .footer-text {
        font-size: 11px;
        margin-top: 12px;
    }

    /* Sidebar header */
    .sidebar-header {
        padding: 20px;
    }

    .logo-image {
        height: 28px;
    }

    /* New chat button */
    .new-chat-btn {
        margin: 15px 15px 10px;
        padding: 12px 14px;
        font-size: 13px;
    }

    /* Chat list */
    .chat-list {
        padding: 10px 15px 15px;
    }

    .chat-item {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* Extra small screens (phones in portrait) */
@media (max-width: 480px) {
    .sidebar {
        width: 260px;
    }

    .welcome-screen {
        padding: 25px 15px 20px;
    }

    .bot-avatar {
        width: 50px;
        height: 50px;
    }

    .welcome-title {
        font-size: 16px;
    }

    .welcome-subtitle {
        font-size: 20px;
    }

    .welcome-description {
        font-size: 13px;
    }

    .action-card {
        padding: 14px 12px;
    }

    .action-card .icon {
        font-size: 18px;
    }

    .action-card .title {
        font-size: 13px;
    }

    .chat-container {
        padding: 12px 12px;
    }

    .message-content {
        max-width: 90%;
    }

    .message-bubble {
        padding: 10px 12px;
    }

    .message-text {
        font-size: 12px;
    }

    .assistant-icon {
        width: 28px;
        height: 28px;
    }

    .input-container {
        padding: 12px 12px 15px;
    }

    .message-input {
        padding: 12px 45px 12px 14px;
        font-size: 13px;
        min-height: 44px;
    }

    .chat-header {
        padding: 12px 15px;
    }

    .chat-title {
        font-size: 14px;
    }

    .chat-title-logo {
        height: 18px;
    }
}

/* Landscape mode on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .welcome-screen {
        padding: 20px 30px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
    }

    .bot-avatar {
        margin-right: 20px;
        margin-bottom: 0;
    }

    .action-cards {
        grid-template-columns: repeat(2, 1fr);
        max-width: 400px;
    }

    .chat-container {
        max-height: calc(100vh - 140px);
    }
}

/* Menu toggle button for mobile - Add this element in HTML */
.menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    z-index: 998;
    box-shadow: var(--shadow-md);
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    /* Adjust header to make room for menu button */
    .chat-header {
        padding-left: 65px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .action-card:hover {
        transform: none;
    }

    .action-card:active {
        transform: scale(0.98);
        box-shadow: var(--shadow-md);
    }

    .new-chat-btn:hover {
        transform: none;
    }

    .new-chat-btn:active {
        transform: scale(0.98);
    }

    .send-btn:hover {
        transform: none;
    }

    .send-btn:active {
        transform: scale(0.9);
    }

    .chat-item:hover {
        transform: none;
    }

    .chat-item:active {
        background: var(--surface-accent);
    }
}

/* ========================================
   FIX: Remove white square and fix input
   ======================================== */

.input-container *,
.input-wrapper *,
.input-actions * {
    background-color: transparent !important;
}

.input-actions {
    background: transparent !important;
}

.send-btn {
    background: var(--gradient-accent) !important;
}

/* Fix input container background */
.input-container {
    background: var(--surface-primary);
    position: relative;
}

/* Ensure no extra elements create white boxes */
.input-wrapper::before,
.input-wrapper::after,
.input-actions::before,
.input-actions::after {
    display: none !important;
}

/* ========================================
   FIX: Smaller placeholder text on mobile
   NOTE: Input font-size must be 16px minimum to prevent iOS zoom
   ======================================== */

@media (max-width: 768px) {
    .message-input {
        font-size: 16px !important; /* MUST be 16px to prevent iOS zoom */
        padding: 12px 50px 12px 14px;
    }

    .message-input::placeholder {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .message-input {
        font-size: 16px !important; /* MUST be 16px to prevent iOS zoom */
        padding: 10px 45px 10px 12px;
    }

    .message-input::placeholder {
        font-size: 13px;
    }
}

/* ========================================
   FIX: Close button returns to welcome
   ======================================== */

.close-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: var(--gray-200);
    color: var(--educap-gold);
    transform: scale(1.1);
}

/* ========================================
   FIX: Hide scrollbar completely
   ======================================== */

/* Hide scrollbar for Chrome, Safari, Edge */
.chat-container::-webkit-scrollbar,
.chat-list::-webkit-scrollbar {
    width: 0px;
    display: none;
}

.chat-container::-webkit-scrollbar-track,
.chat-list::-webkit-scrollbar-track {
    background: transparent;
    display: none;
}

.chat-container::-webkit-scrollbar-thumb,
.chat-list::-webkit-scrollbar-thumb {
    background: transparent;
    display: none;
}


/* Hide scrollbar for IE/Edge (legacy) */
.chat-container,
.chat-list {
    -ms-overflow-style: none;
}

/* Keep scroll functionality but hide the bar */
.chat-container,
.chat-list {
    overflow-y: auto;
    overflow-x: hidden;
}

/* ========================================
   CUSTOM DELETE MODAL
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-container {
    background: var(--surface-primary);
    border-radius: 16px;
    padding: 28px 24px;
    max-width: 340px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.2s ease;
    border: 1px solid var(--gray-200);
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.2), rgba(239, 68, 68, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
}

.modal-icon i {
    font-size: 24px;
    color: #f87171;
}

.modal-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.modal-message {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 24px;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

/* ========================================
   🟢 FANCY GREEN CANCEL BUTTON
   ======================================== */

.modal-btn-cancel {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    position: relative;
    overflow: hidden;
}

.modal-btn-cancel::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.modal-btn-cancel:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.modal-btn-cancel:hover::before {
    left: 100%;
}

.modal-btn-cancel:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* ========================================
   🔴 DELETE BUTTON (unchanged)
   ======================================== */

.modal-btn-delete {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.modal-btn-delete:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

.modal-btn-delete:active {
    transform: translateY(0);
}

/* ========================================
   MODAL RESPONSIVE STYLES
   ======================================== */

@media (max-width: 480px) {
    .modal-container {
        padding: 24px 20px;
        max-width: 300px;
    }

    .modal-icon {
        width: 48px;
        height: 48px;
    }

    .modal-icon i {
        font-size: 20px;
    }

    .modal-title {
        font-size: 18px;
    }

    .modal-message {
        font-size: 13px;
    }

    .modal-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* ========================================
   HIDE ALL SCROLLBARS COMPLETELY
   ======================================== */

* {
    -ms-overflow-style: none;
}

*::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
    background: transparent !important;
}

*::-webkit-scrollbar-track {
    background: transparent !important;
    display: none !important;
}

*::-webkit-scrollbar-thumb {
    background: transparent !important;
    display: none !important;
}

*::-webkit-scrollbar-corner {
    background: transparent !important;
    display: none !important;
}

html, body {
    -ms-overflow-style: none;
    overflow-x: hidden;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
}

.chat-container {
    -ms-overflow-style: none;
    overflow-y: auto;
    overflow-x: hidden;
}

.chat-container::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
}

.chat-list {
    -ms-overflow-style: none;
    overflow-y: auto;
    overflow-x: hidden;
}

.chat-list::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
}

.sidebar {
    -ms-overflow-style: none;
}

.sidebar::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
}

.message-input {
    -ms-overflow-style: none;
    overflow-y: auto;
    overflow-x: hidden;
}

.message-input::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
}

.message-bubble {
    -ms-overflow-style: none;
}

.message-bubble::-webkit-scrollbar {
    width: 0 !important;
    display: none !important;
}

.message-text {
    -ms-overflow-style: none;
}

.message-text::-webkit-scrollbar {
    width: 0 !important;
    display: none !important;
}

.main-content {
    -ms-overflow-style: none;
}

.main-content::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
}

.welcome-screen {
    -ms-overflow-style: none;
}

.welcome-screen::-webkit-scrollbar {
    width: 0 !important;
    display: none !important;
}

.modal-container {
    -ms-overflow-style: none;
}

.modal-container::-webkit-scrollbar {
    width: 0 !important;
    display: none !important;
}

@supports (scrollbar-width: none) {
    * {
        scrollbar-width: none;
    }

    html, body {
        scrollbar-width: none;
    }

    .chat-container,
    .chat-list,
    .sidebar,
    .message-input,
    .message-bubble,
    .message-text,
    .main-content,
    .welcome-screen,
    .modal-container {
        scrollbar-width: none;
    }
}

/* ========================================
   DEVELOPER CREDIT SECTION
   ======================================== */

.developer-credit {
    text-align: center;
    padding: 10px;
    font-size: 0.8rem;
    color: #888;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 8px;
}

.developer-credit a {
    color: #64ffda;
    text-decoration: none;
    transition: color 0.3s ease;
}

.developer-credit a:hover {
    color: #a8ffea;
    text-decoration: underline;
}

/* ========================================
   MOBILE RESPONSIVENESS FIXES
   Fixes: input zoom, full-screen layout, spacing
   ======================================== */

/* Prevent zoom on input focus (iOS) - minimum 16px font size */
.message-input,
input[type="text"],
textarea {
    font-size: 16px !important; /* Prevents iOS zoom */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-appearance: none;
    appearance: none;
}

/* Mobile Full-Screen Chat Layout */
@media (max-width: 768px) {
    html, body {
        height: 100%;
        overflow: hidden;
        position: fixed;
        width: 100%;
    }

    body {
        display: flex;
        flex-direction: column;
    }
    
    .main-content {
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile browsers */
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    /* Chat container should fill available space */
    .chat-container {
        flex: 1;
        overflow-y: auto;
        min-height: 0; /* Important for flex children */
        padding: 10px 15px;
        padding-bottom: 20px;
    }
    
    /* Input area fixed at bottom */
    .input-container {
        flex-shrink: 0;
        padding: 8px 15px;
        padding-bottom: env(safe-area-inset-bottom, 10px); /* For iPhone notch */
        background: var(--surface-primary);
        border-top: 1px solid var(--gray-200);
    }
    
    /* Input field styling for mobile - MUST be 16px to prevent zoom */
    .message-input {
        font-size: 16px !important;
        padding: 12px 50px 12px 15px;
        border-radius: 20px;
        width: 100%;
        min-height: 44px; /* Apple's minimum touch target */
    }
    
    .message-input::placeholder {
        font-size: 14px;
    }
    
    /* Send button touch-friendly */
    .send-btn {
        min-width: 44px;
        min-height: 44px;
        width: 40px;
        height: 40px;
        padding: 10px;
    }

    /* Welcome screen full height without scrolling */
    .welcome-screen {
        height: 100%;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 10px 15px;
        overflow: hidden;
    }
    
    .welcome-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        max-height: calc(100dvh - 160px);
        overflow-y: auto;
        gap: 0;
    }
    
    .welcome-title {
        font-size: 1.1rem;
        margin-bottom: 4px;
    }
    
    .welcome-subtitle {
        font-size: 1.4rem;
        margin-bottom: 6px;
    }

    .welcome-description {
        font-size: 0.8rem;
        margin-bottom: 12px;
        padding: 0 5px;
    }
    
    /* Suggestion cards - 2x2 grid */
    .action-cards {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        margin-bottom: 0;
        max-width: 100%;
        width: 100%;
        padding: 0 10px;
    }
    
    .action-card {
        padding: 10px 8px;
        font-size: 0.8rem;
        min-height: 65px !important;
        max-height: 80px !important;
    }

    /* Bot avatar smaller on mobile */
    .bot-avatar {
        width: 50px;
        height: 50px;
        margin-bottom: 10px;
    }

    /* Message bubbles mobile sizing */
    .message {
        padding: 8px 0;
        margin-bottom: 10px;
    }
    
    .message-bubble {
        max-width: 85%;
        padding: 10px 14px;
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .message.bot .message-bubble {
        max-width: 90%;
    }
    
    /* Bot icon smaller on mobile */
    .assistant-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    /* Chat header mobile */
    .chat-header {
        flex-shrink: 0;
        padding: 12px 15px;
        padding-left: 60px;
    }

    /* Sidebar mobile fixes */
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        height: 100dvh;
        z-index: 1000;
        transition: left 0.3s ease;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    /* Overlay when sidebar is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.active {
        display: block;
    }

    /* Developer credit on mobile */
    .developer-credit {
        position: relative;
        padding: 4px 10px;
        font-size: 0.65rem;
        margin-top: 4px;
    }

    /* Footer text smaller on mobile */
    .footer-text {
        font-size: 0.65rem;
        margin-top: 6px;
    }

    /* Menu toggle always visible on mobile */
    .menu-toggle {
        display: flex !important;
        position: fixed;
        top: 12px;
        left: 12px;
        z-index: 998;
    }
}

/* Very small screens (phones in portrait) */
@media (max-width: 480px) {
    .action-cards {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    
    .action-card {
        padding: 10px 8px;
        font-size: 0.75rem;
        min-height: 60px !important;
        max-height: 80px !important;
    }

    .action-card .icon {
        font-size: 18px;
        margin-bottom: 4px;
    }

    .action-card .title {
        font-size: 11px;
    }

    .action-card .subtitle {
        font-size: 9px;
    }

    .welcome-title {
        font-size: 1.1rem;
    }

    .welcome-subtitle {
        font-size: 1.3rem;
    }

    .welcome-description {
        font-size: 0.8rem;
    }

    .bot-avatar {
        width: 50px;
        height: 50px;
    }

    .message-bubble {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .assistant-icon {
        width: 28px;
        height: 28px;
        min-width: 28px;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .action-cards {
        gap: 6px !important;
    }
    
    .action-card {
        padding: 8px 6px;
        min-height: 55px !important;
    }

    .welcome-subtitle {
        font-size: 1.2rem;
    }

    .message-input {
        padding: 10px 45px 10px 12px;
    }
}

/* Fix mobile input area */
@media (max-width: 768px) {
    .input-container {
        padding: 12px 15px 20px;
        padding-bottom: env(safe-area-inset-bottom, 20px);
    }
    
    .message-input {
        font-size: 16px !important;
        padding: 14px 50px 14px 18px;
        min-height: 50px;
        border-radius: 25px;
    }
    
    .send-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }
    
    .footer-text,
    .developer-credit {
        font-size: 0.7rem;
        padding: 6px;
    }
}

/* Mobile fix for user messages */
@media (max-width: 768px) {
    .message.user .message-content {
        max-width: 75%;
    }
    
    .message.user .message-bubble {
        padding: 10px 14px;
        border-radius: 16px 16px 4px 16px;
    }
    
    .message.user .message-text {
        font-size: 13px;
    }
}

/* === Chat message layout ======================================= */

/* Container for all messages */
.chat-message {
  display: flex;
  margin: 8px 0;
}

/* Assistant (left) and user (right) alignment */
.chat-message-assistant {
  justify-content: flex-start;
}

.chat-message-user {
  justify-content: flex-end;
}

/* Base bubble style */
.chat-bubble {
  padding: 10px 16px;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.4;
  max-width: 80vw;          /* important on mobile */
  width: auto;              /* let content decide width */
  display: inline-block;    /* natural wrapping */
  white-space: normal;      /* allow normal wrapping */
  word-wrap: break-word;
  word-break: break-word;
  height: auto;             /* no fixed height */
}

/* Assistant bubble (left) */
.chat-bubble-assistant {
  background: #2b2440;
  color: #ffffff;
}

/* User bubble (right) – gradient pill */
.chat-bubble-user {
  background: linear-gradient(135deg, #fbcf4c, #c96dff);
  color: #1f1233;
}

/* Strong overrides for mobile so nothing forces vertical layout */
@media (max-width: 768px) {
  .chat-bubble-user {
    writing-mode: horizontal-tb !important;
    transform: none !important;
    height: auto !important;
    width: auto !important;
    display: inline-block !important;
  }
}

/* === Dark Theme Base Styles ========================================= */

/* Chat container dark background */
.chat-container {
  background: #0b0714;
}

/* Input zone dark styling */
.chat-input-area {
  background: #1b1230;
  color: #f7f4ff;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}