:root {
    /* Color Variables (unchanged) */
    --primary-dark: #0f172a;
    --primary: #1e293b;
    --primary-light: #334155;
    --accent: #3b82f6;
    --accent-light: #60a5fa;
    --text: #f8fafc;
    --text-secondary: #94a3b8;
    --user-message-text: #1e293b;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --bg-elevated: rgba(30, 41, 59, 0.9);
    --bg-hover: rgba(255, 255, 255, 0.1);
    --sidebar-width: 280px;
    --nav-height: 60px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

:root[data-theme="light"] {
    /* Light theme variables (unchanged) */
    --primary-dark: #f1f5f9;
    --primary: #f8fafc;
    --primary-light: #e2e8f0;
    --text: #1e293b;
    --text-secondary: #64748b;
    --user-message-text: #ffffff;
    --bg-elevated: rgba(255, 255, 255, 0.95);
    --bg-hover: rgba(0, 0, 0, 0.03);
    --shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Base Styles (unchanged) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

/* Navbar Styles */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background-color: var(--primary-dark);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none;
    font-family: 'Orbitron', sans-serif;
    z-index: 101;
}

.nav-links {
    display: flex;
    gap: 20px;
    margin-left: auto;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
}

.nav-hamburger {
	display: none;
    background: transparent !important;
    border: none !important;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: auto;
    padding: 8px;
}

.flag-icon {
    font-size: 1.5rem; /* Adjust size as needed */
    transition: transform 0.3s ease;
}

.flag-icon:hover {
    transform: scale(1.1); /* Optional: slight zoom on hover */
}

.logo-text {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: teal;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.logo-text:hover {
    color: #008080;
}

.main-container {
    display: flex;
    min-height: 100vh;
    padding-top: var(--nav-height);
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 24px 0;
    position: fixed;
    top: var(--nav-height);
    right: 0;
    bottom: 0;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 0 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 16px;
}

.sidebar-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.tool-card-link {
    text-decoration: none;
    color: inherit;
}

.tool-card {
    padding: 12px 24px;
    margin: 8px 0;
    border-radius: 0px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.tool-card:hover {
    background-color: var(--bg-hover);
}

.tool-card.active {
    background-color: var(--accent);
    color: white;
}

.tool-card.demo {
    padding: 12px 24px;
    margin: 8px 0;
    border-radius: 0px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.tool-card h3 {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.tool-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.tool-card.active p {
    color: rgba(255, 255, 255, 0.8);
}

.tool-card.disabled {
    background-color: rgba(150, 150, 150, 0.3);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    pointer-events: none;
    border-left: 4px solid rgba(200, 200, 200, 0.5);
}

.tool-card.disabled h3,
.tool-card.disabled p {
    color: rgba(255, 255, 255, 0.5);
}

.main-content {
    flex: 1;
    padding: 24px;
    margin-right: var(--sidebar-width);
    transition: margin-right 0.3s ease;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--nav-height) - 48px);
    gap: 16px;
    padding-bottom: 80px; /* Add space for input area */
}

.chat-container {
    height: calc(100vh - var(--nav-height) - 120px);
    min-height: 400px;
    width: 100%;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-elevated);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
    padding-bottom: 100px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: var(--accent);
    border-radius: 4px;
}

.user-message {
    align-self: flex-end;
    background-color: var(--accent);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-bottom: 6px;
}

.input-area {
    position: fixed;
    left: 24px;
    right: 24px;
    bottom: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 16px;
    background-color: var(--bg-elevated);
    display: flex;
    gap: 12px;
    align-items: flex-end;
    z-index: 10;
}

/* Updated textarea styles for better contrast */
textarea {
    flex: 1;
    padding: 14px 18px;
    border-radius: 24px;
    color: #1e293b; /* Dark text for both themes */
    background-color: rgba(255, 255, 255, 0.95);
    border: none;
    outline: none;
    font-size: 0.95rem;
    min-height: 50px;
    max-height: 150px;
    resize: none;
    transition: all 0.2s ease;
}

textarea:focus {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4);
}

button {
    padding: 12px 20px;
    border-radius: 24px;
    background-color: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    height: 50px;
    flex-shrink: 0;
}

button:hover {
    background-color: var(--accent-light);
    transform: translateY(-2px);
}

button:disabled {
    background-color: var(--primary-light);
    cursor: not-allowed;
    transform: none;
}

.settings-panel {
    background-color: var(--bg-elevated);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.settings-title {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.settings-title:hover {
    background-color: var(--bg-hover);
}

.settings-content {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.settings-content:not(.hidden) {
    padding: 20px;
    max-height: 600px;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text);
}

.input-group input[type="text"],
.input-group input[type="file"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background-color: var(--primary-light);
    color: var(--text);
    font-size: 0.9rem;
}

/* Updated file info styles */
.file-info {
    font-size: 0.75rem;
    margin-top: 4px;
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

.file-info.success {
    color: var(--success);
}

.file-info.error {
    color: var(--error);
}

.file-info.processing {
    color: var(--warning);
}

/* Updated reference info styles */
.reference-info {
    font-size: 0.85rem;
    padding: 12px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    margin-top: 12px;
    border-left: 3px solid var(--accent);
}

.status-success {
    color: var(--success);
    font-weight: 600;
}

.status-partial {
    color: var(--warning);
    font-weight: 600;
}

.status-error {
    color: var(--error);
    font-weight: 600;
}

.status-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: rgba(16, 185, 129, 0.1);
    margin-right: 6px;
}

.status-error.status-badge {
    background-color: rgba(239, 68, 68, 0.1);
}

.status-partial.status-badge {
    background-color: rgba(245, 158, 11, 0.1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes typingDots {
    0% { opacity: 0.2; }
    50% { opacity: 1; }
    100% { opacity: 0.2; }
}

.color-scheme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 16px;
}

.color-scheme-toggle:hover {
    background-color: var(--bg-hover);
}

.menu-toggle {
    display: none !important;
}

@media (max-width: 1024px) {
    .chat-container {
        height: calc(100vh - var(--nav-height) - 160px);
    }
}

@media (max-width: 768px) {
    /* Adjust chat container height */
    .chat-container {
        height: calc(100vh - var(--nav-height) - 100px);
    }
    
    /* Adjust input area */
    .input-area {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }
    
    /* Smaller navbar padding */
    .navbar {
        padding: 0 16px;
    }
}

@media (max-width: 768px) {
    .input-area {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }
    
    .chat-container {
        height: calc(100vh - var(--nav-height) - 100px);
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 16px;
    }
    .container {
        padding: 16px;
        height: calc(100vh - var(--nav-height) - 32px);
    }
    .message {
        max-width: 90%;
        padding: 14px 16px;
        font-size: 0.9rem;
    }
    .input-area {
        padding: 12px;
        left: 12px;
        right: 12px;
        bottom: 12px;
    }
    textarea {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    button {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

.hidden {
    display: none;
}

button i.fas.fa-paper-plane {
    font-size: 0.9rem;
    margin-right: -4px;
}

@media (max-width: 768px) {
    button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    button i.fas.fa-paper-plane {
        font-size: 0.85rem;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        width: 280px;
        right: -280px; /* Hide off-screen by default */
        top: var(--nav-height);
        bottom: 0;
        transition: transform 0.3s ease;
        z-index: 100;
        box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
    }

    .sidebar.open {
        transform: translateX(-100%); /* Slide in when open */
    }

    /* When sidebar is open, push content left */
    .sidebar.open ~ .main-content {
        margin-right: 280px;
    }

    /* Navbar hamburger styles */Tool cards
    .nav-hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: var(--text);
        font-size: 1.25rem;
        cursor: pointer;
        padding: 8px;
        margin-left: 12px;
    }

    /* Hide regular nav links on mobile */
    .nav-links {
        display: flex;
    }
}

@media (max-width: 1024px) {
    /* Hide regular nav links and show hamburger */
    .nav-links {
        display: flex;
    }
    
    .nav-hamburger {
        display: flex;
    }
    
    /* Sidebar behavior */
    .sidebar {
        transform: translateX(100%);
        width: 280px;
        z-index: 100;
        box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    /* Main content takes full width */
    .main-content {
        margin-right: 0;
        width: 100%;
    }
    
    /* Overlay when sidebar is open */
    .sidebar.open ~ .main-content::after {
        content: '';
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 99;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px; /* Height of navbar */
        left: 0;
        width: 100%;
        background-color: #1a1a1a;
        padding: 1rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }

    .nav-links.open {
        display: flex !important;
    }

    /* Optional: Add fade-in animation */
    .nav-links {
        animation: fadeIn 0.3s ease forwards;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1024px) {
    .nav-hamburger {
        display: flex;
    }
}

@media (max-width: 768px) {
    /* Show hamburger menu on mobile */
    .nav-hamburger {
        display: block;
    }
    
    /* Hide regular nav links by default on mobile */
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px; /* Match your navbar height */
        left: 0;
        width: 100%;
        background-color: #1a1a1a;
        padding: 1rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }
    
    /* Show nav links when menu is open */
    .nav-links.open {
        display: flex;
    }
}