:root {
    --primary-color: #667eea;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-color: #f093fb;
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-color: #04f052;
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-color: #f093fb;
    --warning-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --error-color: #ff6b6b;
    --error-gradient: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    --info-color: #4facfe;
    --info-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    
    /* Light Theme */
    --bg-primary: #f8fafc;
    --bg-secondary: rgba(255, 255, 255, 0.9);
    --bg-tertiary: rgba(255, 255, 255, 0.6);
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: rgba(226, 232, 240, 0.8);
    --shadow-light: rgba(0, 0, 0, 0.05);
    --shadow-medium: rgba(0, 0, 0, 0.1);
    --shadow-heavy: rgba(0, 0, 0, 0.15);
}

.hero-title { font-size: 3.5rem !important; }
.tab-button { padding: 12px 24px !important; font-size: 14px !important; }
.sidebar { width: 320px !important; }
.app-container { flex-direction: row !important; padding: 20px !important; }
.chat-container { height: 600px !important; }
.upload-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important; }

[data-theme="dark"] {
    /* Dark Theme */
    --bg-primary: #0f172a;
    --bg-secondary: rgba(30, 41, 59, 0.9);
    --bg-tertiary: rgba(51, 65, 85, 0.6);
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: rgba(71, 85, 105, 0.8);
    --shadow-light: rgba(0, 0, 0, 0.2);
    --shadow-medium: rgba(0, 0, 0, 0.3);
    --shadow-heavy: rgba(0, 0, 0, 0.4);
}

/* Font Import and Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animated Background */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: var(--bg-primary);
}

.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(1px);
    animation: float 20s infinite linear;
    opacity: 0.1;
}

.shape-1 {
    width: 80px;
    height: 80px;
    background: var(--primary-gradient);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 120px;
    height: 120px;
    background: var(--secondary-gradient);
    top: 60%;
    right: 10%;
    animation-delay: -7s;
}

.shape-3 {
    width: 60px;
    height: 60px;
    background: var(--success-gradient);
    bottom: 20%;
    left: 20%;
    animation-delay: -14s;
}

.shape-4 {
    width: 100px;
    height: 100px;
    background: var(--warning-gradient);
    top: 30%;
    right: 30%;
    animation-delay: -10s;
}

.shape-5 {
    width: 90px;
    height: 90px;
    background: var(--info-gradient);
    bottom: 40%;
    right: 20%;
    animation-delay: -5s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    33% {
        transform: translateY(-30px) rotate(120deg);
    }
    66% {
        transform: translateY(30px) rotate(240deg);
    }
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.theme-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text-primary);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px var(--shadow-light);
}

.theme-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 40px var(--shadow-medium);
}

/* Glass Morphism Effect */
.glass-morphism {
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px var(--shadow-light);
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
    gap: 20px;
    padding: 20px;
}

/* Sidebar Styles - FIXED VERSION */
.sidebar {
    width: 320px;
    border-radius: 20px;
    position: sticky;
    top: 20px;
    height: calc(100vh - 40px); /* Fixed height */
    max-height: calc(100vh - 40px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideInLeft 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden; /* Keep this for the container */
}

.sidebar-content {
    padding: 30px;
    height: 100%;
    overflow-y: auto; /* This enables scrolling */
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

/* Custom scrollbar for webkit browsers */
.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 10px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #667eea 100%);
}


/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.section-header i {
    font-size: 18px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

/* Input Groups */
.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.input-wrapper input:focus {
    outline: none;
    border-color: transparent;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.password-toggle:hover {
    color: var(--text-secondary);
    background: var(--bg-tertiary);
}

/* Buttons */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.glass-btn {
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.btn-danger {
    background: var(--error-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.btn-info {
    background: var(--info-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-medium);
}

.btn:active {
    transform: translateY(0);
}

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

.button-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Library Styles */
.library-compact {
    font-size: 14px;
}

.library-section {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.library-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-light);
}

.library-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.library-header i {
    font-size: 16px;
    color: var(--primary-color);
}

.count-badge {
    background: var(--primary-gradient);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: auto;
}

.resource-list {
    margin-top: 8px;
}

.resource-list ul {
    list-style: none;
    padding: 0;
}

.resource-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 13px;
    word-wrap: break-word;
    word-break: break-all;
    overflow-wrap: break-word;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Add hover effect to show full text */
.resource-list li:hover {
    white-space: normal;
    overflow: visible;
    background: var(--bg-tertiary);
    border-radius: 4px;
    padding: 8px 4px;
    position: relative;
    z-index: 10;
}

/* For links in URL list */
.resource-list li a {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
    color: inherit;
}

.resource-list li a:hover {
    white-space: normal;
    text-decoration: underline;
}

.resource-list li:last-child {
    border-bottom: none;
}

.no-resources {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-style: italic;
    font-size: 13px;
    padding: 12px 0;
}

/* Status Messages */
.status-message {
    margin-top: 8px;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideInUp 0.3s ease;
    justify-content: center;
}

.status-message.success {
    background: linear-gradient(135deg, rgba(60, 231, 60, 0.304) 0%, rgba(60, 231, 60, 0.304) 100%);
    color: #f1f5f1; 
    border: 1px solid rgba(0, 128, 0, 0.2);
    align-items: center;
}

.status-message.error {
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.1) 0%, rgba(200, 0, 0, 0.1) 100%);
    color: #ff0000; 
    border: 1px solid rgba(255, 0, 0, 0.2);
    align-items: center;
}

.status-message.info {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.1) 0%, rgba(0, 242, 254, 0.1) 100%);
    color: var(--info-color);
    border: 1px solid rgba(79, 172, 254, 0.2);
    align-items: center;
}

.status-message.warning {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.1) 0%, rgba(245, 87, 108, 0.1) 100%);
    color: var(--warning-color);
    border: 1px solid rgba(240, 147, 251, 0.2);
    align-items: center;
}

.status-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.status-item {
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.status-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-item {
    text-align: center;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-indicator {
    margin-top: 8px;
}

.progress-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.progress-text {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Divider */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 30px 0;
}

/* Main Content */
.main-content {
    flex: 1;
    animation: slideInRight 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hero Section */
.main-header {
    margin-bottom: 30px;
}

.hero-section {
    text-align: center;
    padding: 40px 0;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brain-icon {
    font-size: 3rem;
    animation: pulse 2s infinite;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Alerts */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 10px;
    font-size: 14px;
    position: relative;
    animation: slideInDown 0.5s ease;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.1) 0%, rgba(245, 87, 108, 0.1) 100%);
    color: var(--warning-color);
    border: 1px solid rgba(240, 147, 251, 0.2);
    max-width: 800px;
}

.alert-info {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.1) 0%, rgba(0, 242, 254, 0.1) 100%);
    color: var(--info-color);
    border: 1px solid rgba(79, 172, 254, 0.2);
}

.alert-error {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1) 0%, rgba(238, 90, 82, 0.1) 100%);
    color: var(--error-color);
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.close-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.close-btn:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

/* Tabs */
.tabs-container {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}

.tabs {
    display: flex;
    border-radius: 16px;
    padding: 4px;
    gap: 4px;
}

.tab-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-button.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.tab-button:hover:not(.active) {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeInUp 0.5s ease;
}

.tab-content.active {
    display: block;
}

/* Upload Grid */
.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
    width: 100%;
}

.upload-card {
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px var(--shadow-medium);
}

.upload-card.full-width {
    grid-column: 1 / -1;
}

.upload-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.upload-header i {
    font-size: 20px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.upload-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.upload-body {
    padding: 20px;
}

/* File Drop Zone */
.file-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-tertiary);
    margin-bottom: 16px;
}

.file-drop-zone:hover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.file-drop-zone.dragover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.02);
}

.file-drop-zone i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 16px;
    display: block;
}

.file-drop-zone p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

/* URL Form */
.url-form {
    width: 100%;
}

.url-input-group {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.url-input-group .input-wrapper {
    flex: 1;
    min-width: 200px;
}

.url-input-group .input-wrapper i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.url-input-group .input-wrapper input {
    padding-left: 40px;
}

/* Chat Container */
.chat-container {
    border-radius: 16px;
    overflow: hidden;
    height: 600px;
    display: flex;
    flex-direction: column;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.chat-header h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chat-header i {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.online {
    background: var(--success-color);
}

/* Chat History */
.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-primary);
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

.chat-history::-webkit-scrollbar {
    width: 4px;
}

.chat-history::-webkit-scrollbar-track {
    background: transparent;
}

.chat-history::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 4px;
}

.welcome-message {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
}

.welcome-content {
    padding: 40px;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
}

.welcome-content i {
    font-size: 48px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    display: block;
}

.welcome-content h4 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.welcome-content p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

/* Chat Messages */
.user-message {
    background: var(--primary-gradient);
    color: white;
    padding: 16px 20px;
    border-radius: 20px 20px 8px 20px;
    margin: 8px 0 8px auto;
    max-width: 80%;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    animation: slideInRight 0.3s ease;
    position: relative;
}

.assistant-message {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 16px 20px;
    border-radius: 20px 20px 20px 8px;
    margin: 8px auto 8px 0;
    max-width: 80%;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    animation: slideInLeft 0.3s ease;
    position: relative;
}

.assistant-message.error {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1) 0%, rgba(238, 90, 82, 0.1) 100%);
    border-color: rgba(255, 107, 107, 0.2);
    color: var(--error-color);
}

/* Loading Animation */
.loading-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-radius: 20px;
    margin: 8px auto 8px 0;
    max-width: 200px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
}

.thinking-animation {
    display: flex;
    gap: 4px;
}

.thinking-animation .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: thinking 1.4s ease-in-out infinite both;
}

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

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

/* Chat Form */
.chat-form {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.chat-input-container .input-wrapper {
    position: relative;
    width: 100%;
}

.chat-input-container input {
    width: 100%;
    padding: 16px 60px 16px 20px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    resize: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.chat-input-container input:focus {
    outline: none;
    border-color: transparent;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
}

.send-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.send-btn:hover:not(:disabled) {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.send-btn:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

/* Animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .app-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .sidebar {
        width: 100%;
        position: relative;
        top: 0;
        max-height: none;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .upload-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 10px;
    }
    
    .sidebar-content {
        padding: 20px;
    }
    
    .hero-title {
        font-size: 2rem;
        flex-direction: column;
        gap: 8px;
    }
    
    .brain-icon {
        font-size: 2rem;
    }
    
    .tabs {
        width: 100%;
        justify-content: stretch;
    }
    
    .tab-button {
        flex: 1;
        justify-content: center;
    }
    
    .chat-container {
        height: 500px;
    }
    
    .user-message, .assistant-message {
        max-width: 95%;
    }
    
    .url-input-group {
        flex-direction: column;
    }
    
    .url-input-group .input-wrapper {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .file-drop-zone {
        padding: 30px 15px;
    }
    
    .file-drop-zone i {
        font-size: 36px;
    }
    
    .welcome-content {
        padding: 30px 20px;
    }
    
    .welcome-content i {
        font-size: 36px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .sidebar, .theme-toggle, .background-animation {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .glass-morphism {
        background: white;
        border: 1px solid #ddd;
        backdrop-filter: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --shadow-light: rgba(0, 0, 0, 0.3);
        --shadow-medium: rgba(0, 0, 0, 0.5);
        --shadow-heavy: rgba(0, 0, 0, 0.7);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .floating-shapes {
        display: none;
    }
}

/* Markdown Content Styling */
.markdown-content {
    line-height: 1.6;
    margin-top: 8px;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
    color: var(--text-primary);
}

.markdown-content h1 { font-size: 1.5em; }
.markdown-content h2 { font-size: 1.3em; }
.markdown-content h3 { font-size: 1.1em; }

.markdown-content p {
    margin-bottom: 1em;
}

.markdown-content strong {
    font-weight: 600;
    color: var(--text-primary);
}

.markdown-content em {
    font-style: italic;
    color: var(--text-secondary);
}

.markdown-content ul,
.markdown-content ol {
    margin: 1em 0;
    padding-left: 2em;
}

.markdown-content li {
    margin-bottom: 0.5em;
}

.markdown-content code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--primary-color);
}

.markdown-content pre {
    background: var(--bg-tertiary);
    padding: 1em;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1em 0;
    border: 1px solid var(--border-color);
}

.markdown-content pre code {
    background: none;
    padding: 0;
    font-size: 0.9em;
}

.markdown-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1em;
    margin: 1em 0;
    color: var(--text-secondary);
    font-style: italic;
    background: var(--bg-tertiary);
    padding: 1em;
    border-radius: 0 8px 8px 0;
}

.markdown-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.markdown-content a:hover {
    border-bottom-color: var(--primary-color);
}

.markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

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

.markdown-content th {
    background: var(--bg-tertiary);
    font-weight: 600;
}

.markdown-content hr {
    border: none;
    height: 1px;
    background: var(--border-color);
    margin: 2em 0;
}
