@import "../../style.css";

.app {
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--space-5) var(--space-3) var(--space-5);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}

.title h1 {
    margin: 0 0 var(--space-2);
    font-size: 30px;
    letter-spacing: 0.02em;
}

.title p {
    margin: 0;
    color: var(--muted);
    max-width: 520px;
}

.panel {
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-3);
    box-shadow: var(--shadow);
}

.section-label {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
}

textarea {
    width: 100%;
    min-height: 240px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-alt);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 15px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

textarea:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.7);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
    background: #0e192c;
}

.meta-row {
    margin-top: var(--space-3);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 260px);
    gap: var(--space-3);
}

.stats {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
}

.stats-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 6px 12px;
}

.stats-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 0;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.12);
}

.stats-item:last-child {
    border-bottom: none;
}

.stats-key {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.stats-value {
    font-size: 16px;
    font-weight: 700;
    color: #e0f2fe;
}

.diagnostics {
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: var(--space-2);
    background: var(--panel);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    min-height: 80px;
}

.diagnostics strong {
    color: var(--accent-strong);
    display: block;
    margin-bottom: 6px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.top-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
}

.graph-panel {
    margin-top: var(--space-3);
}

.header-panel {
    margin-top: var(--space-3);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
    flex-wrap: wrap;
}

.panel-header h2 {
    margin: 0;
    font-size: 18px;
}

.badge {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.03);
}

.panel-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.tree {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    color: #dbeafe;
    background: #05080f;
    border: 1px solid #0c1422;
    border-radius: calc(var(--radius) - 4px);
    padding: var(--space-3);
}

.tree ul {
    list-style: none;
    margin: 0;
    padding-left: 18px;
    border-left: 1px dashed var(--border);
}

.tree li {
    margin: 4px 0;
    position: relative;
}

.tree li::before {
    content: "";
    position: absolute;
    left: -18px;
    top: 12px;
    width: 12px;
    border-top: 1px dashed var(--border);
}

.tree .label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tree .label[data-kind="file"] {
    color: #7dd3fc;
}

.tree .label[data-kind="class"] {
    color: #38bdf8;
}

.tree .label[data-kind="constructor"] {
    color: #60a5fa;
}

.tree .label[data-kind="method"] {
    color: #a5b4fc;
}

.tree .label[data-kind="property"] {
    color: #fbbf24;
}

.tree .label[data-kind="function"] {
    color: #34d399;
}

.tree .label[data-kind="function-object"] {
    color: #6ee7b7;
}

.tree .label[data-kind="interface"] {
    color: #f472b6;
}

.tree .label[data-kind="enum"] {
    color: #cbd5f5;
}

.tree .label[data-kind="group"],
.tree .label[data-kind="muted"] {
    color: var(--muted);
}

.tree .tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.tree .empty {
    color: var(--muted);
    padding: var(--space-2);
}

.header-view {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    color: #e2e8f0;
    background: #05080f;
    border: 1px solid #0c1422;
    border-radius: calc(var(--radius) - 4px);
    padding: var(--space-3);
    margin: 0;
    white-space: pre-wrap;
    min-height: 220px;
    overflow: auto;
}

.header-view .hv-keyword {
    color: #38bdf8;
}

.header-view .hv-name {
    color: #e2e8f0;
}

.header-view .hv-type {
    color: #f472b6;
}

.header-view .hv-mod {
    color: #a5b4fc;
}

.header-view .hv-signature {
    color: #cbd5f5;
}

.header-view .hv-punct {
    color: #64748b;
}

.header-view .hv-muted {
    color: var(--muted);
}

.graph {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    min-height: 420px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: radial-gradient(120% 120% at 20% 20%, rgba(56, 189, 248, 0.05), transparent 50%), #05080f;
}

.graph .empty {
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.legend {
    margin-top: var(--space-2);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--muted);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.legend-class {
    background: #38bdf8;
}

.legend-method {
    background: #a5b4fc;
}

.legend-prop {
    background: #fbbf24;
}

.legend-function {
    background: #34d399;
}

.legend-interface {
    background: #f472b6;
}

.legend-external {
    background: #94a3b8;
}

.ghost-button {
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text);
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.ghost-button:hover {
    border-color: rgba(56, 189, 248, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.18);
}

.ghost-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.footer-note {
    margin-top: var(--space-4);
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 900px) {
    .meta-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .app {
        padding: var(--space-4) var(--space-3) var(--space-4);
    }

    .title h1 {
        font-size: 24px;
    }

    textarea {
        min-height: 200px;
    }

    .graph {
        min-height: 320px;
    }
}
