/* --- CSS Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
    color: #0b0b0f;
    background: #fff;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }

/* Screen-reader only utility */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

.hidden { display: none !important; }

:root {
    --primary: #0056b3;
    --primary-contrast: #ffffff;
    --accent: #00a0ff;
    --accent-secondary: #0056b3;
    --muted: #6b7280;
    --shadow: 0 10px 25px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.06);
    --radius-2xl: 36px;
    --container: 1200px;
}

/* --- decorative radial glows --- */
.bg-glow {
    position: fixed; inset: 0; pointer-events: none; z-index: -1; overflow: hidden;
    background:
        radial-gradient(800px 400px at 10% 70%, rgba(0, 160, 255, .15), transparent 60%),
        radial-gradient(800px 400px at 90% 75%, rgba(0, 86, 179, .15), transparent 60%),
        radial-gradient(600px 300px at 50% 20%, rgba(255, 62, 165, .1), transparent 60%),
        linear-gradient(135deg, rgba(240, 249, 255, 0.8) 0%, rgba(214, 240, 255, 0.8) 100%);
}

/* --- Container & layout --- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* --- Navbar --- */
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .2px; }
.brand .logo {
    display:inline-grid; place-items:center; width: 42px; height: 42px; border-radius: 14px;
    background: #0b0b0f; color: #fff; font-weight: 900; font-size: 20px; position: relative;
    box-shadow: var(--shadow);
}
.brand .logo::after {
    content: '';
    position: absolute; bottom: 8px; right: 8px; width: 12px; height: 12px; border-radius: 999px; background: var(--accent);
    box-shadow: 0 0 0 3px rgba(255,62,165,0.25);
}
.brand span { font-size: 22px; color: var(--primary); font-weight: 900; }

.nav-links { display: flex; align-items: center; gap: 28px; color: #1f2937; }
.nav-links a { opacity: .85; font-weight: 500; }
.nav-links a:hover { opacity: 1; }

.btn { display:inline-flex; align-items:center; justify-content:center; gap:10px; border:1px solid rgba(0,0,0,.08); background:#fff; color:#111; padding: 10px 16px; border-radius: 12px; cursor:pointer; box-shadow: 0 1px 2px rgba(0,0,0,.06); transition: transform .05s ease, box-shadow .2s ease; }
.btn:hover { box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--primary-contrast); border-color: transparent; padding: 12px 18px; border-radius: 14px; font-weight: 600; }

/* --- Hero --- */
.hero { text-align: center; padding: 56px 0 24px; }
.chip {
    display:inline-flex; align-items:center; gap:8px; padding: 10px 16px; border-radius: 999px; background: #e6f5ff;
    font-weight: 600; font-size: 14px; color: #0056b3; border: none;
}
.chip .accent { color: var(--primary); font-weight: 800; }

h1 { font-size: clamp(36px, 5.2vw, 64px); line-height: 1.05; margin: 18px 0 16px; letter-spacing: -0.02em; }
.sub { max-width: 880px; margin: 0 auto; color: #4b5563; font-size: clamp(16px, 2.2vw, 20px); }

/* --- Section styling --- */
.section-divider {
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    margin: 32px auto;
    border-radius: 2px;
}

.section-container {
    margin: 40px auto;
    max-width: 860px;
}

.section-title {
    font-size: 45px;
    font-weight: 700;
    text-align: center;
    color: #374151;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.section-description {
    text-align: center;
    color: #6b7280;
    font-size: 16px;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Mode Selection Cards --- */
.mode-selection {
    margin: 60px auto;
    max-width: var(--container);
    text-align: center;
}

.mode-title {
    font-size: 42px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 48px;
    letter-spacing: -0.02em;
}

.mode-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
    margin-top: 40px;
    padding: 0 24px;
}

.mode-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 40px 32px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.mode-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s;
}

.mode-card:hover::before {
    left: 100%;
}

.mode-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border-color: var(--accent);
}

.mode-card.selected {
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    color: white;
    border-color: var(--primary);
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 25px 50px rgba(0, 86, 179, 0.3);
}

.mode-card.selected .mode-icon {
    transform: scale(1.2);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.mode-card.selected h3 {
    color: white;
}

.mode-card.selected p {
    color: rgba(255, 255, 255, 0.9);
}

.mode-icon {
    font-size: 64px;
    margin-bottom: 24px;
    display: block;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.mode-card h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 16px 0;
    transition: color 0.3s ease;
}

.mode-card p {
    color: #6b7280;
    margin: 0 0 24px 0;
    line-height: 1.6;
    font-size: 16px;
    transition: color 0.3s ease;
}

.mode-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.feature-tag {
    background: rgba(0, 86, 179, 0.1);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(0, 86, 179, 0.2);
    transition: all 0.3s ease;
}

.mode-card.selected .feature-tag {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

/* --- Dynamic Form Container --- */
.dynamic-form-container {
    margin: 40px auto;
    max-width: 860px;
    min-height: 200px;
}

.mode-form {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.mode-form.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    display: block !important;
}

.form-header {
    text-align: center;
    margin-bottom: 32px;
}

.form-header .section-title {
    font-size: 36px;
    margin-bottom: 12px;
}

.form-description {
    color: #6b7280;
    font-size: 18px;
    margin: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* --- URL form --- */
.try-box { display:flex; align-items:center; gap: 10px; background: #f3f4f6; border: none;
    border-radius: var(--radius-2xl); padding: 10px; margin: 24px auto 12px; max-width: 860px; }

/* File upload button styling */
.file-upload-btn {
    white-space: nowrap;
    padding: 16px 18px;
    border-radius: 18px;
    font-weight: 600;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #374151;
}

.file-upload-btn:hover {
    background: #f1f5f9;
    border-color: var(--accent);
}

.file-upload-btn.has-files {
    background: #e6f5ff;
    border-color: var(--accent);
    color: var(--primary);
}
.try-input { flex: 7; background:#fff; border: 0; outline: none; font-size: 18px; padding: 20px 22px; border-radius: calc(var(--radius-2xl) - 6px); color:#111; width: 100%; }
.try-input::placeholder { color:#9ca3af; }
.auth-input { flex: 3; background:#fff; border: 0; outline: none; font-size: 16px; padding: 16px 18px; border-radius: calc(var(--radius-2xl) - 6px); color:#111; min-width: 120px; width: 100%; }
.auth-input::placeholder { color:#9ca3af; }

/* Business form specific proportions */
#business-form .try-input { flex: 7; }
#business-form .auth-input { flex: 3; }
#business-form .file-upload-btn { flex: 1; min-width: 80px; }
.try-btn { white-space: nowrap; padding: 18px 22px; border-radius: 18px; font-weight: 700; }
.fineprint { color: #6b7280; font-size: 14px; margin-top: 8px; }

/* --- File Upload Styling --- */
.file-upload-container {
    width: 100%;
    margin: 10px 0;
}

.file-input {
    display: none;
}

.file-drop-zone {
    border: 2px dashed #d1d5db;
    border-radius: calc(var(--radius-2xl) - 6px);
    background: #fff;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-drop-zone:hover {
    border-color: var(--accent);
    background: #f8fafc;
}

.file-drop-zone.dragover {
    border-color: var(--primary);
    background: #e6f5ff;
    transform: scale(1.02);
}

.file-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.file-upload-icon {
    font-size: 32px;
    opacity: 0.7;
}

.file-upload-text {
    font-weight: 600;
    color: #374151;
    font-size: 16px;
}

.file-upload-hint {
    color: #6b7280;
    font-size: 14px;
}

.file-list {
    margin-top: 12px;
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f3f4f6;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.file-item.csv-file {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-left: 4px solid #2196f3;
}

.file-item.pdf-file {
    background: linear-gradient(135deg, #fff3e0 0%, #fce4ec 100%);
    border-left: 4px solid #ff9800;
}

.file-item.txt-file {
    background: linear-gradient(135deg, #f1f8e9 0%, #e8f5e8 100%);
    border-left: 4px solid #4caf50;
}

.file-item-name {
    color: #374151;
    font-weight: 500;
}

.file-item-size {
    color: #6b7280;
    font-size: 12px;
}

.file-type-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    margin: 2px 0;
    display: inline-block;
}

.file-type-badge.csv {
    background: #2196f3;
    color: white;
}

.file-type-badge.pdf {
    background: #ff9800;
    color: white;
}

.file-type-badge.txt {
    background: #4caf50;
    color: white;
}

.file-item-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-size: 30px;
}

    .file-item-remove:hover {
        background: #fee2e2;
    }

/* --- Interactive Features Section --- */
.features-section {
    margin: 80px auto;
    max-width: var(--container);
    padding: 0 24px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 32px 24px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.feature-card:hover::before {
    left: 100%;
}

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

.feature-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 12px 0;
}

.feature-card p {
    color: #6b7280;
    margin: 0;
    line-height: 1.6;
}

.feature-hover {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    margin-top: 16px;
}

.feature-card:hover .feature-hover {
    opacity: 1;
    transform: translateY(0);
}

.feature-hover span {
    color: var(--accent);
    font-weight: 600;
    font-size: 14px;
}

/* --- Demo Section --- */
.demo-section {
    margin: 80px auto;
    max-width: var(--container);
    padding: 0 24px;
    text-align: center;
}

.demo-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 40px;
}

.demo-container {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    padding: 32px;
    max-width: 600px;
    margin: 0 auto;
}

.demo-chat {
    text-align: left;
}

.demo-message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.demo-message:nth-child(1) { animation-delay: 0.2s; }
.demo-message:nth-child(2) { animation-delay: 0.4s; }
.demo-message:nth-child(3) { animation-delay: 0.6s; }

.demo-message.user {
    flex-direction: row-reverse;
}

.demo-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.demo-message.bot .demo-avatar {
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: white;
}

.demo-message.user .demo-avatar {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.demo-content {
    background: #f8fafc;
    padding: 16px 20px;
    border-radius: 18px;
    max-width: 80%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.demo-message.user .demo-content {
    background: var(--primary);
    color: white;
}

.demo-content p {
    margin: 0;
    line-height: 1.5;
}



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

@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- Viewer --- */
.viewer { max-width: var(--container); margin: 16px auto 48px; padding: 0 24px; }
.viewer-bar { display:flex; align-items:center; justify-content:space-between; gap: 16px; padding: 10px 12px; background: #fff; border:1px solid rgba(0,0,0,.08); border-radius: 12px; box-shadow: var(--shadow); }
.viewer-info { display:flex; align-items:center; gap: 12px; font-weight: 700; }
.viewer-status { color: #6b7280; font-size: 14px; }

.frame-wrap { margin-top: 12px; height: min(80vh, 900px); background: #f8fafc; border:1px solid rgba(0,0,0,.08); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.frame-wrap iframe { width: 100%; height: 100%; border: 0; background: #fff; }

/* Business Learning Preview Styling */
.business-learning {
    text-align: center;
    padding: 60px 40px;
    background: linear-gradient(135deg, #f8fafc 0%, #e6f5ff 100%);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.learning-icon {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.8;
}

.business-learning h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 16px 0;
}

.business-learning p {
    font-size: 18px;
    color: #4b5563;
    margin: 0 0 32px 0;
    line-height: 1.6;
    max-width: 500px;
}

.learning-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 40px;
    max-width: 400px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.detail-icon {
    font-size: 20px;
}

.detail-item span:last-child {
    color: #374151;
    font-weight: 500;
}

.chat-prompt {
    background: rgba(255, 255, 255, 0.9);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.chat-prompt p {
    margin: 0 0 16px 0;
    color: #374151;
    font-weight: 600;
}

.chat-prompt .btn {
    font-size: 16px;
    padding: 12px 24px;
}

.chat-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Teach More Modal Styling */
.teach-more-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 24px;
}

.modal-body p {
    margin: 0 0 20px 0;
    color: #4b5563;
    font-size: 16px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px 24px 24px;
    border-top: 1px solid #e5e7eb;
}

.additional-file-list {
    margin-top: 16px;
}

.loading { display:flex; align-items:center; gap: 12px; padding: 10px 0; color: #374151; }
.spinner { width: 18px; height: 18px; border: 3px solid #ddd; border-top-color: #111; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.embed-problem { margin: 8px 0 0; padding: 10px 12px; background: #fff3f3; color: #7c1c1c; border: 1px solid #ffd1d1; border-radius: 10px; }

/* --- Chat Widget --- */
.chat-toggle {
    position: fixed; right: 24px; bottom: 24px; width: 64px; height: 64px; border-radius: 20px; background: var(--primary); color: #fff; border:0; cursor:pointer; box-shadow: var(--shadow);
    display:grid; place-items:center; font-weight: 800; font-size: 16px; z-index: 50;
}
.chat-toggle.disabled { opacity: .45; pointer-events: none; }

.chat-panel {
    position: fixed; right: 24px; bottom: 100px; width: min(420px, calc(100vw - 32px)); height: 560px; background: #fff; border-radius: 18px; box-shadow: var(--shadow);
    display:flex; flex-direction:column; overflow:hidden; border:1px solid rgba(0,0,0,.06); transform: translateY(10px); opacity: 0; pointer-events: none; transition: all .2s ease; z-index: 60;
}
.chat-panel.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
.chat-header { display:flex; align-items:center; justify-content:space-between; padding: 14px 16px; border-bottom:1px solid rgba(0,0,0,.06); }
.chat-title { display:flex; align-items:center; gap:10px; font-weight:800; }
.dot { width:10px; height:10px; background: var(--accent); border-radius:999px; box-shadow: 0 0 0 3px rgba(255,62,165,.18); }
.chat-body { flex:1; padding: 16px; overflow:auto; background: linear-gradient(180deg, rgba(250,250,255,.7), #fff 30%); }
.msg { max-width: 78%; padding: 12px 14px; border-radius: 14px; margin: 8px 0; box-shadow: 0 1px 1px rgba(0,0,0,.05); }
.msg.user { background: #f8f9fa; color: #111; border: 1px solid #e9ecef; border-bottom-right-radius: 4px; margin-left: auto; }
.msg.bot { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; border-bottom-left-radius: 4px; box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2); }

/* Thinking animation */
.thinking-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    animation: thinking-pulse 1.5s ease-in-out infinite;
}

@keyframes thinking-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Source indicator */
.source-indicator {
    margin-top: 8px;
    padding: 4px 8px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: inline-block;
    opacity: 0.8;
}

/* SQL query indicator */
.sql-indicator {
    margin-top: 6px;
    padding: 6px 10px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 11px;
    color: #374151;
    border-left: 3px solid #2196f3;
    font-family: monospace;
}

.sql-indicator code {
    background: #e5e7eb;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 10px;
}

/* Summarize button */
.summarize-container {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.summarize-button {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.summarize-button:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.summarize-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.summarize-button.show-full {
    background: rgba(255, 255, 255, 0.2);
}

/* PDF Generation button */
.pdf-generation-container {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdf-btn {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pdf-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}

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

/* Loading animation for summarize button */
.loading-dots {
    display: inline-block;
    position: relative;
}

.loading-dots::after {
    content: '';
    animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

.response-length {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}
.chat-footer { border-top:1px solid rgba(0,0,0,.06); padding: 10px; display:flex; gap: 8px; }
.chat-input { flex:1; resize:none; border:1px solid rgba(0,0,0,.12); border-radius: 12px; padding: 12px 12px; min-height: 46px; font: inherit; outline: none; }
.send-btn { padding: 0 16px; border-radius: 12px; background: var(--primary); min-width: 60px; }

/* --- Responsive --- */
@media (max-width: 920px) {
    .nav-links { display: none; }
    .hero { padding: 40px 0 20px; }
    .try-btn { padding: 16px 16px; }
    .try-input { font-size: 16px; padding: 16px 16px; }
}

@media (max-width: 768px) {
    .section-container {
        margin: 30px auto;
    }

    .section-title {
        font-size: 32px;
        margin-bottom: 18px;
    }

    /* Mode selection responsive */
    .mode-title {
        font-size: 32px;
        margin-bottom: 32px;
    }

    .mode-cards {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 0 16px;
    }

    .mode-card {
        padding: 32px 24px;
    }

    .mode-icon {
        font-size: 56px;
        margin-bottom: 20px;
    }

    .mode-card h3 {
        font-size: 22px;
    }

    .mode-card p {
        font-size: 15px;
    }

    .form-header .section-title {
        font-size: 28px;
    }

    .form-description {
        font-size: 16px;
    }

    .try-box {
        flex-direction: column;
        padding: 16px;
        gap: 12px;
    }
    .try-input, .auth-input {
        width: 100%;
        padding: 14px;
    }
    .try-btn {
        width: 100%;
        padding: 14px;
    }



    .file-drop-zone {
        padding: 20px;
        min-height: 100px;
    }

    .file-upload-icon {
        font-size: 28px;
    }

    .file-upload-text {
        font-size: 15px;
    }

    /* Responsive features grid */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .feature-card {
        padding: 24px 20px;
    }

    .feature-icon {
        font-size: 40px;
    }

    /* Responsive demo section */
    .demo-container {
        padding: 24px 20px;
    }

    .demo-title {
        font-size: 28px;
    }

    /* Responsive business learning preview */
    .business-learning {
        padding: 40px 24px;
    }

    .learning-icon {
        font-size: 48px;
        margin-bottom: 20px;
    }

    .business-learning h3 {
        font-size: 24px;
    }

    .business-learning p {
        font-size: 16px;
        margin-bottom: 24px;
    }

    .learning-details {
        gap: 12px;
        margin-bottom: 32px;
    }

    .detail-item {
        padding: 10px 16px;
    }

    .chat-prompt {
        padding: 20px;
    }

    /* Responsive modal */
    .modal-content {
        max-width: calc(100vw - 40px);
        margin: 20px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }

    .chat-actions {
        flex-direction: column;
        align-items: center;
    }

    .chat-panel {
        width: calc(100vw - 32px);
        bottom: 90px;
        height: 500px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 32px;
        margin: 16px 0 12px;
    }
    .sub {
        font-size: 16px;
    }
    .viewer-bar {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
    }
    .viewer-info {
        width: 100%;
        justify-content: space-between;
    }
    .frame-wrap {
        height: 70vh;
    }
    .chat-panel {
        right: 16px;
        left: 16px;
        width: auto;
        bottom: 80px;
        height: 450px;
    }
    .chat-toggle {
        right: 16px;
        bottom: 16px;
        width: 56px;
        height: 56px;
    }
    .chat-input {
        padding: 10px;
        font-size: 15px;
    }
    .send-btn {
        padding: 0 12px;
    }
    .msg {
        max-width: 85%;
        padding: 10px 12px;
    }
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
}

.modal-body {
    padding: 24px;
}

.modal-body .note {
    font-size: 14px;
    color: #6b7280;
    margin-top: 12px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}
