@import url("https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap");

/* CSS Variables for Theme System */
:root {
    /* Light Mode Colors */
    --bg-primary: #f7f7f8;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f9fafb;
    --text-primary: #1a1a1a;
    --text-secondary: #6b7280;
    --text-tertiary: #374151;
    --border-primary: #e5e5e5;
    --border-secondary: #d1d5db;
    --border-tertiary: #f3f4f6;
    --shadow-primary: rgba(0, 0, 0, 0.1);
    --shadow-secondary: rgba(0, 0, 0, 0.05);
    --shadow-tertiary: rgba(0, 0, 0, 0.02);
    --accent-primary: #007bff;
    --accent-hover: #0056b3;
    --accent-light: #eff6ff;
    --success-bg: #d1fae5;
    --success-text: #065f46;
    --success-border: #10b981;
    --danger-bg: #fee2e2;
    --danger-text: #991b1b;
    --danger-border: #ef4444;
    --warning-bg: #fef3c7;
    --warning-text: #92400e;
    --warning-border: #f59e0b;

    /* Additional variables for thinking functionality */
    --text-color: #374151;
    --text-color-secondary: #6b7280;
    --border-color: #e5e7eb;
    --code-bg: #f8fafc;
    --button-hover-bg: #f3f4f6;
    --ai-message-bg: #ffffff;
}

/* Dark Mode Colors */
[data-theme="dark"] {
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #e5e7eb;
    --text-tertiary: #9ca3af;
    --border-primary: #374151;
    --border-secondary: #4b5563;
    --border-tertiary: #6b7280;
    --shadow-primary: rgba(0, 0, 0, 0.3);
    --shadow-secondary: rgba(0, 0, 0, 0.2);
    --shadow-tertiary: rgba(0, 0, 0, 0.1);
    --accent-primary: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: #1e3a8a;
    --success-bg: #064e3b;
    --success-text: #6ee7b7;
    --success-border: #10b981;
    --danger-bg: #7f1d1d;
    --danger-text: #fca5a5;
    --danger-border: #ef4444;
    --warning-bg: #78350f;
    --warning-text: #fcd34d;
    --warning-border: #f59e0b;
    /* Form elements for dark mode */
    --input-bg: #374151;
    --input-text: #f9fafb;
    --input-border: #4b5563;
    --input-placeholder: #9ca3af;
    /* Dark mode variables for thinking functionality */
    --text-color: #f9fafb;
    --text-color-secondary: #9ca3af;
    --border-color: #4b5563;
    --code-bg: #374151;
    --button-hover-bg: #4b5563;
    --ai-message-bg: #1f2937;
}

/* Auto theme detection */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg-primary: #111827;
        --bg-secondary: #1f2937;
        --bg-tertiary: #374151;
        --text-primary: #f9fafb;
        --text-secondary: #e5e7eb; /* Lighter for better contrast */
        --text-tertiary: #9ca3af;
        --border-primary: #374151;
        --border-secondary: #4b5563;
        --border-tertiary: #6b7280;
        --shadow-primary: rgba(0, 0, 0, 0.3);
        --shadow-secondary: rgba(0, 0, 0, 0.2);
        --shadow-tertiary: rgba(0, 0, 0, 0.1);
        --accent-primary: #3b82f6;
        --accent-hover: #2563eb;
        --accent-light: #1e3a8a;
        --success-bg: #064e3b;
        --success-text: #6ee7b7;
        --success-border: #10b981;
        --danger-bg: #7f1d1d;
        --danger-text: #fca5a5;
        --danger-border: #ef4444;
        --warning-bg: #78350f;
        --warning-text: #fcd34d;
        --warning-border: #f59e0b;
    }
}

/* Header Bar */
.chat-header {
    height: 76px !important;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-secondary);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px var(--shadow-tertiary);
    z-index: 1000;
    position: sticky;
    top: 0;
}

.chat-header .logo {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.chat-header .user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chat-header .welcome-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.chat-header .nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.chat-header .nav-link:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-tertiary);
}

.chat-header button.nav-link {
    background: none !important;
    border: none !important;
    cursor: pointer;
    margin: 0;
    padding: 0.5rem 0.75rem;
}
.logo-icon {
    width: 40px;
    height: 40px;
}

@media (max-width: 768px) {
    .chat-header {
        padding: 0.5rem 1rem;
    }

    .chat-header .logo {
        font-size: 1.125rem;
    }
    
}

/* User Dropdown Menu */
.user-dropdown {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-dropdown:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-tertiary);
}

.user-dropdown .username {
    font-weight: 500;
}

.user-dropdown .bi-chevron-down {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.user-dropdown[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-tertiary);
}
/* Dropdown menu - Dark mode */
[data-theme="dark"] .dropdown-menu {
    background-color: var(--bg-secondary);
    border-color: var(--border-secondary);
}

[data-theme="dark"] .dropdown-item {
    color: var(--text-primary);
}

[data-theme="dark"] .dropdown-item:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

[data-theme="dark"] .dropdown-divider {
    border-color: var(--border-secondary);
}

.bi-person-circle {
    font-size: 1.5rem !important;
    color: var(--text-primary);
}

#headerLeft a :not(.logo){
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.5rem;
}