/* ===== CSS RESET & ROOT VARIABLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.4s ease, border-color 0.4s ease, transform 0.3s ease;
}

:root {
    /* Common variables */
    --chat-box-width: 80%;
    --chat-box-max-width: 900px;
    --sidebar-width: 288px;
    --info-panel-width: 300px;
    --footer-height: 65px;
    --footer-visible: 35px;
    --golden-color: #d4af37;
    
    /* Font families */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-ui: 'Inter', sans-serif;
    --font-logo: 'Roboto', sans-serif;
}

/* ===== DARK THEME ===== */
.dark-theme {
    /* Backgrounds */
    --primary-bg: var(--dark-bg-main, #0B1220);
    --secondary-bg: var(--dark-bg-panel, #111A2E);
    --info-panel-bg: var(--dark-bg-soft, #16213A);
    
    /* Accent colors */
    --accent-color: var(--dark-primary, #3f4b52);
    --accent-light: var(--dark-primary-strong, #2E86C1);
    --accent-dark: var(--dark-accent, #034d45);
    
    /* Text colors */
    --text-color: var(--dark-text-main, #E6EDF3);
    --text-paragraph: var(--dark-text-muted, #9FB0C7);
    --text-muted: var(--dark-text-subtle, #6B7C93);
    
    /* UI elements */
    --border-color: rgba(79, 163, 209, 0.15);
    --message-user-bg: rgba(46, 196, 182, 0.12);
    --message-ai-bg: rgba(17, 26, 46, 0.7);
    --input-bg: var(--dark-bg-panel, #111A2E);
    --history-bg: rgba(17, 26, 46, 0.95);
    
    /* Shadows */
    --shadow: rgba(0, 0, 0, 0.25);
    --shadow-heavy: rgba(0, 0, 0, 0.35);
    --text-glow: rgba(79, 163, 209, 0.15);
    
    /* Footer */
    --footer-bg-dark: rgba(11, 18, 32, 0.95);
    --footer-border-dark: rgba(79, 163, 209, 0.2);
    
    /* Logo opacity */
    --logo-opacity: 0.4;
}

/* ===== LIGHT THEME ===== */
.light-theme {
    /* Backgrounds */
    --primary-bg: var(--light-bg-main, #F8FAFC);
    --secondary-bg: var(--light-bg-panel, #FFFFFF);
    --info-panel-bg: var(--light-bg-soft, #EEF3F8);
    
    /* Accent colors */
    --accent-color: var(--light-primary, #1F4E79);
    --accent-light: var(--light-primary-soft, #2F6FA3);
    --accent-dark: var(--light-accent, #2CA6A4);
    
    /* Text colors */
    --text-color: var(--light-text-main, #1E293B);
    --text-paragraph: var(--light-text-muted, #475569);
    --text-muted: var(--light-text-subtle, #64748B);
    
    /* UI elements */
    --border-color: rgba(31, 78, 121, 0.1);
    --message-user-bg: rgba(44, 166, 164, 0.08);
    --message-ai-bg: var(--light-bg-soft, #EEF3F8);
    --input-bg: var(--light-bg-panel, #FFFFFF);
    --history-bg: rgba(255, 255, 255, 0.95);
    
    /* Shadows */
    --shadow: rgba(31, 78, 121, 0.05);
    --shadow-heavy: rgba(31, 78, 121, 0.1);
    --text-glow: rgba(31, 78, 121, 0.05);
    
    /* Footer */
    --footer-bg-light: rgba(248, 250, 252, 0.95);
    --footer-border-light: rgba(31, 78, 121, 0.15);
    
    /* Logo opacity */
    --logo-opacity: 0.35;
}

/* ===== DARK THEME - Keep as is ===== */
.dark-theme {
    --primary-bg: #0f172a;
    --secondary-bg: #1e293b;
    --info-panel-bg: #1a2437;
    --accent-color: #2dd4bf;
    --accent-light: #5eead4;
    --accent-dark: #0d9488;
    --secondary-color: #94a3b8;
    --text-color: #f1f5f9;
    --text-paragraph: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --message-user-bg: rgba(45, 212, 191, 0.15);
    --message-ai-bg: rgba(30, 41, 59, 0.8);
    --input-bg: #1e293b;
    --shadow: rgba(0, 0, 0, 0.25);
    --shadow-heavy: rgba(0, 0, 0, 0.35);
    --logo-opacity: 0.4;
    --history-bg: rgba(30, 41, 59, 0.95);
    --text-glow: rgba(45, 212, 191, 0.15);
    --footer-bg-light: rgba(241, 245, 249, 0.95);
    --footer-border-light: #e2e8f0;
    --footer-bg-dark: rgba(15, 23, 42, 0.95);
    --footer-border-dark: #1e293b;
}

/* ===== FONTS ===== */
body {
    font-family: var(--font-body), -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    text-shadow: 0 0 10px var(--text-glow);
    padding-bottom: var(--footer-visible);
}

h1, h2, h3, h4, .logo-background {
    font-family: var(--font-heading), 'Poppins', sans-serif;
    font-weight: 600;
}

.logo-background {
    font-family: var(--font-logo);
    font-weight: 400 !important;
}
.custom-font {
     font-family: 'Bbigerover', var(--font-heading), sans-serif;
    letter-spacing: 0.5px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== CUSTOM SCROLLBAR - NO ARROWS ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

.light-theme ::-webkit-scrollbar-thumb {
    background: rgba(102, 217, 217, 0.3);
}

.light-theme ::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

::-webkit-scrollbar-button {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* ===== OPENING ANIMATION ===== */
.opening-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(20px);
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.opening-overlay.active {
    opacity: 1;
    visibility: visible;
}

.opening-overlay.hiding {
    opacity: 0;
    visibility: hidden;
}

.opening-container {
    text-align: center;
    padding: 40px;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.opening-logo {
    margin-bottom: 0;
    transform-origin: center;
    z-index: 10;
}

.opening-logo-img {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 4px solid var(--accent-color);
    animation: logoPulse 2s ease-in-out 1;
}

@keyframes logoPulse {
    0% { 
        transform: scale(0.8); 
        opacity: 0;
    }
    50% { 
        transform: scale(1.05);
        opacity: 1;
    }
    100% { 
        transform: scale(1);
        opacity: 1;
    }
}

.opening-motto {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--accent-color);
    min-height: 50px;
    line-height: 1.3;
    text-shadow: 0 0 10px rgba(102, 217, 217, 0.2);
    font-weight: 500;
    letter-spacing: 1px;
}

.opening-motto .typing-cursor {
    animation: blink 1s infinite;
    font-weight: bold;
}

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

/* ===== MAIN LAYOUT CONTAINER ===== */
.app-container {
    display: flex;
    height: calc(100vh - var(--footer-visible));
    max-width: 1800px;
    margin: 0 auto;
    position: relative;
    overflow: visible;
}

/* ===== LEFT INFO PANEL ===== */
.info-panel {
    width: var(--info-panel-width);
    background-color: var(--info-panel-bg);
    border-right: 1px solid var(--border-color);
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    overflow-y: auto;
    z-index: 5;
    position: relative;
}

.dark-theme .info-panel {
    background-color: #1a2437;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.2);
}

.light-theme .info-panel {
    background: var(--info-panel-bg);
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.05);
    position: relative;
}

.light-theme .info-panel::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(var(--accent-color), transparent);
    z-index: 2;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    cursor: pointer;
    z-index: 100;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    opacity: 0.9;
}

.light-theme .mobile-menu-toggle {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(102, 217, 217, 0.35);
}

.mobile-menu-toggle:hover {
    background-color: var(--accent-light);
    transform: scale(1.05);
    opacity: 1;
}

.light-theme .mobile-menu-toggle:hover {
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 217, 217, 0.45);
}

/* AI Assistant Box */
.assistant-intro {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    margin-top: 10px;
}

.light-theme .assistant-intro {
    background: var(--secondary-bg);
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(102, 217, 217, 0.1);
}

.assistant-intro:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.light-theme .assistant-intro:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.06);
}

.assistant-intro h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--accent-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.light-theme .assistant-intro h3 {
    color: var(--text-color);
}

.assistant-intro p {
    font-size: 0.95rem;
    color: var(--text-paragraph);
    margin-bottom: 18px;
    line-height: 1.6;
}

.light-theme .assistant-intro p {
    color: var(--text-paragraph);
}

.capabilities {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.capability-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-paragraph);
    padding: 6px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.light-theme .capability-item {
    color: var(--text-paragraph);
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

.capability-item i {
    color: var(--accent-color);
    font-size: 0.9rem;
}

.light-theme .capability-item i {
    color: var(--accent-color);
}

/* About Box */
.about-box {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.light-theme .about-box {
    background: var(--secondary-bg);
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(226, 255, 255, 0.1);
}

.about-box:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.light-theme .about-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.06);
}

.about-box h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--accent-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.light-theme .about-box h3 {
    color: var(--text-color);
}

.about-box p {
    font-size: 0.95rem;
    color: var(--text-paragraph);
    margin-bottom: 18px;
    line-height: 1.6;
}

.light-theme .about-box p {
    color: var(--text-paragraph);
}

.feature-list {
    list-style: none;
    padding-left: 0;
}

.feature-list li {
    margin-bottom: 10px;
    padding: 8px 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--text-paragraph);
}

.light-theme .feature-list li {
    color: var(--text-paragraph);
}

.feature-list li i {
    color: var(--accent-color);
    margin-top: 2px;
    font-size: 0.9rem;
}

.light-theme .feature-list li i {
    color: var(--accent-color);
}

/* Credits Section */
.credits-section {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.credit-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.credit-label {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.light-theme .credit-label {
    color: var(--text-muted);
}

.credit-name {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: var(--accent-color);
    font-weight: 400;
    letter-spacing: 02px;
}

.light-theme .credit-name {
    color: var(--accent-color);
}

/* ===== MAIN CHAT AREA ===== */
.main-chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 40px 20px 30px;
    position: relative;
    width: calc(100% - var(--info-panel-width));
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    overflow: hidden;
}

/* Chat Header */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin-bottom: 10px;
    position: relative;
}

.header-logo {
    text-align: center;
    pointer-events: none;
    flex: 1;
}

/* ===== ENHANCED OESTRON HEADING ===== */
.dark-theme .logo-background {
    color: #5FB3E5;
    text-shadow: 0 0 12px rgba(95, 179, 229, 0.35);
    letter-spacing: 0.12em;
    font-weight: 700;
}

.light-theme .logo-background {
    color: #94AEBF;
    text-shadow: 0 0 8px rgba(148, 174, 191, 0.25);
    letter-spacing: 0.12em;
    font-weight: 700;
}

.logo-background {
    font-family: var(--font-logo);
    font-weight: 700;
    font-size: 3.8rem;
    color: var(--accent-color);
    opacity: 40%;
    letter-spacing: 6px;
    text-transform: uppercase;
    filter: blur(0.5px);
    user-select: none;
    text-shadow: 0 0 20px var(--text-glow), 0 0 30px rgba(102, 217, 217, 0.1);
}

/* ===== UTILITY CONTROLS ===== */
.utility-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Utility Dropdown */
.utility-dropdown {
    position: relative;
}

.dropdown-toggle {
    width: 44px;
    height: 44px;
    background-color: var(--primary-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.light-theme .dropdown-toggle {
    background: var(--secondary-bg);
    border: 1px solid rgba(102, 217, 217, 0.2);
    color: var(--text-color);
}

.dropdown-toggle:hover {
    background-color: var(--secondary-bg);
    border-color: var(--accent-color);
    transform: scale(1.05);
}

.light-theme .dropdown-toggle:hover {
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(102, 217, 217, 0.2);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    background-color: var(--primary-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px;
    margin-top: 8px;
    box-shadow: 0 10px 30px var(--shadow-heavy);
    display: none;
    z-index: 1000;
}

.dropdown-menu.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

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

.dropdown-item {
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    text-align: left;
    color: var(--text-color);
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background-color 0.2s ease;
}

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

.dropdown-item i {
    width: 20px;
    color: var(--accent-color);
}

/* ===== THEME TOGGLE SWITCH IN DROPDOWN ===== */
.theme-toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: default;
}

.theme-toggle-container:hover {
    background-color: transparent !important;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    color: var(--text-color);
}

/* Theme toggle switch */
.theme-toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 26px;
    margin-left: 10px;
}

.theme-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    border-radius: 34px;
    transition: .4s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
}

.theme-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: var(--accent-color);
    border-radius: 50%;
    transition: .4s;
    z-index: 2;
}

.theme-toggle-switch input:checked + .theme-toggle-slider {
    background-color: var(--accent-color);
}

.theme-toggle-switch input:checked + .theme-toggle-slider:before {
    transform: translateX(26px);
    background-color: var(--primary-bg);
}

/* Toggle icons */
.toggle-icon {
    font-size: 12px;
    transition: opacity 0.3s ease;
    z-index: 1;
    line-height: 1;
}

.sun-icon {
    opacity: 0.8;
}

.moon-icon {
    opacity: 0.4;
}

.theme-toggle-switch input:checked + .theme-toggle-slider .sun-icon {
    opacity: 0.4;
}

.theme-toggle-switch input:checked + .theme-toggle-slider .moon-icon {
    opacity: 0.8;
}

/* Watermark */
.watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    z-index: 1;
    opacity: 0.35;
    display: block !important;
    visibility: visible !important;
}
.watermark {
    z-index: 1!important;
}

.watermark-text {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 0.7;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);opacity: 20%;
}

.watermark-subtext {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-top: -2px;
    letter-spacing: 3px;
    opacity: 1200%;
}

/* Dark theme watermark */
.dark-theme .watermark-text {
    color: rgba(45, 212, 191, 0.25) !important;
}

.dark-theme .watermark-subtext {
    color: rgba(148, 163, 184, 0.4) !important;
}

/* Light theme watermark */
.light-theme .watermark {
    z-index: 2 !important;
    opacity: 0.15 !important;
    font-weight: 900;
}
.light-theme .watermark-text {
    color: rgba(31, 78, 121, 0.7) !important;
    text-shadow: 0 2px 10px rgba(31, 78, 121, 0.3);
    opacity: 1 !important;
    color: rgba(31, 78, 121, 0.3) !important;
}

.light-theme .watermark-subtext {
    color: rgba(71, 85, 105, 0.8) !important;
    text-shadow: 0 1px 6px rgba(71, 85, 105, 0.2);
    opacity: 1 !important;
    color: rgba(71, 85, 105, 0.4) !important;
}

/* Dark theme chat container */
.dark-theme .chat-messages-container {
    background: linear-gradient(135deg, var(--dark-bg-panel), var(--dark-bg-main));
    border: 1px solid rgba(79, 163, 209, 0.15);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}
.dark-theme .chat-messages-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.3), transparent);
}

.light-theme .chat-messages-container {
    background: var(--secondary-bg);
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(102, 217, 217, 0.1);
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(102, 217, 217, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(102, 217, 217, 0.03) 0%, transparent 50%);
    position: relative;
}

.light-theme .chat-messages-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(102, 217, 217, 0.2), transparent);
}

.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    margin-bottom: 20px;
    border-radius: 14px;
    background-color: var(--secondary-bg);
    box-shadow: inset 0 20px 10px var(--shadow);
    scroll-behavior: smooth;
    position: relative;
    width: var(--chat-box-width);
    max-width: var(--chat-box-max-width);
    margin-left: auto;
    margin-right: auto;
    border: 5px solid var(--border-color);
    box-shadow: 0 10px 40px var(--shadow-heavy);
    z-index: 1;
}

/* ===== MESSAGE STYLES ===== */
.message {
    display: flex;
    margin-bottom: 25px;
    width: 100%;
    animation: messageAppear 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

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

/* 🟢 FORMAL BOT STYLE (No Bubble) */
.message.assistant {
    width: 100%;
    margin-bottom: 30px;
}

.message.assistant .message-content {
    background-color: transparent !important; /* No Background */
    border: none !important;                 /* No Border */
    box-shadow: none !important;             /* No Shadow */
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;                         /* Full Width */
    padding-left: 0;
    padding-right: 0;
}

/* User still gets a bubble */
.message.user .message-content {
    background-color: var(--message-user-bg);
    border: 1px solid rgba(102, 217, 217, 0.3);
    border-radius: 18px 18px 4px 18px;
    margin-left: auto;
    margin-right: 0;
    max-width: 85%;
    position: relative;
    padding: 16px 20px;
}

/* Light/Dark specific Overrides for User Bubble */
.dark-theme .message.user .message-content {
    background-color: var(--message-user-bg, rgba(46, 196, 182, 0.12));
    border: 1px solid rgba(46, 196, 182, 0.25);
}

.light-theme .message.user .message-content {
    background-color: var(--message-user-bg, rgba(44, 166, 164, 0.08));
    border: 1px solid rgba(44, 166, 164, 0.2);
}

.message-content {
    position: relative;
    line-height: 1.7; /* Slightly more spacing for reading */
    word-wrap: break-word;
    font-size: 1rem;
    width: fit-content;
}

.message-sender {
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 🟢 STOP BUTTON (No Spinner) */
.send-btn.sending {
    background-color: var(--accent-color); /* Keep color or change to red */
}

/* REMOVE THE SPINNER ANIMATION */
.send-btn.sending::after {
    display: none !important; 
    content: none !important;
}

/* ===== ISTARC CUSTOM FONT ===== */
.istarc-word {
    font-family: 'Bbigerover', 'Poppins', sans-serif;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

/* Dark theme ISTARC */
.dark-theme .istarc-word {
    color: var(--dark-accent, #2EC4B6);
    text-shadow: 0 0 8px rgba(46, 196, 182, 0.2);
}

/* Light theme ISTARC */
.light-theme .istarc-word {
    color: var(--light-accent, #2CA6A4);
}

/* Footer ISTARC */
.branding-line2 {
    font-weight: 10;
    font-family: 'Bbigerover', 'Poppins', sans-serif !important;
    font-size: 1.5rem;
    color: var(--accent-color);
    letter-spacing: 1px;
    text-transform: uppercase;
}

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

.message.assistant .message-content {
    background-color: var(--message-ai-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px 18px 18px 4px;
    margin-left: 0;
    margin-right: auto;
    max-width: 85%;
    position: relative;
}

.message.user .message-content {
    background-color: var(--message-user-bg);
    border: 1px solid rgba(102, 217, 217, 0.3);
    border-radius: 18px 18px 4px 18px;
    margin-left: auto;
    margin-right: 0;
    max-width: 85%;
    position: relative;
}

/* Enhanced chat bubbles with outline */
.dark-theme .message.assistant .message-content {
    background-color: var(--message-ai-bg, rgba(17, 26, 46, 0.7));
    border: 1px solid rgba(79, 163, 209, 0.15);
}

.dark-theme .message.user .message-content {
    background-color: var(--message-user-bg, rgba(46, 196, 182, 0.12));
    border: 1px solid rgba(46, 196, 182, 0.25);
}

.light-theme .message.assistant .message-content {
    background-color: var(--message-ai-bg, #EEF3F8);
    border: 1px solid rgba(31, 78, 121, 0.1);
}

.light-theme .message.user .message-content {
    background-color: var(--message-user-bg, rgba(44, 166, 164, 0.08));
    border: 1px solid rgba(44, 166, 164, 0.2);
}
.message-content {
    position: relative;
    line-height: 1.6;
    word-wrap: break-word;
    font-size: 1rem;
    width: fit-content;
    padding: 16px 20px;
    border: 1px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.message-sender {
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.light-theme .message-sender {
    color: var(--accent-color);
}

.light-theme .message-text {
    color: var(--text-paragraph);
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
    margin-top: 8px;
    opacity: 0.8;
}

.light-theme .message-time {
    color: var(--text-muted);
}

.copy-message-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0;
    transition: all 0.2s ease;
    padding: 4px;
    border-radius: 4px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-content:hover .copy-message-btn {
    opacity: 0.7;
}

.copy-message-btn:hover {
    opacity: 1 !important;
    color: var(--accent-color);
    background-color: rgba(255, 255, 255, 0.1);
}

.light-theme .message.user .copy-message-btn {
    color: rgba(255, 255, 255, 0.7);
}

.light-theme .message.user .copy-message-btn:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.2);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background-color: var(--message-ai-bg);
    border-radius: 18px;
    width: fit-content;
    margin-bottom: 25px;
    animation: messageAppear 0.35s;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

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

.light-theme .typing-dots .dot {
    background-color: var(--accent-color);
}

.typing-dots .dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dots .dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingAnimation {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.typing-text {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

/* =========================================
   BOT MESSAGE HTML DECOR (MARKDOWN)
   Updated to match your requested prototype style
   but adapted for Light/Dark themes
   ========================================= */

/* Bold Text */
.message-content strong { 
    color: var(--text-color); /* Matches text in light/dark */
    font-weight: bold; 
}

/* Headings */
.message-content h2, .message-content h3 { 
    margin-top: 15px; 
    margin-bottom: 8px;
    font-size: 20px; 
    color: var(--text-color); 
    font-weight: bolder; 
}

/* Bullet Points */
.message-content ul, .message-content ol { 
    margin-left: 20px; 
    margin-bottom: 10px; 
    color: var(--text-paragraph); 
}

.message-content li {
    margin-bottom: 5px;
}

/* Code Blocks */
.message-content pre { 
    background: #1e1e1e; 
    color: #d4d4d4; 
    padding: 15px; 
    border-radius: 8px; 
    overflow-x: auto; 
    font-family: 'Consolas', 'Monaco', monospace; 
    font-size: 13px; 
    margin: 10px 0; 
}

/* Inline Code */
.message-content code { 
    padding: 2px 6px; 
    border-radius: 4px; 
    font-family: monospace; 
    background: rgba(0,0,0,0.2); 
    color: var(--accent-light); 
}
.light-theme .message-content code {
    background: rgba(0,0,0,0.08);
    color: var(--accent-dark);
}

/* Table :) */
.message-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 14px;
}

.message-content th, .message-content td {
    border: 1px solid var(--border-color);
    padding: 8px;
    text-align: left;
}

.message-content th {
    background-color: transparent;
    font-weight: bold;
    font-size: 16px;
    color: var(--accent-color);
}

/* ===== MAIN FOOTER ===== */
.main-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--footer-height);
    background-color: var(--footer-bg-light);
    border-top: 2px solid var(--footer-border-light);
    backdrop-filter: blur(10px);
    z-index: 100;
    overflow: hidden;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: translateY(var(--footer-visible));
}

.dark-theme .main-footer {
    background-color: var(--footer-bg-dark);
    border-top-color: var(--footer-border-dark);
}

.main-footer.initial-visible {
    transform: translateY(0) !important;
}

.main-footer:hover {
    transform: translateY(0) !important;
}

.chat-history-sidebar.active ~ .main-footer {
    transform: translateY(0) !important;
}

/* Footer content layout */
.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 40px;
    max-width: 1800px;
    margin: 0 auto;
    min-height: var(--footer-height);
    position: relative;
}

/* Left logo */
.footer-logo {
    flex: 0 0 auto;
    width: 80px;
}

.footer-logo-img {
    height: 45px;
    width: 45px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.footer-logo-img:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(102, 217, 217, 0.4);
}

.light-theme .footer-logo-img:hover {
    box-shadow: 0 6px 20px rgba(102, 217, 217, 0.4);
}

/* Center animation text */
.footer-animation {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: 50%;
    text-align: center;
}

.fullform-typing {
    font-family: 'Bbigerover', 'Arial Black', 'Impact', sans-serif;
    font-size: 1rem;
    color: var(--accent-color);
    min-height: 24px;
    text-align: center;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* Right branding text */
.footer-branding {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    text-align: right;
    min-width: 120px;
    padding: 0 10px;
    position: relative;
    z-index: 10;
}

.branding-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
    width: 100%;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.branding-line1 {
    font-family: var(--font-ui);
    font-size: 0.5rem;
    color: var(--text-muted);
    font-weight: 800;
    margin-bottom: .5px;
    letter-spacing: 0.1px;
    white-space: nowrap;
    width: 100%;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 1500%;
    transform: translateY(0);
    text-transform: uppercase;
    max-height: 20px;
    overflow: hidden;
    text-align: right;
}

.light-theme .branding-line1 {
    color: var(--text-muted);
}

.branding-line2 {
    font-family: var(--font-heading);
    font-weight: 500;
    color: var(--accent-color);
    font-size: 1.6rem;
    letter-spacing: 1px;
    width: 100%;
    margin-top: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: translateY(0);
    text-transform: uppercase;
    text-align: right;
}

.light-theme .branding-line2 {
    color: var(--accent-color);
    text-shadow: 0 0 5px rgba(102, 217, 217, 0.1);
}

/* Footer hover effect - hide line1, show only line2 */
.main-footer:not(.initial-visible):not(:hover) .branding-container {
    transform: translateY(5px);
}

.main-footer:not(.initial-visible):not(:hover) .branding-line1 {
    opacity: 0;
    transform: translateY(-5px);
    max-height: 0;
    margin-bottom: 0;
}

.main-footer:not(.initial-visible):not(:hover) .branding-line2 {
    transform: translateY(-10px);
}

.main-footer:hover .branding-container {
    transform: translateY(0);
}

.main-footer:hover .branding-line1 {
    opacity: 1;
    transform: translateY(0);
    max-height: 20px;
    margin-bottom: 2px;
}

.main-footer:hover .branding-line2 {
    transform: translateY(0);
}

/* ===== CHAT INPUT AREA ===== */
.chat-input-container {
    padding: 0;
    width: var(--chat-box-width);
    max-width: var(--chat-box-max-width);
    margin-left: auto;
    margin-right: auto;
    margin-top: 25px;
}

.input-wrapper {
    position: relative;
}

.dark-theme .input-box:focus-within {
    box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.35);
}

.input-box {
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 12px 15px;
    box-shadow: 0 8px 25px var(--shadow-heavy);
    position: relative;
    transition: all 0.3s ease;
}

.light-theme .input-box {
    background: var(--secondary-bg);
    border: 1px solid rgba(102, 217, 217, 0.2);
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.04);
}

.input-box:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 8px 30px rgba(102, 217, 217, 0.2);
}

.light-theme .input-box:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 12px 35px rgba(102, 217, 217, 0.15), 0 4px 8px rgba(102, 217, 217, 0.08);
}

#messageInput {
    width: 100%;
    min-height: 45px;
    max-height: 150px;
    padding: 0;
    background-color: transparent;
    border: none;
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 1.05rem;
    resize: none;
    outline: none;
    transition: all 0.3s ease;
    line-height: 1.5;
    overflow-y: auto;
}

#messageInput::placeholder {
    color: var(--text-muted);
}

.light-theme #messageInput::placeholder {
    color: var(--text-muted);
}

.input-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.input-button {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.attach-btn {
    background-color: rgba(102, 217, 217, 0.1);
    color: var(--accent-color);
}

.light-theme .attach-btn {
    background-color: rgba(102, 217, 217, 0.08);
    color: var(--accent-color);
}

.attach-btn:hover {
    background-color: rgba(102, 217, 217, 0.2);
    transform: translateY(-2px);
}

.light-theme .attach-btn:hover {
    background-color: rgba(102, 217, 217, 0.15);
    transform: translateY(-2px);
}

.emoji-btn {
    background-color: rgba(102, 217, 217, 0.1);
    color: var(--accent-color);
}

.light-theme .emoji-btn {
    background-color: rgba(93, 145, 145, 0.08);
    color: var(--accent-color);
}

.emoji-btn:hover {
    background-color: rgba(102, 217, 217, 0.2);
    transform: translateY(-2px);
}

.light-theme .emoji-btn:hover {
    background-color: rgba(102, 217, 217, 0.15);
    transform: translateY(-2px);
}

/* Enhanced Send Button */
.send-btn {
    background-color: var(--accent-color);
    color: white;
    width: 36px;
    position: relative;
    overflow: hidden;
}

.light-theme .send-btn {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
    color: white;
    box-shadow: 0 6px 15px rgba(102, 217, 217, 0.35);
}

.dark-theme .send-btn {
    background: linear-gradient(135deg, #2dd4bf, #0d9488);
    color: white;
    box-shadow: 0 6px 15px rgba(45, 212, 191, 0.35);
}

.send-btn:hover {
    background-color: var(--accent-light);
    transform: translateY(-2px) scale(1.05);
}

.light-theme .send-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 25px rgba(102, 217, 217, 0.45);
}

.dark-theme .send-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 25px rgba(45, 212, 191, 0.45);
}

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

.send-btn.sending::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: sendLoading 0.8s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes sendLoading {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Emoji Picker */
.emoji-picker-container {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 280px;
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px var(--shadow-heavy);
    padding: 15px;
    z-index: 1000;
    display: none;
    animation: emojiAppear 0.3s ease;
}

.emoji-picker-container.active {
    display: block;
}

.emoji-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-ui);
    font-weight: 600;
    color: var(--accent-color);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.emoji-btn-small {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-btn-small:hover {
    background-color: var(--accent-color);
    color: white;
    transform: scale(1.1);
    border-color: var(--accent-color);
}

.light-theme .emoji-btn-small {
    border: 1px solid rgba(102, 217, 217, 0.2);
}

.light-theme .emoji-btn-small:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

/* ===== CHAT HISTORY SIDEBAR ===== */
.chat-history-sidebar {
    width: var(--sidebar-width);
    background-color: var(--history-bg);
    border-left: 1px solid var(--border-color);
    padding: 24px;
    overflow-y: auto;
    backdrop-filter: blur(5px);
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    box-shadow: -5px 0 15px var(--shadow-heavy);
    position: fixed !important;
    right: 0 !important;
    top: 0 !important;
    height: 100vh !important;
    border-radius: 0 0 0 20px;
    margin: 0;
    z-index: 9999 !important;
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
    text-decoration: none;
}

.chat-history-sidebar.active {
    transform: translateX(0) !important;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
}
.light-theme .chat-history-sidebar {
    background: var(--history-bg);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

.dark-theme .chat-history-sidebar {
    background: var(--history-bg);
}

.chat-history-sidebar.active {
    transform: translateX(0);
}

.chat-history-list{
    text-decoration: none;
}


.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
}

.history-header h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--accent-color);
    margin: 0;
}

.light-theme .history-header h3 {
    color: var(--text-color);
}

.history-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.history-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    padding: 5px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.delete-all-btn:hover {
    color: #ff6b6b;
    background-color: rgba(255, 107, 107, 0.1);
}

.close-history {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.2s;
    padding: 5px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.close-history:hover {
    color: var(--accent-color);
    background-color: rgba(255, 255, 255, 0.1);
}

.light-theme .close-history:hover {
    background-color: rgba(102, 217, 217, 0.1);
}

.history-item {
    padding: 12px 15px;
    margin-bottom: 10px;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    position: relative;
}

.light-theme .history-item {
    background: var(--secondary-bg);
    border: 1px solid rgba(102, 217, 217, 0.1);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.dark-theme .history-item {
    background: rgba(255, 255, 255, 0.05);
}

.history-item:hover {
    border-color: var(--accent-light);
    transform: translateX(-5px);
    box-shadow: 3px 3px 8px var(--shadow);
}

.light-theme .history-item:hover {
    border-color: rgba(102, 217, 217, 0.3);
    transform: translateX(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.history-item.active {
    border-color: var(--accent-color);
    background-color: rgba(102, 217, 217, 0.08);
}

.light-theme .history-item.active {
    background-color: rgba(102, 217, 217, 0.08);
    border-color: var(--accent-color);
    box-shadow: 0 6px 18px rgba(102, 217, 217, 0.15);
}

.dark-theme .history-item.active {
    background-color: rgba(45, 212, 191, 0.15);
    border-color: var(--accent-color);
}

.history-item-content {
    display: flex;
    flex-direction: column;
}

.history-item-text {
    flex: 1;
    padding-right: 25px;
}

.history-item-title {
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-color);
}

.light-theme .history-item-title {
    color: var(--text-color);
}

.history-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.light-theme .history-date {
    color: var(--text-muted);
}

.history-item-delete {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0;
    transition: all 0.2s ease;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.history-item:hover .history-item-delete {
    opacity: 0.6;
}

.history-item-delete:hover {
    opacity: 1 !important;
    color: #ff6b6b;
    background-color: rgba(255, 107, 107, 0.1);
}

.empty-history {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 30px 10px;
    font-size: 0.9rem;
}

.empty-history i {
    font-size: 2rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* ===== DELETE CONFIRMATION MODAL ===== */
.delete-confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    padding-top: 120px;
}

.delete-confirmation-modal.active {
    opacity: 1;
    visibility: visible;
}

.delete-confirmation-content {
    background-color: var(--secondary-bg);
    border-radius: 16px;
    padding: 25px;
    max-width: 400px;
    width: 90%;
    position: relative;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    animation: modalAppear 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    margin-top: -80px;
}

.light-theme .delete-confirmation-content {
    background: var(--secondary-bg);
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.04);
}

.delete-confirmation-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.delete-confirmation-icon {
    font-size: 1.8rem;
    color: #ff6b6b;
    margin-right: 15px;
}

.delete-confirmation-header h4 {
    font-family: var(--font-heading);
    color: var(--text-color);
    margin: 0;
}

.light-theme .delete-confirmation-header h4 {
    color: var(--text-color);
}

.delete-confirmation-body {
    margin-bottom: 20px;
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.5;
}

.light-theme .delete-confirmation-body {
    color: var(--text-paragraph);
}

.delete-confirmation-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.delete-confirm-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    background-color: #ff6b6b;
    color: white;
    font-family: var(--font-ui);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.delete-confirm-btn:hover {
    background-color: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 107, 107, 0.3);
}

.delete-cancel-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: transparent;
    color: var(--text-color);
    font-family: var(--font-ui);
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-cancel-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.light-theme .delete-cancel-btn:hover {
    background-color: rgba(102, 217, 217, 0.05);
}

/* Responsive Design */
@media (max-width: 1300px) {
    .app-container {
        flex-direction: column;
    }
    
    .info-panel {
        width: 100%;
        height: auto;
        flex-direction: row;
        justify-content: space-between;
        padding: 20px;
        border-right: none;
        border-bottom: 2px solid var(--border-color);
        gap: 30px;
        position: relative;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .info-panel.collapsed {
        height: 80px;
        overflow: hidden;
        padding: 15px 20px;
    }
    
    .info-panel.collapsed .assistant-intro,
    .info-panel.collapsed .about-box,
    .info-panel.collapsed .credits-section {
        display: none;
    }
    
    .assistant-intro, .about-box {
        flex: 1;
        margin: 0;
        max-height: 300px;
        overflow-y: auto;
    }
    
    .main-chat-area {
        width: 100%;
        padding: 20px;
        height: calc(100vh - var(--footer-height) - 80px);
    }
    
    .chat-history-sidebar {
        width: 320px;
        height: calc(100vh - 48px);
        top: 24px;
        margin-top: 0;
    }
    
    .chat-history-sidebar.active ~ .main-chat-area {
        width: calc(100% - 320px);
        transform: none ;
    }
    
    .footer-content {
        padding: 0 20px;
    }
    
    .fullform-typing {
        font-size: 0.9rem;
    }
    
    .branding-line1 {
        font-size: 0.65rem;
    }
    
    .branding-line2 {
        font-size: 1rem;
    }
    
    .chat-messages-container,
    .chat-input-container {
        width: 95%;
    }
    
    .logo-background {
        font-size: 3rem;
    }
    
    .utility-controls {
        position: absolute;
        top: 0;
        right: 0;
    }
    
    /* Theme toggle responsive */
    .theme-toggle-switch {
        width: 48px;
        height: 24px;
    }
    
    .theme-toggle-slider:before {
        height: 18px;
        width: 18px;
        left: 3px;
        bottom: 3px;
    }
    
    .theme-toggle-switch input:checked + .theme-toggle-slider:before {
        transform: translateX(24px);
    }
}

@media (max-width: 900px) {
    .info-panel {
        flex-direction: column;
        gap: 20px;
        padding: 15px;
    }
    
    .info-panel.collapsed {
        height: 70px;
        padding: 10px 15px;
    }
    
    .assistant-intro, .about-box {
        max-height: 200px;
    }
    
    .chat-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .utility-controls {
        position: absolute;
        top: 10px;
        right: 10px;
    }
    
    .logo-background {
        font-size: 2.5rem;
    }
    
    .watermark-text {
        font-size: 5rem;
    }
    
    .watermark-subtext {
        font-size: 1.2rem;
    }
    
    .chat-history-sidebar {
        width: 280px;
        height: calc(100vh - 48px);
        top: 24px;
    }
    
    .chat-history-sidebar.active ~ .main-chat-area {
        width: calc(100% - 280px);
        transform: none;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 8px;
        padding: 8px;
        height: auto;
        min-height: var(--footer-height);
    }
    
    .footer-logo {
        order: 1;
        width: auto;
        margin-bottom: 5px;
    }
    
    .footer-animation {
        order: 3;
        width: 100%;
        padding: 4px 0;
        position: static;
        transform: none;
        max-width: 100%;
    }
    
    .footer-branding {
        order: 2;
        width: auto;
        align-items: center;
        margin-bottom: 5px;
    }
    
    .branding-container {
        align-items: center;
        text-align: center;
    }
    
    .main-footer:not(.initial-visible):not(:hover) .branding-container {
        transform: translateY(-5px);
    }
    
    .main-footer:not(.initial-visible):not(:hover) .branding-line2 {
        transform: translateY(-10px);
    }

    .fullform-typing {
        font-size: 0.85rem;
        min-height: 20px;
        line-height: 1.2;
    }
    
    .footer-logo-img {
        height: 35px;
        width: 35px;
    }
    

    .chat-messages-container,
    .chat-input-container {
        width: 95%;
    }
    
    /* Adjust delete modal for mobile */
    .delete-confirmation-modal {
        padding-top: 80px;
    }
    
    .delete-confirmation-content {
        margin-top: -40px;
    }
    
    /* Theme toggle mobile */
    .theme-toggle-switch {
        width: 44px;
        height: 22px;
    }
    
    .theme-toggle-slider:before {
        height: 16px;
        width: 16px;
        left: 3px;
        bottom: 3px;
    }
    
    .theme-toggle-switch input:checked + .theme-toggle-slider:before {
        transform: translateX(22px);
    }
    
    .toggle-icon {
        font-size: 10px;
    }
}

@media (max-width: 600px) {
    .app-container {
        padding: 0;
    }
    
    .main-chat-area {
        padding: 15px;
        height: calc(100vh - var(--footer-height) - 70px);
    }
    
    .chat-history-sidebar {
        width: 100%;
        height: calc(100vh - 48px);
        top: 24px;
    }
    
    .chat-history-sidebar.active ~ .main-chat-area {
        width: 100%;
       display: none;
    }
    .logo-background {
        font-size: 2rem;
    }
    
    .watermark-text {
        font-size: 4rem;
    }
    
    .watermark-subtext {
        font-size: 1rem;
    }
    
    .message-content {
        padding: 15px;
        max-width: 95% !important;
    }
    
    .input-box {
        padding: 10px 12px;
    }
    
    .input-button {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .opening-logo-img {
        width: 200px;
        height: 200px;
    }
    
    .opening-motto {
        font-size: 1rem;
    }
    
    .fullform-typing {
        font-size: 0.8rem;
        line-height: 1.2;
    }
    
    .branding-line1 {
        font-size: 0.65rem;
    }
    
    .branding-line2 {
        font-size: 0.9rem;
    }
    
    body {
        padding-bottom: 37.5px;
    }
    
    .emoji-picker-container {
        width: 240px;
        right: 0;
        left: auto;
        transform: none;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Adjust delete modal for small screens */
    .delete-confirmation-modal {
        padding-top: 60px;
    }
    
    .delete-confirmation-content {
        margin-top: -20px;
        padding: 20px;
    }
    
    .chat-history-sidebar {
        top: 12px;
        height: calc(100vh - 24px);
    }
    
    /* Theme toggle small screens */
    .theme-toggle-switch {
        width: 40px;
        height: 20px;
    }
    
    .theme-toggle-slider:before {
        height: 14px;
        width: 14px;
        left: 3px;
        bottom: 3px;
    }
    
    .theme-toggle-switch input:checked + .theme-toggle-slider:before {
        transform: translateX(20px);
    }
    
    .toggle-icon {
        font-size: 9px;
    }
    
    .dropdown-menu {
        width: 180px;
    }
}

@media (max-width: 400px) {
    .logo-background {
        font-size: 1.8rem;
    }
    
    .watermark-text {
        font-size: 3rem;
    }
    
    .watermark-subtext {
        font-size: 0.9rem;
    }
    
    .fullform-typing {
        font-size: 0.75rem;
    }
    
    .chat-history-sidebar {
        padding: 16px;
        top: 16px;
        height: calc(100vh - 32px);
    }
    
    /* Theme toggle extra small */
    .theme-toggle-switch {
        width: 36px;
        height: 18px;
    }
    
    .theme-toggle-slider:before {
        height: 12px;
        width: 12px;
        left: 3px;
        bottom: 3px;
    }
    
    .theme-toggle-switch input:checked + .theme-toggle-slider:before {
        transform: translateX(18px);
    }
    
    .toggle-icon {
        font-size: 8px;
    }
}

/* Force hover effect on footer when not in special states */
.main-footer:not(.initial-visible):not(.no-hover) {
    cursor: pointer;
}

.main-footer:not(.initial-visible):not(.no-hover):hover {
    transform: translateY(0) !important;
    transition: transform 0.3s ease !important;
}

.chat-history-sidebar.active ~ .main-footer {
    transform: translateY(0) !important;
    pointer-events: none;
    z-index: 1;
}

.chat-history-sidebar.active ~ .main-footer * {
    pointer-events: auto;
}

/* Ensure messages are above watermark */
.message {
    position: relative;
    z-index: 2;
}

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

/* Chat container between them */
.chat-messages-container {
    position: relative;
    z-index: 1;
}



/* =========================================
   RICH TEXT DECORATION
   ========================================= */
/* Target content inside .message-text (created by script.js) */
.message-text strong { color: var(--text-color); font-weight: 700; }
.message-text em { color: var(--text-paragraph); font-style: italic; }

.message-text h1, .message-text h2, .message-text h3 {
    margin-top: 25px; margin-bottom: 15px;
    color: var(--text-color); font-weight: 700; line-height: 1.3;
}
.message-text h3 { font-size: 1.2rem; }

/* Lists */
.message-text ul, .message-text ol {
    margin-left: 25px; margin-bottom: 15px;
    padding-left: 0; color: var(--text-paragraph);
}
.message-text li { margin-bottom: 8px; line-height: 1.6; }
.message-text li::marker { color: var(--accent-color); font-weight: bold; }

/* Tables */
.message-text table {
    width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 0.95rem;
}
.message-text th, .message-text td {
    border: 1px solid var(--border-color); padding: 12px; text-align: left;
}
.message-text th {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--accent-color); font-weight: 600;
}

/* 🟢 CODE EDITOR STYLE (ChatGPT/Gemini) */
/* The outer box */
.code-wrapper {
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #1e1e1e; /* Dark background */
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

/* The header bar */
.code-header {
    display: flex; justify-content: space-between; align-items: center;
    background-color: #252526; /* Slightly lighter header */
    padding: 8px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem; color: #b0b0b0;
}

.code-lang { font-weight: 600; text-transform: uppercase; font-size: 0.75rem; }

.copy-code-btn {
    background: none; border: none; color: #b0b0b0; cursor: pointer;
    font-size: 0.8rem; display: flex; align-items: center; gap: 6px;
    transition: color 0.2s;
}
.copy-code-btn:hover { color: #fff; }

/* The code itself */
.code-wrapper pre {
    margin: 0 !important; padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

.code-wrapper pre code {
    padding: 15px; display: block; overflow-x: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem; line-height: 1.6;
    color: #d4d4d4; /* Light grey text */
}

/* Inline Code (Single backticks) */
.message-text :not(pre) > code {
    padding: 2px 6px; border-radius: 4px; font-family: monospace;
    background: rgba(99, 102, 241, 0.15); color: var(--accent-light);
    border: 1px solid rgba(99, 102, 241, 0.2);
}
