/* ── Variables ────────────────────────────────────────────────────────────── */
:root {
    --primary: #4F46E5;
    --primary-light: #6366F1;
    --primary-dark: #4338CA;
    --primary-50: #EEF2FF;
    --primary-100: #E0E7FF;
    --primary-200: #C7D2FE;
    --bg: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;
    --text: #111827;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --border: #E5E7EB;
    --border-light: #F3F4F6;
    --success: #059669;
    --success-bg: #ECFDF5;
    --error: #DC2626;
    --error-bg: #FEF2F2;
    --info: #2563EB;
    --info-bg: #EFF6FF;
    --warning: #D97706;
    --warning-bg: #FFFBEB;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }
ul { list-style: none; }
hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.text-muted { color: var(--text-secondary); }
.optional { color: var(--text-muted); font-weight: 400; font-size: 0.85em; }

/* ── Navbar ───────────────────────────────────────────────────────────────── */
.navbar {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.95);
}
.nav-container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-brand {
    font-size: 1.25rem; font-weight: 700; color: var(--text);
    display: flex; align-items: center; gap: 0.5rem;
}
.brand-icon { color: var(--primary); font-size: 1.3em; }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--primary); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; transition: 0.3s; border-radius: 2px; }

.nav-dropdown { position: relative; }
.nav-dropdown-btn {
    background: none; border: none; color: var(--text-secondary); font-size: 0.9rem;
    font-weight: 500; cursor: pointer; font-family: var(--font); display: flex; align-items: center; gap: 0.3rem;
}
.nav-dropdown-btn:hover { color: var(--primary); }
.caret { font-size: 0.7em; }
.nav-dropdown-content {
    display: none; position: absolute; top: 100%; left: 0; background: var(--bg);
    border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem 0;
    min-width: 220px; box-shadow: var(--shadow-lg); z-index: 200;
}
.nav-dropdown:hover .nav-dropdown-content { display: block; }
.nav-dropdown-content a {
    display: block; padding: 0.5rem 1rem; color: var(--text-secondary); font-size: 0.875rem;
}
.nav-dropdown-content a:hover { background: var(--primary-50); color: var(--primary); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.625rem 1.25rem; border-radius: var(--radius); font-weight: 600;
    font-size: 0.9rem; cursor: pointer; border: 2px solid transparent;
    transition: all 0.2s; font-family: var(--font); text-decoration: none;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-white { background: #fff; color: var(--primary); border-color: #fff; }
.btn-white:hover { background: var(--primary-50); }
.btn-danger { background: var(--error); color: #fff; border-color: var(--error); }
.btn-danger:hover { background: #B91C1C; border-color: #B91C1C; color: #fff; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }
.btn-xs { padding: 0.25rem 0.6rem; font-size: 0.75rem; }
.btn-lg { padding: 0.75rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* ── Flash Messages ───────────────────────────────────────────────────────── */
.flash-container { margin-top: 1rem; }
.flash {
    padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 0.5rem;
    display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem;
}
.flash-success { background: var(--success-bg); color: var(--success); border: 1px solid #A7F3D0; }
.flash-error { background: var(--error-bg); color: var(--error); border: 1px solid #FECACA; }
.flash-info { background: var(--info-bg); color: var(--info); border: 1px solid #BFDBFE; }
.flash-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid #FDE68A; }
.flash-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: inherit; opacity: 0.7; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
    padding: 5rem 0 4rem;
    background: linear-gradient(135deg, var(--primary-50) 0%, #fff 50%, #EDE9FE 100%);
}
.hero-content { max-width: 720px; margin: 0 auto; text-align: center; }
.hero-badge {
    display: inline-block; padding: 0.3rem 1rem; border-radius: 100px;
    background: var(--primary-100); color: var(--primary); font-size: 0.8rem; font-weight: 600;
    margin-bottom: 1.5rem;
}
.hero h1 { font-size: 3rem; font-weight: 800; line-height: 1.15; margin-bottom: 1.25rem; letter-spacing: -0.02em; }
.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, #7C3AED 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-subtitle { font-size: 1.15rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; margin-bottom: 3rem; flex-wrap: wrap; }
.hero-stats { display: flex; justify-content: center; gap: 3rem; }
.hero-stat { text-align: center; }
.hero-stat-number { display: block; font-size: 1.75rem; font-weight: 800; color: var(--primary); }
.hero-stat-label { font-size: 0.85rem; color: var(--text-muted); }

/* ── Section Headers ──────────────────────────────────────────────────────── */
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header h2 { font-size: 2rem; font-weight: 800; margin-bottom: 0.75rem; }
.section-header p { font-size: 1.1rem; color: var(--text-secondary); }
.section-title { font-size: 1.4rem; font-weight: 700; margin: 2.5rem 0 1.25rem; }

/* ── Features Grid ────────────────────────────────────────────────────────── */
.features { padding: 5rem 0; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.feature-card {
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 2rem; transition: all 0.3s;
}
.feature-card:hover { border-color: var(--primary-200); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.feature-icon { font-size: 2rem; margin-bottom: 1rem; }
.feature-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.feature-card p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; margin-bottom: 1rem; }
.feature-link { font-size: 0.9rem; font-weight: 600; color: var(--primary); }

/* ── CTA Section ──────────────────────────────────────────────────────────── */
.cta-section { padding: 4rem 0; }
.cta-card {
    background: linear-gradient(135deg, var(--primary) 0%, #7C3AED 100%);
    border-radius: var(--radius-xl); padding: 3.5rem; text-align: center; color: #fff;
}
.cta-card h2 { font-size: 2rem; font-weight: 800; margin-bottom: 0.75rem; }
.cta-card p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 2rem; }

/* ── Pricing ──────────────────────────────────────────────────────────────── */
.pricing-section { padding: 4rem 0 5rem; }
.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; align-items: start; }
.pricing-card {
    background: var(--bg); border: 2px solid var(--border); border-radius: var(--radius-lg);
    padding: 2rem; position: relative;
}
.pricing-popular { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.popular-badge {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: var(--primary); color: #fff; padding: 0.2rem 1rem; border-radius: 100px;
    font-size: 0.75rem; font-weight: 700;
}
.pricing-header { text-align: center; margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.pricing-header h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.5rem; }
.price-amount { font-size: 2.5rem; font-weight: 800; }
.price-period { font-size: 0.9rem; color: var(--text-muted); }
.pricing-features { margin-bottom: 2rem; }
.pricing-features li { padding: 0.4rem 0; font-size: 0.9rem; color: var(--text-secondary); }

/* ── Auth Pages ───────────────────────────────────────────────────────────── */
.auth-section { padding: 3rem 0; display: flex; align-items: center; min-height: calc(100vh - 200px); }
.auth-card {
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 2.5rem; max-width: 480px; margin: 0 auto; box-shadow: var(--shadow-md);
}
.auth-card h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 0.5rem; }
.auth-subtitle { color: var(--text-secondary); margin-bottom: 2rem; font-size: 0.95rem; }
.auth-form { display: flex; flex-direction: column; gap: 1.25rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 0.9rem; color: var(--text-secondary); }

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.form-group input, .form-group textarea, .form-group select {
    padding: 0.65rem 0.85rem; border: 1.5px solid var(--border); border-radius: var(--radius);
    font-size: 0.9rem; font-family: var(--font); transition: border-color 0.2s;
    background: var(--bg); color: var(--text);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100);
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-group input:disabled { background: var(--bg-tertiary); color: var(--text-muted); }
.form-help { font-size: 0.8rem; color: var(--text-muted); }

/* ── Dashboard ────────────────────────────────────────────────────────────── */
.dashboard-section { padding: 2.5rem 0; }
.dashboard-header { margin-bottom: 2rem; }
.dashboard-header h1 { font-size: 1.75rem; font-weight: 800; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-bottom: 1rem; }
.stat-card {
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 1.5rem; display: flex; align-items: center; gap: 1rem;
}
.stat-icon {
    width: 48px; height: 48px; border-radius: var(--radius); display: flex;
    align-items: center; justify-content: center; font-size: 1.4rem;
}
.stat-icon-indigo { background: var(--primary-100); }
.stat-icon-purple { background: #EDE9FE; }
.stat-icon-blue { background: #DBEAFE; }
.stat-icon-green { background: #D1FAE5; }
.stat-number { font-size: 1.5rem; font-weight: 800; display: block; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); }

.tools-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.tool-card {
    display: block; background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 1.5rem; transition: all 0.3s; color: var(--text);
}
.tool-card:hover { border-color: var(--primary-200); box-shadow: var(--shadow-md); transform: translateY(-1px); color: var(--text); }
.tool-icon { font-size: 1.75rem; margin-bottom: 0.75rem; }
.tool-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.3rem; }
.tool-card p { font-size: 0.85rem; color: var(--text-secondary); }

/* ── Docs Table ───────────────────────────────────────────────────────────── */
.docs-table-wrap { overflow-x: auto; }
.docs-table { width: 100%; border-collapse: collapse; }
.docs-table th {
    text-align: left; padding: 0.75rem 1rem; font-size: 0.8rem; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}
.docs-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-light); font-size: 0.9rem; }
.docs-table a { font-weight: 500; }

.badge {
    display: inline-block; padding: 0.15rem 0.6rem; border-radius: 100px;
    font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
}
.badge-meeting { background: var(--primary-100); color: var(--primary); }
.badge-presentation { background: #EDE9FE; color: #7C3AED; }
.badge-report { background: #DBEAFE; color: #2563EB; }
.badge-parse { background: #FEF3C7; color: #D97706; }
.badge-dashboard { background: #D1FAE5; color: #059669; }
.badge-extract { background: #FCE7F3; color: #DB2777; }

/* ── Tool Pages ───────────────────────────────────────────────────────────── */
.tool-section { padding: 2.5rem 0; }
.tool-header { display: flex; align-items: flex-start; gap: 1.25rem; margin-bottom: 2rem; }
.tool-header-icon { font-size: 2.5rem; }
.tool-header h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 0.3rem; }
.tool-header p { color: var(--text-secondary); font-size: 0.95rem; }

.tool-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.tool-input-panel, .tool-output-panel {
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 1.5rem;
}
.output-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.output-header h3 { font-size: 1rem; font-weight: 700; }
.output-content { min-height: 300px; }
.output-placeholder { color: var(--text-muted); text-align: center; padding: 3rem 1rem; }

/* ── Document View ────────────────────────────────────────────────────────── */
.doc-view-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; }
.doc-actions { display: flex; gap: 0.5rem; }
.back-link { font-size: 0.85rem; color: var(--text-muted); display: block; margin-bottom: 0.5rem; }
.doc-view-content { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.doc-panel { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; }
.doc-panel h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.doc-text { font-size: 0.9rem; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }

/* ── Billing ──────────────────────────────────────────────────────────────── */
.billing-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; max-width: 700px; }
.billing-plan { padding: 2rem; background: linear-gradient(135deg, var(--primary) 0%, #7C3AED 100%); color: #fff; }
.billing-plan h2 { font-size: 1.3rem; font-weight: 700; }
.billing-price { font-size: 2rem; font-weight: 800; margin-top: 0.5rem; }
.billing-usage { padding: 2rem; }
.billing-usage h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1.25rem; }
.usage-item { margin-bottom: 1rem; }
.usage-label { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 0.4rem; }
.usage-bar { background: var(--bg-tertiary); border-radius: 100px; height: 8px; overflow: hidden; }
.usage-fill { background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%); height: 100%; border-radius: 100px; transition: width 0.5s; min-width: 2px; }
.usage-fill-unlimited { background: var(--success); }
.billing-upgrade { padding: 0 2rem 2rem; }

/* ── Pagination ───────────────────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 2rem; }
.pagination-info { font-size: 0.85rem; color: var(--text-muted); }

/* ── Empty State ──────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 4rem 1rem; }
.empty-state h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-secondary); margin-bottom: 1.5rem; }

/* ── Markdown Body ────────────────────────────────────────────────────────── */
.markdown-body { font-size: 0.9rem; line-height: 1.7; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin-top: 1.5rem; margin-bottom: 0.75rem; font-weight: 700; }
.markdown-body h2 { font-size: 1.2rem; color: var(--primary); }
.markdown-body h3 { font-size: 1.05rem; }
.markdown-body p { margin-bottom: 0.75rem; }
.markdown-body ul, .markdown-body ol { margin: 0.5rem 0 0.75rem 1.5rem; }
.markdown-body ul { list-style: disc; }
.markdown-body ol { list-style: decimal; }
.markdown-body li { margin-bottom: 0.3rem; }
.markdown-body pre { background: var(--bg-tertiary); padding: 1rem; border-radius: var(--radius); overflow-x: auto; margin: 1rem 0; }
.markdown-body code { background: var(--bg-tertiary); padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.85em; }
.markdown-body pre code { background: none; padding: 0; }
.markdown-body table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
.markdown-body th, .markdown-body td { padding: 0.5rem 0.75rem; border: 1px solid var(--border); text-align: left; font-size: 0.85rem; }
.markdown-body th { background: var(--bg-tertiary); font-weight: 600; }
.markdown-body strong { font-weight: 700; }
.markdown-body hr { margin: 1.5rem 0; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer { background: var(--bg-secondary); border-top: 1px solid var(--border); padding: 3rem 0 2rem; margin-top: 4rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.footer h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 1rem; }
.footer-desc { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6; }
.footer ul li { margin-bottom: 0.4rem; }
.footer ul li a { color: var(--text-secondary); font-size: 0.85rem; }
.footer ul li a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 1.5rem; text-align: center; }
.footer-bottom p { font-size: 0.8rem; color: var(--text-muted); }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .pricing-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-links {
        display: none; position: absolute; top: 64px; left: 0; right: 0;
        background: var(--bg); border-bottom: 1px solid var(--border);
        flex-direction: column; padding: 1rem 1.5rem; gap: 0.75rem;
        box-shadow: var(--shadow-lg);
    }
    .nav-links.active { display: flex; }
    .nav-dropdown-content {
        position: static; box-shadow: none; border: none;
        padding-left: 1rem; background: var(--bg-secondary); border-radius: var(--radius);
    }

    .hero h1 { font-size: 2rem; }
    .hero-stats { gap: 1.5rem; }

    .features-grid { grid-template-columns: 1fr; }
    .pricing-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .tools-grid { grid-template-columns: 1fr; }

    .tool-layout { grid-template-columns: 1fr; }
    .doc-view-content { grid-template-columns: 1fr; }

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

@media (max-width: 480px) {
    .hero h1 { font-size: 1.6rem; }
    .hero-subtitle { font-size: 1rem; }
    .hero-actions { flex-direction: column; }
    .stats-grid { grid-template-columns: 1fr; }
    .doc-view-header { flex-direction: column; }
}
