/* ============================================
   Promptheus — Clean Minimal
   ============================================ */
/* Fonts: system stack — no external dependencies */

:root {
    --bg: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border: #e5e7eb;
    --border-light: #f0f0f0;
    --text: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --accent: #f97316;
    --accent-hover: #ea580c;
    --accent-soft: #fff7ed;
    --ai-assisted: #059669;
    --ai-assisted-bg: #ecfdf5;
    --ai-coauthored: #d97706;
    --ai-coauthored-bg: #fffbeb;
    --ai-primary: #7c3aed;
    --ai-primary-bg: #f5f3ff;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
    --shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
}

/* Base */
body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 0.938rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Force sans-serif everywhere — override Bootstrap */
body, input, button, select, textarea, .form-control, .form-select, .btn,
.nav-link, .dropdown-item, .navbar, .card, p, li, td, th, label, span, div {
    font-family: inherit;
}

h1, h2, h3, h5, h6 { font-family: inherit; font-weight: 700; color: var(--text); line-height: 1.3; }
h4 { font-family: inherit; font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); margin-top: 2rem; margin-bottom: 0.75rem; }

code, .font-mono, .paper-id, .bibtex-block { font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace; font-size: 0.85em; }

a { color: var(--text); text-decoration: none; transition: color 150ms; }
a:hover { color: var(--accent); }

::selection { background: var(--accent); color: #fff; }

/* ---- Navbar ---- */
.bg-primary-custom {
    background: var(--bg) !important;
    border-bottom: 1px solid var(--border);
}
.navbar { padding: 0; min-height: 52px; }
.navbar-brand { padding: 0.65rem 0; }
.navbar-brand .brand-text {
    font-family: inherit; letter-spacing: -0.03em;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text) !important;
    letter-spacing: -0.03em;
}

.navbar-dark .navbar-nav .nav-link,
.bg-primary-custom .navbar-nav .nav-link {
    color: var(--text-secondary) !important;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.9rem 0.75rem;
    transition: color 150ms;
}
.navbar-dark .navbar-nav .nav-link:hover,
.bg-primary-custom .navbar-nav .nav-link:hover { color: var(--text) !important; }
.navbar-dark .navbar-nav .nav-link.active,
.bg-primary-custom .navbar-nav .nav-link.active { color: var(--text) !important; font-weight: 600; }
.navbar-dark .navbar-nav .nav-link.active::after {
    content: ''; position: absolute; bottom: 0; left: 0.75rem; right: 0.75rem;
    height: 2px; background: var(--accent); border-radius: 2px 2px 0 0;
}
.navbar-dark .navbar-nav .nav-link { position: relative; }

.navbar-toggler { border: 1px solid var(--border); padding: 0.3rem 0.5rem; }
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23111827' stroke-linecap='round' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* Dropdown */
.dropdown-menu {
    border: 1px solid var(--border); box-shadow: var(--shadow-lg);
    border-radius: var(--radius); padding: 4px; margin-top: 4px; font-size: 0.875rem;
}
.dropdown-item { border-radius: 6px; padding: 0.4rem 0.65rem; font-weight: 500; }
.dropdown-item:hover { background: var(--bg-secondary); }
.dropdown-divider { margin: 4px 0; border-color: var(--border); }

/* ---- Buttons ---- */
.btn { font-weight: 600; border-radius: var(--radius); transition: all 150ms; font-size: 0.875rem; }

.btn-accent {
    background: var(--accent); color: #fff !important; border: none;
    box-shadow: 0 1px 2px rgba(249,115,22,0.3);
}
.btn-accent:hover {
    background: var(--accent-hover); color: #fff !important;
    box-shadow: 0 2px 8px rgba(249,115,22,0.3); transform: translateY(-1px);
}
.btn-accent:active { transform: translateY(0); }

.btn-outline-primary { color: var(--text); border-color: var(--border); }
.btn-outline-primary:hover { background: var(--text); border-color: var(--text); color: #fff; }
.btn-outline-secondary { color: var(--text-secondary); border-color: var(--border); }
.btn-outline-secondary:hover { background: var(--bg-secondary); border-color: var(--border); color: var(--text); }
.btn-success { background: var(--ai-assisted); border-color: var(--ai-assisted); }
.btn-danger { background: #ef4444; border-color: #ef4444; }

/* ---- Hero ---- */
.hero-section {
    background: var(--text);
    color: #fff;
    padding: 4.5rem 2rem 4rem;
    margin: -1.5rem -12px 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(249,115,22,0.12) 0%, transparent 70%),
                radial-gradient(ellipse at 70% 30%, rgba(124,58,237,0.08) 0%, transparent 60%);
}
.hero-section > * { position: relative; }
.hero-section h1 {
    font-family: inherit; letter-spacing: -0.03em;
    font-size: 3rem; font-weight: 700; margin-bottom: 0.6rem;
    letter-spacing: -0.03em; color: #fff;
}
.hero-section .tagline {
    font-weight: 400; font-size: 1.05rem; opacity: 0.5; letter-spacing: 0.01em;
}

/* ---- Paper Cards ---- */
.paper-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 0.5rem;
    transition: all 200ms;
}
.paper-card:hover {
    box-shadow: var(--shadow);
    border-color: #d1d5db;
}
.paper-card .paper-title {
    font-weight: 600; font-size: 1.05rem; line-height: 1.4; margin-bottom: 0.3rem;
}
.paper-card .paper-title a { color: var(--text); }
.paper-card .paper-title a:hover { color: var(--accent); }
.paper-card .paper-meta {
    font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.5rem;
    display: flex; align-items: center; flex-wrap: wrap; gap: 0.3rem;
}
.paper-card .paper-abstract {
    font-size: 0.875rem; color: var(--text-secondary); line-height: 1.6; margin: 0;
}
.paper-card .paper-id {
    font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace; font-size: 0.72rem;
    color: var(--text-tertiary); background: var(--bg-secondary);
    padding: 0.1rem 0.35rem; border-radius: 4px;
}

/* ---- Badges ---- */
.badge { font-weight: 600; font-size: 0.68rem; border-radius: 999px; padding: 0.2rem 0.5rem; letter-spacing: 0.02em; }
.badge-ai-assisted { background: var(--ai-assisted-bg) !important; color: var(--ai-assisted) !important; }
.badge-ai-coauthored { background: var(--ai-coauthored-bg) !important; color: var(--ai-coauthored) !important; }
.badge-ai-primary { background: var(--ai-primary-bg) !important; color: var(--ai-primary) !important; }
.badge-category {
    background: var(--bg-secondary) !important; color: var(--text-secondary) !important;
    font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace; font-size: 0.68rem; font-weight: 500;
}
.badge.bg-light { background: var(--bg-secondary) !important; color: var(--text-secondary) !important; }
.badge.bg-success { background: var(--ai-assisted-bg) !important; color: var(--ai-assisted) !important; }
.badge.bg-danger { background: #fef2f2 !important; color: #ef4444 !important; }
.badge.bg-warning { background: var(--ai-coauthored-bg) !important; color: var(--ai-coauthored) !important; }

/* ---- AI Disclosure Box ---- */
.ai-disclosure-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin: 1.5rem 0;
    position: relative;
}
.ai-disclosure-box::before {
    content: 'AI Disclosure'; position: absolute; top: -0.6rem; left: 1rem;
    background: var(--bg); padding: 0 0.5rem;
    font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace; font-size: 0.65rem; font-weight: 600;
    color: var(--ai-primary); text-transform: uppercase; letter-spacing: 0.08em;
}
.ai-disclosure-box .ai-level { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.5rem; }
.ai-disclosure-box .ai-details { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.6; }
.ai-disclosure-box hr { border-color: var(--border); margin: 1rem 0; }

/* ---- Sidebar ---- */
.sidebar-card {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.25rem; margin-bottom: 0.75rem;
}
.sidebar-card h5 {
    font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--text-tertiary);
    margin-bottom: 0.85rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--border);
}
.sidebar-card ul li { padding: 0.25rem 0; }
.sidebar-card ul li a { font-size: 0.875rem; color: var(--text-secondary); }
.sidebar-card ul li a:hover { color: var(--accent); }

/* ---- BibTeX ---- */
.bibtex-block {
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 0.85rem;
    font-size: 0.72rem; line-height: 1.65; white-space: pre-wrap;
    word-break: break-all; color: var(--text-secondary);
}

/* ---- Search Dropdown ---- */
.search-box-wrapper { position: relative; }
.search-box-wrapper .form-control { font-size: 0.875rem; }

.search-results-dropdown {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg); border: 1px solid var(--border);
    border-top: none; border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-lg); z-index: 1000; max-height: 380px;
    overflow-y: auto; display: none;
}
.search-results-dropdown.active { display: block; }
.search-results-dropdown .search-result-item {
    padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--border);
    transition: background 100ms; color: var(--text);
}
.search-results-dropdown .search-result-item:hover { background: var(--bg-secondary); }
.search-results-dropdown .search-result-item:last-child { border-bottom: none; }
.search-results-dropdown .search-result-title { font-weight: 600; font-size: 0.875rem; }
.search-results-dropdown .search-result-meta { font-size: 0.75rem; color: var(--text-tertiary); margin-top: 2px; }

/* ---- Comments ---- */
.comment { border-left: 2px solid var(--border); padding-left: 1rem; margin-bottom: 1.25rem; }
.comment:hover { border-left-color: var(--text-tertiary); }
.comment.comment-reply { margin-left: 1.5rem; }
.comment .comment-meta { font-size: 0.8rem; color: var(--text-tertiary); margin-bottom: 0.3rem; }
.comment .comment-meta strong { color: var(--text); }
.comment .comment-body { font-size: 0.875rem; }
.comment .btn-reply { font-size: 0.78rem; color: var(--text-tertiary); }
.comment .btn-reply:hover { color: var(--accent); }

/* ---- Step Indicator ---- */
.step-indicator { display: flex; gap: 0; margin-bottom: 2rem; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.step-indicator .step {
    flex: 1; text-align: center; padding: 0.6rem 0.5rem;
    background: var(--bg); font-size: 0.72rem; font-weight: 600;
    color: var(--text-tertiary); transition: all 200ms;
    border-right: 1px solid var(--border);
}
.step-indicator .step:last-child { border-right: none; }
.step-indicator .step.active { background: var(--text); color: #fff; }
.step-indicator .step.completed { background: var(--bg-secondary); color: var(--ai-assisted); }
.form-step { display: none; }
.form-step.active { display: block; animation: fadeUp 250ms ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Forms ---- */
.form-control, .form-select {
    border-radius: var(--radius); border: 1px solid var(--border);
    font-size: 0.875rem; padding: 0.5rem 0.75rem; transition: all 150ms;
}
.form-control:focus, .form-select:focus {
    border-color: var(--text); box-shadow: 0 0 0 3px rgba(17,24,39,0.06);
}
.form-label { font-weight: 600; font-size: 0.875rem; margin-bottom: 0.3rem; }
.form-text { font-size: 0.8rem; color: var(--text-tertiary); }
.form-check-label { font-size: 0.875rem; }

/* ---- Tables ---- */
.table { font-size: 0.875rem; border-color: var(--border); }
.table th {
    font-weight: 600; font-size: 0.75rem; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.04em; border-bottom-width: 1px; padding: 0.6rem 0.75rem;
}
.table td { padding: 0.6rem 0.75rem; vertical-align: middle; }

/* ---- Pagination ---- */
.pagination { gap: 2px; }
.page-link {
    font-size: 0.8rem; font-weight: 500; color: var(--text-secondary);
    border: 1px solid var(--border); border-radius: 6px !important;
    padding: 0.35rem 0.65rem;
}
.page-link:hover { background: var(--bg-secondary); color: var(--text); border-color: var(--border); }
.page-item.active .page-link { background: var(--text); border-color: var(--text); color: #fff; }

/* ---- Alerts ---- */
.alert { border-radius: var(--radius); font-size: 0.875rem; border: none; }
.alert-danger { background: #fef2f2; color: #991b1b; border-left: 3px solid #ef4444; }
.alert-info { background: #eff6ff; color: #1e40af; border-left: 3px solid #3b82f6; }

/* ---- Footer ---- */
.site-footer {
    background: var(--text); color: rgba(255,255,255,0.5);
    padding: 3rem 0 1.5rem; margin-top: 4rem;
}
.site-footer h6 {
    color: rgba(255,255,255,0.3); font-size: 0.65rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.85rem;
}
.site-footer a { color: rgba(255,255,255,0.5); font-size: 0.85rem; }
.site-footer a:hover { color: var(--accent); }
.site-footer ul li { margin-bottom: 0.35rem; }
.site-footer hr { border-color: rgba(255,255,255,0.08); margin: 1.5rem 0; }
.footer-brand {
    font-family: inherit; letter-spacing: -0.03em; font-size: 1.2rem;
    font-weight: 700; color: #fff; margin-bottom: 0.25rem;
}
.footer-us { color: var(--accent); }
.site-footer .text-muted { color: rgba(255,255,255,0.25) !important; }

/* ---- Category Grid ---- */
.category-card {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.25rem; text-align: left;
    transition: all 200ms; height: 100%;
}
.category-card:hover { box-shadow: var(--shadow-md); border-color: #d1d5db; }
.category-card .category-slug {
    font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace; font-size: 0.7rem;
    color: var(--accent); margin-bottom: 0.25rem;
}
.category-card .category-name { font-weight: 600; font-size: 0.95rem; color: var(--text); }
.category-card .category-count {
    font-size: 0.78rem; color: var(--text-tertiary); margin-top: 0.4rem;
}

/* ---- Stats ---- */
.stat-number { font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace; font-size: 1.5rem; font-weight: 600; color: var(--text); }
.stat-label { font-size: 0.7rem; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; }

/* ---- Profile ---- */
.profile-header {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 1.75rem; margin-bottom: 1.5rem;
}
.profile-avatar {
    width: 64px; height: 64px; border-radius: var(--radius);
    background: var(--text); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-family: inherit; letter-spacing: -0.03em; font-size: 1.6rem; font-weight: 700;
    flex-shrink: 0;
}

/* ---- AI Tool Picker ---- */
#ai-tools-container { max-height: 260px; overflow-y: auto; }
#ai-tools-container .form-check { padding-top: 0.15rem; padding-bottom: 0.15rem; }
#ai-tools-details .border { background: var(--bg-secondary); border-color: var(--border) !important; border-radius: var(--radius) !important; }

/* ---- Attachments ---- */
.attachment-row { background: var(--bg); border-color: var(--border) !important; border-radius: var(--radius) !important; }

/* ---- Accordion ---- */
.accordion-button {
    font-size: 0.875rem; font-weight: 600; padding: 0.7rem 1rem;
    background: var(--bg); color: var(--text); border-radius: var(--radius);
}
.accordion-button:not(.collapsed) { background: var(--bg-secondary); color: var(--text); box-shadow: none; }
.accordion-button:focus { box-shadow: 0 0 0 3px rgba(17,24,39,0.06); }
.accordion-item { border-color: var(--border); border-radius: var(--radius) !important; margin-bottom: 4px; overflow: hidden; }

/* ---- Section headings ---- */
main h1 { font-size: 1.6rem; letter-spacing: -0.02em; }

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
    .navbar-dark .navbar-nav .nav-link.active::after { display: none; }
    .bg-primary-custom .navbar-collapse { background: var(--bg); padding: 0.5rem 0; }
}
@media (max-width: 768px) {
    .hero-section { padding: 3rem 1rem 2.5rem; margin-left: -12px; margin-right: -12px; }
    .hero-section h1 { font-size: 2.2rem; }
    .step-indicator { flex-wrap: wrap; border: none; gap: 3px; }
    .step-indicator .step { flex: auto; min-width: 48%; border-radius: 6px !important; border: 1px solid var(--border); border-right: 1px solid var(--border) !important; }
    .paper-card { padding: 1rem 1.15rem; }
}

/* ---- Utility ---- */
.text-muted { color: var(--text-tertiary) !important; }
