/* GitAnatomy - GitHub Repository Analyzer Styles */
:root {
    --bg: #0a0e14;
    --surface: #131920;
    --surface-2: #1a2029;
    --surface-3: #222b36;
    --border: #2a3442;
    --text: #e8edf5;
    --text-muted: #7d8a9b;
    --primary: #4facfe;
    --primary-hover: #6fbfff;
    --accent: #a855f7;
    --accent-hover: #c084fc;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --info: #60a5fa;
    --radius: 12px;
    --shadow: 0 8px 32px rgba(0,0,0,0.5);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
    background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh;
}
.app-container { max-width: 1320px; margin: 0 auto; padding: 2rem 1.5rem; }

/* Header */
.app-header { text-align: center; margin-bottom: 2rem; }
.logo-section { display: flex; align-items: center; justify-content: center; gap: 0.75rem; }
.logo-icon { font-size: 2.5rem; }
.app-header h1 {
    font-size: 2.2rem; font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.tagline { color: var(--text-muted); margin-top: 0.4rem; font-size: 1rem; }

/* Input Section */
.input-section {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem;
}
.input-row { display: flex; gap: 0.75rem; align-items: center; }
.repo-input, .token-input {
    padding: 0.75rem 1rem; background: var(--surface-2);
    border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 0.95rem;
}
.repo-input { flex: 2.5; }
.token-input { flex: 1; }
.repo-input:focus, .token-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,172,254,0.1); }
.input-hint { color: var(--text-muted); font-size: 0.78rem; margin-top: 0.6rem; }

/* Progress */
.progress-bar { margin-bottom: 1.5rem; display: flex; align-items: center; gap: 1rem; }
.progress-track { flex: 1; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 3px; transition: width 0.3s; width: 0%; }
.progress-text { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; min-width: 120px; }

/* Tabs */
.tab-nav {
    display: flex; gap: 0.25rem; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 0.4rem; margin-bottom: 1.5rem; flex-wrap: wrap;
}
.tab {
    padding: 0.5rem 1rem; border: none; border-radius: 8px; font-size: 0.82rem;
    font-weight: 600; cursor: pointer; background: transparent; color: var(--text-muted);
    transition: all 0.2s; white-space: nowrap;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active { background: var(--primary); color: #000; }

/* Buttons */
.btn {
    padding: 0.5rem 1rem; border: none; border-radius: 6px; font-size: 0.85rem;
    font-weight: 600; cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.75rem; }
.btn-primary { background: var(--primary); color: #000; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(0,0,0,0.3); border-top-color: #000; border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Export Bar */
.export-bar {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 0.6rem 1.25rem; display: flex; align-items: center; gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.export-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }

/* Cards */
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.25rem; margin-bottom: 1rem;
}
.card-title { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.75rem; color: var(--text); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; }
.stat-box {
    background: var(--surface-2); border-radius: 8px; padding: 1rem; text-align: center;
    border: 1px solid var(--border);
}
.stat-val { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.stat-lbl { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.25rem; }

/* Language Bar */
.lang-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin: 0.75rem 0; }
.lang-segment { height: 100%; transition: width 0.3s; }
.lang-legend { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.5rem; }
.lang-item { display: flex; align-items: center; gap: 0.35rem; font-size: 0.75rem; color: var(--text-muted); }
.lang-dot { width: 10px; height: 10px; border-radius: 50%; }

/* File Tree */
.tree { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.78rem; }
.tree-item { padding: 0.25rem 0; display: flex; align-items: center; gap: 0.4rem; }
.tree-item:hover { background: var(--surface-2); border-radius: 4px; }
.tree-icon { width: 16px; text-align: center; }
.tree-dir { color: var(--primary); font-weight: 600; cursor: pointer; }
.tree-file { color: var(--text-muted); }
.tree-indent { display: inline-block; }
.tree-size { color: var(--text-muted); font-size: 0.7rem; margin-left: auto; }

/* Dependency List */
.dep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.6rem; }
.dep-item {
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
    padding: 0.6rem 0.8rem; display: flex; justify-content: space-between; align-items: center;
}
.dep-name { font-family: 'SF Mono', monospace; font-size: 0.78rem; color: var(--text); }
.dep-ver { font-size: 0.7rem; color: var(--text-muted); background: var(--surface-3); padding: 0.1rem 0.4rem; border-radius: 4px; }
.dep-section-title { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); margin: 1rem 0 0.5rem; text-transform: uppercase; }

/* Contributors */
.contrib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; }
.contrib-card {
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
    padding: 0.75rem; display: flex; align-items: center; gap: 0.75rem;
}
.contrib-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-3); }
.contrib-name { font-size: 0.82rem; font-weight: 600; }
.contrib-commits { font-size: 0.7rem; color: var(--text-muted); }

/* Activity / Commits */
.commit-list { max-height: 400px; overflow-y: auto; }
.commit-item { padding: 0.6rem 0; border-bottom: 1px solid var(--border); display: flex; gap: 0.75rem; }
.commit-hash { font-family: 'SF Mono', monospace; font-size: 0.72rem; color: var(--primary); min-width: 60px; }
.commit-msg { font-size: 0.8rem; flex: 1; }
.commit-meta { font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; }

/* Data Dictionary */
.dict-table {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: 1rem; overflow: hidden;
}
.dict-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.dict-name { font-family: 'SF Mono', monospace; font-weight: 700; font-size: 0.95rem; }
.dict-source { font-size: 0.68rem; color: var(--text-muted); background: var(--surface-3); padding: 0.15rem 0.5rem; border-radius: 4px; }
.col-table { width: 100%; border-collapse: collapse; font-size: 0.76rem; }
.col-table th {
    text-align: left; padding: 0.45rem 0.6rem; background: var(--surface-2); color: var(--text-muted);
    font-weight: 600; text-transform: uppercase; font-size: 0.64rem; letter-spacing: 0.04em;
}
.col-table td { padding: 0.45rem 0.6rem; border-top: 1px solid var(--border); }
.col-table tr:hover td { background: rgba(79,172,254,0.04); }
.type-pill {
    font-family: 'SF Mono', monospace; font-size: 0.7rem;
    background: var(--surface-3); padding: 0.12rem 0.4rem; border-radius: 4px; color: var(--primary);
}
.badge { display: inline-block; padding: 0.08rem 0.35rem; border-radius: 3px; font-size: 0.62rem; font-weight: 600; margin-right: 0.15rem; }
.badge-pk { background: rgba(52,211,153,0.15); color: var(--success); }
.badge-fk { background: rgba(251,191,36,0.15); color: var(--warning); }
.badge-uq { background: rgba(168,85,247,0.15); color: var(--accent); }
.badge-idx { background: rgba(96,165,250,0.15); color: var(--info); }
.badge-null { background: rgba(125,138,155,0.12); color: var(--text-muted); }

/* Empty State / Home Screen */
.empty-state { text-align: center; padding: 2rem 1rem 3rem; }
.hero-section { margin-bottom: 2.5rem; }
.empty-icon { font-size: 4rem; margin-bottom: 1rem; filter: drop-shadow(0 4px 12px rgba(79,172,254,0.3)); }
.empty-state h2 {
    font-size: 1.8rem; font-weight: 800; color: var(--text); margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-desc { color: var(--text-muted); font-size: 1.05rem; max-width: 560px; margin: 0 auto; line-height: 1.6; }
.hero-desc strong { color: var(--text); }

.feature-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem; margin: 0 auto 2.5rem; max-width: 820px; text-align: left;
}
.feature-item {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.25rem; transition: transform 0.2s, border-color 0.2s;
}
.feature-item:hover { transform: translateY(-2px); border-color: var(--primary); }
.feature-item span { font-size: 1.6rem; display: block; margin-bottom: 0.5rem; }
.feature-item h4 { font-size: 0.9rem; font-weight: 700; color: var(--text); margin-bottom: 0.3rem; }
.feature-item p { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; margin: 0; }

.supported-section, .export-section { margin-bottom: 2rem; }
.supported-section h3, .export-section h3, .how-it-works h3 {
    font-size: 0.85rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.05em; margin-bottom: 0.75rem;
}
.platform-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.pill {
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 20px;
    padding: 0.4rem 1rem; font-size: 0.78rem; color: var(--text); font-weight: 500;
}
.pill-accent { border-color: rgba(168,85,247,0.3); color: var(--accent); }
.pill-success { border-color: rgba(52,211,153,0.3); color: var(--success); }

.how-it-works { margin: 2.5rem auto; max-width: 700px; }
.steps-row { display: flex; align-items: center; justify-content: center; gap: 0.75rem; flex-wrap: wrap; }
.step {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1rem 1.25rem; min-width: 160px; text-align: center;
}
.step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #000;
    font-weight: 800; font-size: 0.85rem; margin-bottom: 0.5rem;
}
.step p { font-size: 0.78rem; color: var(--text-muted); margin: 0; }
.step-arrow { font-size: 1.2rem; color: var(--text-muted); }

.footer-note { margin-top: 2.5rem; }
.footer-note p { font-size: 0.75rem; color: var(--text-muted); letter-spacing: 0.02em; }

/* Readme */
.readme-content { font-size: 0.85rem; line-height: 1.7; color: var(--text-muted); max-height: 300px; overflow-y: auto; }
.readme-content h1, .readme-content h2, .readme-content h3 { color: var(--text); margin: 1rem 0 0.5rem; }
.readme-content code { background: var(--surface-3); padding: 0.15rem 0.4rem; border-radius: 3px; font-size: 0.8rem; }
.readme-content pre { background: var(--surface-2); padding: 1rem; border-radius: 8px; overflow-x: auto; margin: 0.75rem 0; }

.hidden { display: none !important; }

/* Scroll Navigation */
.scroll-nav {
    position: fixed; right: 1.5rem; bottom: 5rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 101;
}
.scroll-btn {
    width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); font-size: 1.2rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow);
    transition: all 0.2s;
}
.scroll-btn:hover { background: var(--primary); color: #000; border-color: var(--primary); }

@media (max-width: 768px) {
    .input-row { flex-direction: column; }
    .tab-nav { flex-wrap: wrap; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .export-bar { bottom: 0.75rem; padding: 0.5rem 0.75rem; }
}

/* Auto Light Theme */
@media (prefers-color-scheme: light) {
    :root {
        --bg: #f5f5f7;
        --surface: #ffffff;
        --surface-2: #f0f0f2;
        --surface-3: #e8e8ed;
        --border: #d2d2d7;
        --text: #1d1d1f;
        --text-muted: #6e6e73;
        --primary: #0071e3;
        --primary-hover: #0077ed;
        --accent: #9b59b6;
        --accent-hover: #8e44ad;
        --success: #28a745;
        --warning: #e67e22;
        --danger: #e74c3c;
        --info: #2980b9;
        --shadow: 0 4px 16px rgba(0,0,0,0.08);
    }
    .tab.active { background: var(--primary); color: #fff; }
    .btn-primary { background: var(--primary); color: #fff; }
    .btn-primary:hover { background: var(--primary-hover); color: #fff; }
    .spinner { border-color: rgba(255,255,255,0.3); border-top-color: #fff; }
    .app-header h1 {
        background: linear-gradient(135deg, var(--primary), var(--accent));
        -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    }
}
