@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg-card: rgba(15, 23, 42, 0.76);
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --text-soft: #94a3b8;
    --cyan: #67e8f9;
    --button-start: #4f46e5;
    --button-mid: #6d28d9;
    --button-end: #0e7490;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', Arial, sans-serif;
    min-height: 100vh;
    color: var(--text-main);
    background:
        radial-gradient(circle at 8% 8%, rgba(79, 70, 229, 0.35), transparent 31%),
        radial-gradient(circle at 88% 12%, rgba(14, 116, 144, 0.28), transparent 28%),
        radial-gradient(circle at 18% 88%, rgba(109, 40, 217, 0.22), transparent 30%),
        linear-gradient(135deg, #020617 0%, #07111f 45%, #101827 100%);
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.032) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.032) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.86), transparent 82%);
    pointer-events: none;
    z-index: 0;
}

.floating-shape {
    position: fixed;
    border-radius: 999px;
    filter: blur(70px);
    opacity: 0.42;
    pointer-events: none;
    z-index: 0;
    animation: floatGlow 12s ease-in-out infinite alternate;
}

.shape-one {
    width: 300px;
    height: 300px;
    top: 90px;
    left: -90px;
    background: rgba(99, 102, 241, 0.42);
}

.shape-two {
    width: 360px;
    height: 360px;
    top: 210px;
    right: -130px;
    background: rgba(14, 165, 233, 0.24);
    animation-delay: 1.2s;
}

.shape-three {
    width: 280px;
    height: 280px;
    bottom: -95px;
    left: 28%;
    background: rgba(168, 85, 247, 0.26);
    animation-delay: 2s;
}

@keyframes floatGlow {
    from {
        transform: translate3d(0, 0, 0) scale(1);
    }

    to {
        transform: translate3d(18px, -18px, 0) scale(1.06);
    }
}

.page-wrapper {
    width: 100%;
    max-width: 1220px;
    margin: 0 auto;
    padding: 46px 20px 58px;
    position: relative;
    z-index: 1;
}

/* HERO */

.hero-section {
    text-align: center;
    margin-bottom: 38px;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.15);
    color: #c7d2fe;
    border: 1px solid rgba(129, 140, 248, 0.34);
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 14px;
    margin-bottom: 20px;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.16);
    backdrop-filter: blur(14px);
}

.hero-section h1 {
    max-width: 980px;
    margin: 0 auto 20px;
    font-size: clamp(40px, 5.4vw, 66px);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.035em;
    background: linear-gradient(90deg, #ffffff 0%, #dbeafe 38%, #c4b5fd 68%, #67e8f9 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    padding-bottom: 5px;
}

.hero-subtitle {
    max-width: 820px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 17px;
    line-height: 1.75;
}

/* FEATURE CARDS */

.feature-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 34px;
}

.feature-card {
    text-align: left;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.66), rgba(15, 23, 42, 0.46));
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 22px;
    padding: 20px;
    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(18px);
}

.feature-card span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 30px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.17);
    color: #c4b5fd;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 14px;
}

.feature-card h3 {
    color: var(--text-main);
    font-size: 17px;
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.6;
}

/* APP */

.app-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 30px;
    padding: 28px;
    box-shadow:
        0 28px 90px rgba(0, 0, 0, 0.44),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px);
    overflow: hidden;
}

.app-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top left, rgba(99, 102, 241, 0.16), transparent 36%),
        radial-gradient(circle at bottom right, rgba(6, 182, 212, 0.10), transparent 38%);
    pointer-events: none;
}

.section-heading,
.upload-grid,
.input-grid,
.result-section,
.action-row,
.assistant-section {
    position: relative;
    z-index: 1;
}

.section-heading {
    margin-bottom: 20px;
}

.section-heading p,
.result-header p,
.assistant-header p {
    color: var(--cyan);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 7px;
}

.section-heading h2,
.assistant-header h2 {
    color: var(--text-main);
    font-size: 26px;
    line-height: 1.25;
}

/* UPLOAD */

.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.upload-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: stretch;
    padding: 20px;
    border-radius: 24px;
    background: rgba(2, 6, 23, 0.38);
    border: 1px solid rgba(148, 163, 184, 0.20);
}

.upload-text h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.upload-text p {
    color: var(--text-soft);
    line-height: 1.6;
    font-size: 14.5px;
}

.upload-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 135px;
    border: 1.5px dashed rgba(103, 232, 249, 0.40);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.78), rgba(2, 6, 23, 0.70));
    cursor: pointer;
    transition: all 0.22s ease;
    padding: 18px;
    text-align: center;
}

.upload-box:hover {
    border-color: rgba(103, 232, 249, 0.72);
    box-shadow: 0 0 34px rgba(6, 182, 212, 0.12);
}

.upload-box input {
    display: none;
}

.upload-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.18);
    color: #bfdbfe;
    font-weight: 900;
    font-size: 22px;
}

.upload-title {
    font-weight: 800;
    color: #f8fafc;
}

.upload-file-name {
    color: #94a3b8;
    font-size: 13px;
    word-break: break-word;
}

/* INPUT */

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.input-box {
    display: flex;
    flex-direction: column;
}

.input-box label {
    font-weight: 700;
    margin-bottom: 10px;
    color: #e5e7eb;
    font-size: 15px;
}

.input-box label span {
    color: #94a3b8;
    font-weight: 600;
    font-size: 12.5px;
}

textarea {
    width: 100%;
    min-height: 300px;
    resize: vertical;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 22px;
    padding: 18px;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.65;
    outline: none;
    background: rgba(2, 6, 23, 0.66);
    color: var(--text-main);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 18px 45px rgba(0, 0, 0, 0.17);
}

textarea::placeholder {
    color: #64748b;
}

textarea:focus {
    border-color: rgba(103, 232, 249, 0.76);
    background: rgba(2, 6, 23, 0.86);
}

/* BUTTONS */

.action-row {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 14px;
    margin-top: 24px;
}

button {
    font-family: 'Inter', Arial, sans-serif;
}

.primary-btn {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background:
        linear-gradient(135deg, var(--button-start) 0%, var(--button-mid) 52%, var(--button-end) 100%);
    color: #ffffff;
    padding: 18px 20px;
    font-size: 17px;
    font-weight: 800;
    border-radius: 20px;
    cursor: pointer;
}

.secondary-btn,
.small-action-btn,
.suggestion-chip {
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.66);
    color: #dbeafe;
    font-weight: 800;
    cursor: pointer;
}

.secondary-btn {
    padding: 16px 18px;
    font-size: 15px;
    border-radius: 20px;
}

.small-action-btn {
    padding: 8px 13px;
    font-size: 13px;
    border-radius: 999px;
}

.suggestion-chip {
    padding: 9px 12px;
    font-size: 13px;
    border-radius: 999px;
    text-align: left;
}

.secondary-btn:hover,
.small-action-btn:hover,
.suggestion-chip:hover {
    border-color: rgba(103, 232, 249, 0.48);
    color: #ffffff;
    background: rgba(30, 41, 59, 0.78);
}

/* RESULT */

.result-section {
    margin-top: 34px;
    position: relative;
    z-index: 1;
}

.result-header,
.assistant-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.result-header h2 {
    color: var(--text-main);
    font-size: 24px;
}

.result-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.status-pill,
.assistant-pill {
    flex-shrink: 0;
    padding: 8px 13px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
}

.assistant-pill {
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.30);
}

.status-ready {
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.30);
}

.status-loading {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.32);
}

.status-success {
    color: #bbf7d0;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.30);
}

.status-error {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.30);
}

.loading {
    margin-bottom: 14px;
    color: var(--cyan);
    font-weight: 800;
}

.hidden {
    display: none;
}

.result-card,
.assistant-answer {
    background:
        linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(226, 232, 240, 0.96));
    color: #0f172a;
    border: 1px solid rgba(226, 232, 240, 0.8);
    padding: 28px;
    border-radius: 24px;
    min-height: 150px;
    box-shadow:
        0 22px 60px rgba(0, 0, 0, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.empty-result {
    color: #64748b;
}

.result-card h3,
.assistant-answer h3 {
    color: #0f172a;
    font-size: 20px;
    line-height: 1.35;
    margin: 24px 0 10px;
}

.result-card h3:first-child,
.assistant-answer h3:first-child {
    margin-top: 0;
}

.result-card p,
.result-card li,
.assistant-answer p,
.assistant-answer li {
    color: #334155;
    font-size: 15.5px;
    line-height: 1.78;
    margin-bottom: 12px;
}

.result-card ul,
.assistant-answer ul {
    margin: 8px 0 18px 22px;
}

/* ASSISTANT */

.assistant-section {
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid rgba(148, 163, 184, 0.20);
}

.assistant-suggestions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.assistant-input-row {
    display: grid;
    grid-template-columns: 1fr 190px;
    gap: 14px;
    align-items: stretch;
    margin-bottom: 18px;
}

#followupQuestion {
    min-height: 110px;
}

.assistant-btn {
    min-height: 110px;
}

.retrieved-context {
    margin-top: 18px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.45);
    overflow: hidden;
}

.retrieved-context summary {
    cursor: pointer;
    padding: 14px 16px;
    font-weight: 800;
    color: #dbeafe;
    background: rgba(15, 23, 42, 0.72);
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.retrieved-context pre {
    white-space: pre-wrap;
    word-break: break-word;
    padding: 16px;
    color: #cbd5e1;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 13.5px;
    line-height: 1.65;
    max-height: 360px;
    overflow-y: auto;
}

/* RESPONSIVE */

@media (max-width: 900px) {
    .page-wrapper {
        padding: 34px 14px 42px;
    }

    .feature-row,
    .upload-grid,
    .input-grid,
    .action-row,
    .assistant-input-row {
        grid-template-columns: 1fr;
    }

    .app-card {
        padding: 22px;
        border-radius: 26px;
    }

    textarea {
        min-height: 240px;
    }

    .assistant-btn {
        min-height: auto;
    }
}

@media (max-width: 560px) {
    .page-wrapper {
        padding: 24px 12px 34px;
    }

    .hero-section h1 {
        max-width: 360px;
        font-size: 34px;
        line-height: 1.16;
        letter-spacing: -0.02em;
        margin-bottom: 15px;
    }

    .hero-subtitle {
        font-size: 15px;
        line-height: 1.65;
    }

    .feature-card,
    .upload-panel,
    .app-card {
        padding: 16px;
        border-radius: 20px;
    }

    .section-heading h2,
    .assistant-header h2 {
        font-size: 22px;
    }

    textarea {
        min-height: 210px;
        border-radius: 18px;
        padding: 15px;
        font-size: 14px;
    }

    #followupQuestion {
        min-height: 100px;
    }

    .primary-btn,
    .secondary-btn {
        padding: 16px 18px;
        font-size: 15.5px;
        border-radius: 18px;
    }

    .result-header,
    .assistant-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .result-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .result-card,
    .assistant-answer {
        padding: 18px;
        border-radius: 18px;
    }

    .result-card h3,
    .assistant-answer h3 {
        font-size: 18px;
    }

    .result-card p,
    .result-card li,
    .assistant-answer p,
    .assistant-answer li {
        font-size: 14.5px;
    }
}
/* THEME TOGGLE */

.utility-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 18px;
}

.theme-toggle {
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.66);
    color: #dbeafe;
    font-weight: 800;
    cursor: pointer;
    padding: 9px 14px;
    font-size: 13px;
    border-radius: 999px;
}

.theme-toggle:hover {
    border-color: rgba(103, 232, 249, 0.48);
    color: #ffffff;
    background: rgba(30, 41, 59, 0.78);
}

/* LIGHT THEME */

body.light-theme {
    color: #0f172a;
    background:
        radial-gradient(circle at 8% 8%, rgba(99, 102, 241, 0.16), transparent 31%),
        radial-gradient(circle at 88% 12%, rgba(14, 165, 233, 0.14), transparent 28%),
        radial-gradient(circle at 18% 88%, rgba(168, 85, 247, 0.12), transparent 30%),
        linear-gradient(135deg, #f8fafc 0%, #eef2ff 48%, #ecfeff 100%);
}

body.light-theme::before {
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.045) 1px, transparent 1px);
}

body.light-theme .floating-shape {
    opacity: 0.24;
}

body.light-theme .badge {
    background: rgba(79, 70, 229, 0.10);
    color: #3730a3;
    border-color: rgba(79, 70, 229, 0.22);
}

body.light-theme .theme-toggle,
body.light-theme .secondary-btn,
body.light-theme .small-action-btn,
body.light-theme .suggestion-chip {
    background: rgba(255, 255, 255, 0.72);
    color: #334155;
    border-color: rgba(148, 163, 184, 0.38);
}

body.light-theme .theme-toggle:hover,
body.light-theme .secondary-btn:hover,
body.light-theme .small-action-btn:hover,
body.light-theme .suggestion-chip:hover {
    background: #ffffff;
    color: #111827;
    border-color: rgba(79, 70, 229, 0.34);
}

body.light-theme .hero-section h1 {
    background: linear-gradient(90deg, #0f172a 0%, #4f46e5 48%, #0891b2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

body.light-theme .hero-subtitle {
    color: #475569;
}

body.light-theme .feature-card,
body.light-theme .upload-panel,
body.light-theme .app-card {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(148, 163, 184, 0.30);
    box-shadow:
        0 24px 70px rgba(15, 23, 42, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.80);
}

body.light-theme .feature-card h3,
body.light-theme .section-heading h2,
body.light-theme .assistant-header h2,
body.light-theme .result-header h2,
body.light-theme .upload-text h3,
body.light-theme .input-box label {
    color: #0f172a;
}

body.light-theme .feature-card p,
body.light-theme .upload-text p,
body.light-theme .upload-file-name,
body.light-theme .input-box label span {
    color: #64748b;
}

body.light-theme .upload-box,
body.light-theme textarea {
    background: rgba(248, 250, 252, 0.82);
    color: #0f172a;
    border-color: rgba(148, 163, 184, 0.36);
}

body.light-theme textarea::placeholder {
    color: #94a3b8;
}

body.light-theme textarea:focus {
    background: #ffffff;
    border-color: rgba(79, 70, 229, 0.55);
}

body.light-theme .result-card,
body.light-theme .assistant-answer {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border-color: rgba(203, 213, 225, 0.90);
}

body.light-theme .retrieved-context {
    background: rgba(248, 250, 252, 0.80);
    border-color: rgba(148, 163, 184, 0.30);
}

body.light-theme .retrieved-context summary {
    background: rgba(241, 245, 249, 0.95);
    color: #1e293b;
}

body.light-theme .retrieved-context pre {
    color: #334155;
}

@media (max-width: 560px) {
    .utility-bar {
        justify-content: center;
        margin-bottom: 14px;
    }

    .theme-toggle {
        font-size: 12px;
        padding: 8px 13px;
    }
}
