* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --secondary: #7C3AED;
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #FFFFFF;
    color: var(--gray-900);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gray-200);
    z-index: 100;
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--gray-900);
}

.logo-text {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.ai-badge {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 0.875rem;
    font-weight: 800;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-cta {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white !important;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
}

.nav-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

/* Language Toggle */
.language-toggle {
    display: flex;
    gap: 0;
    background: var(--gray-100);
    border-radius: 0.5rem;
    padding: 0.25rem;
}

.lang-btn {
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
}

.lang-btn:hover {
    color: var(--gray-900);
}

.lang-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Hero Section */
.hero {
    margin-top: 60px;
    padding: 2rem 2rem 4rem 2rem;
    background: linear-gradient(180deg, var(--gray-50) 0%, #FFFFFF 100%);
}

.hero-container {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.right-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(124, 58, 237, 0.1));
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 2rem;
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--gray-600);
    line-height: 1.8;
}

/* Multilingual Highlight Box - Compact */
.multilingual-highlight {
    background: linear-gradient(135deg, #10B981, #3B82F6);
    border-radius: 0.875rem;
    padding: 1rem 1.25rem;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.multilingual-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.multilingual-content-compact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.multilingual-badges-inline {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.multilingual-badges-inline .flag {
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.multilingual-text {
    color: white;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.multilingual-text strong {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.check-text {
    font-size: 0.9375rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

.stats {
    display: flex;
    gap: 3rem;
    margin-top: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* Upload Card */
.upload-card {
    background: white;
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.card-header {
    margin-bottom: 1.25rem;
}

.card-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.card-header p {
    color: var(--gray-600);
    font-size: 0.9375rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

.form-label svg {
    color: var(--gray-400);
}

.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all 0.2s;
    background: white;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.help-text {
    display: block;
    margin-top: 0.5rem;
    color: var(--gray-500);
    font-size: 0.8125rem;
}

.help-text a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.help-text a:hover {
    text-decoration: underline;
}

/* Prominent API Key Help */
.api-key-help-prominent {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(59, 130, 246, 0.1));
    border: 2px solid rgba(16, 185, 129, 0.3);
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
}

.api-key-help-prominent .icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.api-key-help-prominent a {
    color: var(--success);
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.api-key-help-prominent a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.api-key-help-prominent .text {
    color: var(--gray-700);
    flex: 1;
}

/* API Key Modal */
.api-key-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 400;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.api-key-modal.active {
    display: flex;
}

.api-key-modal-content {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

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

.api-key-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.api-key-modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.api-key-modal-close {
    background: transparent;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.api-key-modal-close:hover {
    color: var(--gray-600);
}

.api-key-modal-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.api-key-step {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 0.75rem;
    border-left: 4px solid var(--success);
}

.api-key-step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--success), #3B82F6);
    color: white;
    font-weight: 700;
    border-radius: 50%;
    font-size: 0.875rem;
}

.api-key-step-content {
    flex: 1;
}

.api-key-step-content p {
    color: var(--gray-700);
    line-height: 1.6;
    margin: 0;
}

.api-key-step-content a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.api-key-step-content a:hover {
    text-decoration: underline;
}

.api-key-step-content strong {
    color: var(--gray-900);
    font-weight: 700;
}

/* File Upload */
.file-upload-wrapper {
    position: relative;
}

.file-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    border: 2px dashed var(--gray-300);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--gray-50);
    color: var(--gray-600);
    font-weight: 500;
}

.file-upload-label:hover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
    color: var(--primary);
}

/* Buttons */
.btn-primary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4);
}

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

.btn-ghost {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--gray-600);
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

/* Status Messages */
.status-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    display: none;
}

.status-message.success {
    display: block;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-message.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-message.info {
    display: block;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    border: 1px solid rgba(79, 70, 229, 0.2);
}

/* Features Section */
.features {
    padding: 3rem 2rem;
    background: white;
}

.section-container {
    max-width: 1280px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.125rem;
    color: var(--gray-600);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.feature-card {
    padding: 2rem;
    background: var(--gray-50);
    border-radius: 1rem;
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--gray-600);
    line-height: 1.6;
}

/* How It Works */
.how-it-works {
    padding: 3rem 2rem;
    background: linear-gradient(180deg, white 0%, var(--gray-50) 100%);
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.step-number {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-size: 1.75rem;
    font-weight: 700;
    border-radius: 50%;
    margin-bottom: 1.5rem;
}

.step-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.75rem;
}

.step-content p {
    color: var(--gray-600);
    line-height: 1.6;
}

/* Chat Overlay */
.chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.chat-overlay.active {
    display: flex;
}

.chat-container {
    width: 100%;
    max-width: 900px;
    height: 90vh;
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

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

.status-indicator {
    width: 12px;
    height: 12px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.chat-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.125rem;
}

.chat-subtitle {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Messages */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: white;
}

.welcome-message {
    text-align: center;
    padding: 3rem 2rem;
}

.welcome-icon {
    display: inline-block;
    margin-bottom: 1.5rem;
}

.welcome-message h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.welcome-message p {
    color: var(--gray-600);
    margin-bottom: 2rem;
}

.example-questions {
    max-width: 600px;
    margin: 0 auto;
}

.example-label {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 1rem;
}

.example-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.chip {
    padding: 0.5rem 1rem;
    background: var(--gray-100);
    border-radius: 2rem;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.message {
    margin-bottom: 1.5rem;
    animation: fadeIn 0.3s;
}

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

.message-header {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.message-content {
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    line-height: 1.6;
}

.message.user .message-header {
    color: var(--primary);
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    margin-left: auto;
    max-width: 70%;
    border-bottom-right-radius: 0.25rem;
}

.message.assistant .message-header {
    color: var(--gray-700);
}

.message.assistant .message-content {
    background: var(--gray-100);
    color: var(--gray-900);
    max-width: 85%;
    border-bottom-left-radius: 0.25rem;
}

.sources {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    font-size: 0.875rem;
}

.sources-header {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--gray-700);
}

.source-item {
    margin: 0.5rem 0;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    color: var(--gray-600);
    border-left: 3px solid var(--primary);
    line-height: 1.5;
}

/* Input Container */
.input-container {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--gray-200);
    background: white;
}

.input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--gray-200);
    border-radius: 2rem;
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all 0.2s;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn-send {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-send:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

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

.input-hint {
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: var(--gray-500);
    text-align: center;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    text-align: center;
}

.spinner {
    width: 64px;
    height: 64px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    color: white;
    font-size: 1.125rem;
    font-weight: 500;
}

/* Footer */
.footer {
    padding: 2rem 2rem;
    background: var(--gray-900);
    color: white;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
}

.footer-content {
    text-align: center;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.footer-text {
    color: var(--gray-400);
    margin-bottom: 0.5rem;
}

.footer-copyright {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .steps {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
    }

    .nav-links a:not(.nav-cta) {
        display: none;
    }

    .language-toggle {
        order: -1;
    }

    .hero {
        padding: 2rem 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .stats {
        gap: 1.5rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .section-header h2 {
        font-size: 1.875rem;
    }

    .chat-container {
        height: 100vh;
        border-radius: 0;
    }

    .message.user .message-content,
    .message.assistant .message-content {
        max-width: 90%;
    }
}
