/* ============================================
   Function Call Graph Viewer — Styles
   Theme: Dark IDE with neon connection lines
   ============================================ */

:root {
    --primary: #00D4AA;
    --primary-rgb: 0, 212, 170;
    --secondary: #00B4FF;
    --secondary-rgb: 0, 180, 255;
    --accent: #FF6B9D;
    --accent-rgb: 255, 107, 157;
    --warning-color: #FBBF24;
    --background: #0A0E14;
    --surface: #141820;
    --surface-hover: #1C222E;
    --border: rgba(0, 212, 170, 0.12);
    --border-hover: rgba(0, 212, 170, 0.25);
    --text-primary: #E6EDF3;
    --text-secondary: #8B949E;
    --text-muted: #484F58;
    --radius: 10px;
    --radius-sm: 6px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --transition: 200ms ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.app-header {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-header h1 {
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-subtitle {
    color: var(--text-muted);
    font-size: 0.72rem;
    margin-left: auto;
}

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.toolbar-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}

.toolbar-value {
    font-size: 0.7rem;
    color: var(--primary);
    font-family: var(--font-mono);
    min-width: 24px;
}

.toolbar-select {
    padding: 5px 24px 5px 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    appearance: none;
    cursor: pointer;
    outline: none;
    background-image: url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 8 5' fill='none'%3E%3Cpath d='M1 1l3 3 3-3' stroke='%238B949E' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
}

.toolbar-range {
    width: 80px;
    accent-color: var(--primary);
}

.toolbar-search {
    padding: 5px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    outline: none;
    width: 160px;
    transition: all var(--transition);
}

.toolbar-search:focus {
    border-color: var(--primary);
    width: 200px;
}

.toolbar-search::placeholder {
    color: var(--text-muted);
}

.btn-tool {
    padding: 5px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-tool:hover {
    background: var(--surface-hover);
    color: var(--primary);
    border-color: var(--border-hover);
}

.btn-ghost-sm {
    padding: 3px 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.65rem;
    cursor: pointer;
    transition: color var(--transition);
}

.btn-ghost-sm:hover {
    color: var(--primary);
}

/* Main */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Split Pane */
.split-pane {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.editor-pane {
    width: 35%;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
}

.graph-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.pane-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.graph-stats {
    font-size: 0.65rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.code-editor {
    flex: 1;
    width: 100%;
    padding: 12px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.7;
    resize: none;
    outline: none;
    overflow: auto;
    tab-size: 2;
}

.code-editor::placeholder {
    color: var(--text-muted);
}

#graph-canvas {
    flex: 1;
    width: 100%;
    cursor: grab;
    background: transparent;
}

#graph-canvas:active {
    cursor: grabbing;
}

/* Info Panel */
.info-panel {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 400px;
    max-height: 50vh;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: flex;
    flex-direction: column;
    animation: slideUp 200ms ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.info-fn-name {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--primary);
}

.info-badges {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.info-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.6rem;
    font-weight: 700;
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary);
}

.info-badge.accent {
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--accent);
}

.btn-close {
    padding: 2px 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    transition: color var(--transition);
}

.btn-close:hover {
    color: var(--accent);
}

.info-source {
    flex: 1;
    overflow: auto;
    padding: 12px 16px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.7;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

/* Legend */
.legend {
    display: flex;
    gap: 16px;
    padding: 8px 20px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot.exported {
    background: var(--primary);
    box-shadow: 0 0 6px rgba(var(--primary-rgb), 0.5);
}

.legend-dot.private {
    background: var(--secondary);
    box-shadow: 0 0 6px rgba(var(--secondary-rgb), 0.5);
}

.legend-dot.recursive {
    background: var(--accent);
    box-shadow: 0 0 6px rgba(var(--accent-rgb), 0.5);
}

.legend-dot.highlighted {
    background: var(--warning-color);
    box-shadow: 0 0 6px rgba(251, 191, 36, 0.5);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid rgba(var(--primary-rgb), 0.3);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.78rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: toastIn 200ms ease;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(16px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
        transform: translateX(16px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .split-pane {
        flex-direction: column;
    }

    .editor-pane {
        width: 100%;
        height: 40%;
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .info-panel {
        width: 100%;
    }

    .toolbar {
        padding: 6px 12px;
    }

    .toolbar-search {
        width: 120px;
    }

    .header-subtitle {
        display: none;
    }
}