:root {
    --primary: #EC4899;
    --secondary: #F9A8D4;
    --accent: #F59E0B;
    --background: #1A0A14;
    --glass-bg: rgba(26, 10, 20, 0.7);
    --glass-border: rgba(236, 72, 153, 0.2);
    --text-main: #f5f6fa;
    --text-muted: #a1a1aa;

    --node-main: rgba(236, 72, 153, 0.9);
    --node-dep: rgba(249, 168, 212, 0.7);
    --node-highlight: #F59E0B;
    --edge-prod: rgba(249, 168, 212, 0.4);
    --edge-dev: rgba(161, 161, 170, 0.3);
    --edge-peer: rgba(245, 158, 11, 0.4);
    --edge-highlight: #F59E0B;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

.glass-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 10% 20%, rgba(236, 72, 153, 0.15), transparent 30%),
        radial-gradient(circle at 90% 80%, rgba(245, 158, 11, 0.10), transparent 30%);
    z-index: -1;
}

.layout {
    display: flex;
    height: 100vh;
    padding: 1.5rem;
    gap: 1.5rem;
}

.sidebar {
    width: 340px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

header {
    margin-bottom: 2rem;
}

header h1 {
    font-size: 1.8rem;
    color: var(--secondary);
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.25rem;
}

header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--secondary);
}

input[type="text"],
input[type="file"] {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-main);
    padding: 0.75rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.2);
}

.upload-zone {
    border: 2px dashed var(--glass-border);
    padding: 1.5rem 1rem;
    text-align: center;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(236, 72, 153, 0.1);
}

.upload-zone input[type="file"] {
    display: none;
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.filters {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-main);
    font-weight: normal;
}

.checkbox-label input {
    accent-color: var(--primary);
}

.alert-box {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--accent);
    padding: 1rem;
    border-radius: 8px;
}

.hidden {
    display: none !important;
}

.btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.primary-btn {
    background: var(--primary);
    color: white;
}

.primary-btn:hover:not(:disabled) {
    background: #db2777;
    /* darker pink */
}

.secondary-btn {
    background: var(--accent);
    color: #1A0A14;
    margin-bottom: 0.75rem;
}

.secondary-btn:hover:not(:disabled) {
    background: #d97706;
    /* darker amber */
}

.outline-btn {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-main);
}

.outline-btn:hover:not(:disabled) {
    border-color: var(--secondary);
}

.main-content {
    flex: 1;
    display: flex;
    position: relative;
    gap: 1.5rem;
}

#graph-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    /* Remove padding for SVG to fill */
}

#graph-container svg {
    width: 100%;
    height: 100%;
    cursor: grab;
}

#graph-container svg:active {
    cursor: grabbing;
}

#empty-state {
    text-align: center;
    color: var(--text-muted);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#empty-state .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.inspector {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 320px;
    max-height: calc(100% - 3rem);
    overflow-y: auto;
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.inspector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.inspector-header h3 {
    font-size: 1.1rem;
    color: var(--secondary);
    word-break: break-all;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.btn-close:hover {
    color: white;
}

.inspector-section {
    margin-bottom: 1rem;
}

.inspector-section h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.dep-list {
    list-style: none;
}

.dep-item {
    padding: 0.4rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    transition: background 0.2s;
    cursor: pointer;
}

.dep-item:hover {
    background: rgba(236, 72, 153, 0.2);
}

.dep-version {
    color: var(--secondary);
    font-family: monospace;
}

/* Tooltip */
.d3-tooltip {
    position: absolute;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.8rem;
    background: rgba(10, 31, 28, 0.9);
    border: 1px solid var(--primary);
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 100;
    color: white;
}