/* Shakarim Research Intelligence | Premium Dark Mode Design System */

:root {
    --bg-main: #0B0A0F;
    --bg-secondary: #13111C;
    --bg-glass: rgba(19, 17, 28, 0.65);
    --bg-glass-hover: rgba(19, 17, 28, 0.85);
    --ios-blur: blur(40px);
    
    --accent-main: #6366F1;
    --accent-glow: rgba(99, 102, 241, 0.25);
    --accent-gradient: linear-gradient(135deg, #4F46E5, #8B5CF6);
    
    --text-main: #F3F4F6;
    --text-muted: #9CA3AF;
    --text-dark: #1F2937;
    
    --purple: #8B5CF6;
    --teal: #14B8A6;
    --orange: #F59E0B;
    --red: #EF4444;
    --green: #10B981;
    --blue: #3B82F6;
    
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 10px;
    
    --shadow-main: 0 8px 30px rgba(0, 0, 0, 0.4), 0 20px 40px rgba(0, 0, 0, 0.2);
    --font-main: 'Inter', system-ui, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-main);
    background: var(--bg-main);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    letter-spacing: -0.015em;
}

/* ── Background Blobs ── */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 10% 20%, #0d0b14 0%, var(--bg-main) 100%);
    overflow: hidden;
}
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
    animation: float 25s infinite ease-in-out;
}
.blob-1 { top: -10%; left: -10%; width: 50vw; height: 50vw; background: #4F46E5; }
.blob-2 { bottom: -10%; right: -10%; width: 60vw; height: 60vw; background: #8B5CF6; animation-delay: -5s; }
.blob-3 { top: 30%; left: 30%; width: 40vw; height: 40vw; background: #06B6D4; animation-delay: -10s; }
@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, 30px) scale(1.05); }
}

/* ── Layout ── */
.app-container {
    display: flex;
    height: 100vh;
    padding: 24px;
    gap: 24px;
}

/* ── Sidebar ── */
.sidebar {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 32px 20px;
    background: var(--bg-glass);
    backdrop-filter: var(--ios-blur);
    -webkit-backdrop-filter: var(--ios-blur);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow-main);
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
    text-align: center;
}
.logo-icon {
    width: 52px;
    height: 52px;
    color: #fff;
    margin-bottom: 16px;
    background: var(--accent-gradient);
    border-radius: 14px;
    padding: 10px;
    box-shadow: 0 8px 16px var(--accent-glow);
}
.logo h1 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #fff;
}
.logo p {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 6px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.25s cubic-bezier(0.19, 1, 0.22, 1);
    font-weight: 600;
    font-size: 15px;
}
.nav-item i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    transform: translateX(4px);
}
.nav-item.active {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 8px 24px var(--accent-glow);
}

.sidebar-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 24px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}
.pulse-dot {
    width: 10px;
    height: 10px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.8);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.sidebar-sync-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
    font-weight: 500;
    transition: opacity 0.3s;
    padding: 0 12px;
}
.sidebar-sync-status .spinning { color: var(--accent-main); }

/* ── Main Content ── */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    padding-bottom: 40px;
    min-width: 0;
}
.main-content::-webkit-scrollbar { width: 0; }

.top-header {
    background: var(--bg-glass);
    backdrop-filter: var(--ios-blur);
    -webkit-backdrop-filter: var(--ios-blur);
    padding: 16px 36px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow-main);
    display: flex;
    align-self: center;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-title { text-align: center; }
.header-title h2 { font-size: 16px; font-weight: 700; color: #fff; }
.header-title p { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-top: 2px; }

/* ── Sections ── */
.app-section { display: none; animation: section-in 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.app-section.active { display: flex; flex-direction: column; gap: 24px; }
@keyframes section-in {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Dashboard (Hero) ── */
.landing-hero {
    text-align: center;
    padding: 56px 40px 40px;
    max-width: 840px;
    margin: 0 auto;
}
.hero-title {
    font-size: 64px;
    font-weight: 900;
    letter-spacing: -0.06em;
    line-height: 1;
    color: #fff;
    margin-bottom: 24px;
    text-shadow: 0 10px 40px var(--accent-glow);
}
.hero-subtitle {
    font-size: 22px;
    font-weight: 600;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}
.hero-description {
    font-size: 17px;
    color: var(--text-muted);
    line-height: 1.7;
    font-weight: 500;
}

.capabilities-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 0 24px;
}
.capability-card {
    cursor: pointer;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 18px;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.capability-card:hover {
    transform: translateY(-8px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 16px 40px var(--accent-glow);
}
.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
}
.capability-card h3 { font-size: 20px; font-weight: 700; color: #fff; }
.capability-card p { font-size: 14px; color: var(--text-muted); line-height: 1.6; flex: 1; }
.card-action { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--accent-main); transition: transform 0.2s; }
.capability-card:hover .card-action { transform: translateX(4px); }

/* Theme Accents for Cards */
.blue-glow { background: linear-gradient(135deg, #3B82F6, #2563EB); box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3); }
.purple-glow { background: var(--accent-gradient); box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3); }
.teal-glow { background: linear-gradient(135deg, #14B8A6, #0D9488); box-shadow: 0 8px 24px rgba(20, 184, 166, 0.3); }
.orange-glow { background: linear-gradient(135deg, #F59E0B, #D97706); box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3); }
.red-glow { background: linear-gradient(135deg, #EF4444, #DC2626); box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3); }

/* ── Common Panels ── */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: var(--ios-blur);
    -webkit-backdrop-filter: var(--ios-blur);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-main);
    padding: 32px;
}
.full-panel { padding: 32px; }

.panel-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}
.panel-header i { width: 26px; height: 26px; color: var(--accent-main); }
.panel-header h3 { font-size: 22px; font-weight: 700; color: #fff; }
.ml-auto { margin-left: auto; }

/* ── Database Insights ── */
.db-insight-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}
.insight-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s;
}
.insight-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2);
}
.insight-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.insight-icon i { width: 22px; height: 22px; }
.insight-content h3 { font-size: 26px; font-weight: 800; color: #fff; letter-spacing: -0.02em; }
.insight-content p { font-size: 11px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; }

.purple-dot { background: var(--accent-gradient); }
.blue-dot { background: linear-gradient(135deg, #3B82F6, #1D4ED8); }
.orange-dot { background: linear-gradient(135deg, #F59E0B, #B45309); }
.teal-dot { background: linear-gradient(135deg, #14B8A6, #0F766E); }

/* ── Toolbar & Search ── */
.db-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.compact-search {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    max-width: 360px;
    transition: all 0.2s ease;
}
.compact-search:focus-within {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-main);
    box-shadow: 0 0 0 4px var(--accent-glow);
}
.search-icon-sm { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.input-minimal {
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 500;
    width: 100%;
    outline: none;
    padding: 6px 0;
    color: #fff;
    font-family: var(--font-main);
}
.input-minimal::placeholder { color: rgba(255, 255, 255, 0.3); }

/* ── Buttons ── */
.toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-main);
}
.btn-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}
.btn-pill:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-pill i { width: 16px; height: 16px; }
.btn-pill.purple {
    background: var(--accent-gradient);
    border: none;
    box-shadow: 0 8px 24px var(--accent-glow);
}
.btn-pill.purple:hover { box-shadow: 0 12px 32px rgba(99, 102, 241, 0.4); }

/* ── Tabs ── */
.db-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.db-tab {
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.db-tab.active { background: var(--accent-gradient); color: #fff; box-shadow: 0 4px 16px var(--accent-glow); }

/* ── Tables ── */
.db-grid-container { max-height: 500px; overflow-y: auto; padding-right: 8px; }
.db-grid-container::-webkit-scrollbar { width: 6px; }
.db-grid-container::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }

.db-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.db-table th {
    padding: 0 18px 10px;
    text-align: left;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.db-table td {
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.03);
    vertical-align: middle;
    font-size: 14px;
    border-top: 1px solid rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.02);
}
.db-table tr td:first-child { border-radius: 14px 0 0 14px; border-left: 1px solid rgba(255,255,255,0.02); }
.db-table tr td:last-child { border-radius: 0 14px 14px 0; border-right: 1px solid rgba(255,255,255,0.02); }
.db-table tr:hover td { background: rgba(255, 255, 255, 0.06); transform: scale(1.002); }

.table-loading { text-align: center; padding: 4rem; color: var(--text-muted); }

/* Badges */
.type-badge { padding: 4px 10px; border-radius: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-blue { background: rgba(59, 130, 246, 0.15); color: #60A5FA; }
.badge-purple { background: rgba(139, 92, 246, 0.15); color: #A78BFA; }
.badge-teal { background: rgba(20, 184, 166, 0.15); color: #2DD4BF; }
.badge-green { background: rgba(16, 185, 129, 0.15); color: #34D399; }

/* ── AI Panel Form ── */
.ai-panel {
    position: relative;
    overflow: hidden;
    background: var(--bg-secondary);
}
.ai-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent-gradient);
}
.ai-interface { text-align: center; padding: 24px 0; }
.panel-description { font-size: 16px; color: var(--text-muted); font-weight: 500; max-width: 540px; margin: 0 auto 32px; line-height: 1.6; }

.prompt-container {
    position: relative;
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 40px;
    padding: 8px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.prompt-container:focus-within {
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 4px var(--accent-glow);
    border-color: var(--accent-main);
}
#topic { padding: 16px 24px; font-size: 18px; background: transparent; color: #fff; border: none; outline: none; flex: 1; min-width: 0; font-family: var(--font-main); }
#topic::placeholder { color: rgba(255, 255, 255, 0.4); }

.ai-submit-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px var(--accent-glow);
    transition: all 0.3s ease;
    flex-shrink: 0;
}
.ai-submit-btn:hover { transform: scale(1.05) rotate(10deg); box-shadow: 0 12px 32px rgba(99, 102, 241, 0.5); }

/* Loaders */
.loader-container { text-align: center; padding: 40px 0; }
.loader-container p { font-weight: 600; font-size: 15px; color: var(--accent-main); margin-top: 16px; animation: pulse-opacity 1.5s infinite; }
@keyframes pulse-opacity { 0%, 100%{ opacity: 1; } 50%{ opacity: 0.5; } }

.ai-orbit-loader {
    width: 64px;
    height: 64px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top-color: var(--accent-main);
    border-radius: 50%;
    animation: orbit 1s infinite linear;
    margin: 0 auto;
}
@keyframes orbit { to { transform: rotate(360deg); } }
.spinning { animation: orbit 0.8s linear infinite; }

/* AI Report typography */
.ai-report { line-height: 1.8; color: var(--text-main); font-size: 15px; }
.ai-report h3 { color: #A78BFA; margin: 32px 0 16px; font-size: 20px; font-weight: 800; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 8px;}
.ai-report h4 { font-size: 17px; margin: 16px 0 8px; color: #fff;}
.ai-report p { margin-bottom: 16px; }
.ai-report ul { padding-left: 24px; margin-bottom: 16px; }
.ai-report li { margin-bottom: 8px; }
.ai-report .trend-card { background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(99, 102, 241, 0.2); border-left: 4px solid var(--accent-main); border-radius: 12px; padding: 20px 24px; margin: 16px 0; }
.results-panel { display: none; }

/* ── Graph ── */
#graph-container {
    position: relative;
    width: 100%;
    height: 560px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
#graph-svg { width: 100%; height: 100%; }
.graph-legend { display: flex; gap: 24px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); font-weight: 600; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; }
.legend-dot.blue { background: var(--accent-main); }
.legend-dot.gray { background: #4B5563; }
.legend-note { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.graph-tooltip { position: fixed; background: rgba(17, 24, 39, 0.95); color: #fff; padding: 12px 16px; border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; font-size: 13px; font-weight: 600; pointer-events: none; z-index: 999; box-shadow: 0 10px 25px rgba(0,0,0,0.5); }
.empty-state { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; color: var(--text-muted); }
.empty-state i { width: 56px; height: 56px; margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 16px; font-weight: 500; }

/* ── Clusters ── */
#clusters-chart-container { width: 100%; height: 460px; margin-bottom: 24px; }
#clusters-svg { width: 100%; height: 100%; }
.clusters-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.cluster-card { background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: var(--radius-md); padding: 20px; transition: all 0.3s; }
.cluster-card:hover { background: rgba(255, 255, 255, 0.06); transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0,0,0,0.3); }
.cluster-card h4 { font-size: 16px; font-weight: 700; margin-bottom: 10px; color: #fff; }
.cluster-kws { font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.cluster-count { font-size: 13px; font-weight: 700; color: var(--accent-main); margin-top: 12px; display: inline-block; padding: 4px 12px; background: rgba(99, 102, 241, 0.1); border-radius: 20px; }

/* ── Researchers ── */
.researcher-search-bar { display: flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 16px; padding: 10px 20px; margin-bottom: 24px; max-width: 480px; }
.researchers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; max-height: 400px; overflow-y: auto; padding-right: 8px; }
.researchers-grid::-webkit-scrollbar { width: 6px; }
.researchers-grid::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }

.researcher-card { background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: var(--radius-md); padding: 20px; cursor: pointer; transition: all 0.3s; }
.researcher-card:hover { background: rgba(255, 255, 255, 0.08); transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0,0,0,0.3); border-color: rgba(255,255,255,0.1); }
.researcher-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--accent-gradient); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 20px; margin-bottom: 16px; box-shadow: 0 4px 12px var(--accent-glow); }
.researcher-card h4 { font-size: 16px; font-weight: 700; margin-bottom: 6px; color: #fff; }
.researcher-card p { font-size: 13px; color: var(--text-muted); line-height: 1.4; }
.researcher-badge { display: inline-block; font-size: 12px; font-weight: 700; color: #60A5FA; background: rgba(59, 130, 246, 0.15); padding: 4px 10px; border-radius: 10px; margin: 8px 0; }

.researcher-detail { background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: var(--radius-lg); padding: 32px; margin-top: 24px; box-shadow: inset 0 0 40px rgba(0,0,0,0.2); }
.researcher-detail h3 { font-size: 26px; font-weight: 800; margin-bottom: 24px; color: #fff; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 24px; }
.detail-stat { background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 16px; padding: 20px; text-align: center; }
.detail-stat h4 { font-size: 28px; font-weight: 800; color: var(--accent-main); margin-bottom: 4px; }
.detail-stat p { font-size: 12px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; }
.detail-kws { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.kw-tag { padding: 8px 16px; background: rgba(139, 92, 246, 0.15); color: #A78BFA; border: 1px solid rgba(139, 92, 246, 0.3); border-radius: 20px; font-size: 13px; font-weight: 600; }
.detail-papers h4 { font-size: 16px; font-weight: 700; margin-bottom: 16px; color: #fff; }
.detail-paper-item { padding: 12px 16px; background: rgba(0,0,0,0.2); border-radius: 12px; margin-bottom: 8px; font-size: 14px; color: var(--text-muted); border: 1px solid rgba(255,255,255,0.02); }

/* ── GAP Analysis ── */
.gap-actions { margin-bottom: 8px; }
.gap-sync-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.gap-column { padding: 28px; }
.gap-col-title { font-size: 16px; font-weight: 800; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 2px solid rgba(255,255,255,0.05); }
.gap-col-title.internal { color: #60A5FA; }
.gap-col-title.global { color: #A78BFA; }
.gap-col-title.gap { color: #F87171; }
.gap-kw-list { display: flex; flex-direction: column; gap: 10px; max-height: 400px; overflow-y: auto; padding-right: 8px; }
.gap-kw-list::-webkit-scrollbar { width: 4px; }
.gap-kw-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 4px; }
.gap-kw-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255,255,255,0.05); border-radius: 12px; font-size: 14px; font-weight: 500; }
.gap-kw-item .rank { font-size: 12px; color: var(--text-muted); font-weight: 800; width: 24px; flex-shrink: 0; }
.gap-kw-item.gap-item { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.2); color: #FCA5A5; }

/* ── Modals ── */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px); }
.modal-content { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 90%; max-width: 540px; padding: 40px; background: #13111C; border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-lg); box-shadow: 0 25px 50px rgba(0,0,0,0.5); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.modal-header h3 { font-size: 20px; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 10px; }
.close-modal { background: none; border: none; font-size: 32px; cursor: pointer; color: var(--text-muted); transition: color 0.2s; }
.close-modal:hover { color: #fff; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }

.drop-zone { border: 2px dashed rgba(99, 102, 241, 0.3); border-radius: var(--radius-md); padding: 48px; text-align: center; cursor: pointer; transition: all 0.2s; background: rgba(99, 102, 241, 0.05); }
.drop-zone:hover, .drop-zone.dragover { background: rgba(99, 102, 241, 0.1); border-color: var(--accent-main); }
.drop-zone i { width: 48px; height: 48px; color: var(--accent-main); margin-bottom: 16px; }
.drop-zone p { font-size: 15px; color: var(--text-muted); font-weight: 500; }

select.input-minimal { appearance: none; background: rgba(255, 255, 255, 0.05); padding: 14px 20px; border-radius: 12px; width: 100%; border: 1px solid rgba(255,255,255,0.1); font-family: inherit; font-weight: 500; color: #fff; cursor: pointer; }
select.input-minimal option { background: #13111C; color: #fff; }

/* ── Toasts ── */
#toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: #1F2937;
    color: #F9FAFB;
    padding: 14px 28px;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    pointer-events: none;
}