/* Deep Space Base */
body {
    margin: 0;
    overflow: hidden;
    background-color: #050510;
    font-family: 'Inter', sans-serif;
    color: #e2e8f0;
}

/* 3D Graph Canvas */
#3d-graph {
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Header */
#header {
    position: absolute;
    top: 20px;
    left: 30px;
    z-index: 10;
    pointer-events: none;
    max-width: 500px;
}

#header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0 0 10px 0;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

#header p {
    font-size: 1rem;
    color: #94a3b8;
    margin: 0 0 5px 0;
    line-height: 1.5;
}

#header .hint {
    font-size: 0.85rem;
    color: #475569;
    margin-bottom: 20px;
}

.btn-back {
    display: inline-block;
    pointer-events: auto;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

/* Glassmorphism Data Panel */
#data-panel {
    position: absolute;
    top: 20px;
    right: 30px;
    width: 360px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    z-index: 10;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
}

#data-panel.hidden {
    transform: translateX(120%);
    opacity: 0;
    pointer-events: none;
}

#close-panel {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

#close-panel:hover {
    color: #fff;
}

#node-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

#node-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #f8fafc;
    line-height: 1.3;
}

/* Data Groups */
.data-group {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 7px;
    padding: 8px 12px;
    margin-bottom: 7px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.data-group h3 {
    font-size: 0.7rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    margin: 0 0 3px 0;
    letter-spacing: 0.5px;
}

.data-group p {
    font-size: 0.82rem;
    color: #e2e8f0;
    margin: 0;
    line-height: 1.45;
}

/* Specific styling for importance */
.data-group.warning {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.2);
}
.data-group.warning h3 { color: #f87171; }

.data-group.highlight {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.2);
}
.data-group.highlight h3 { color: #34d399; }

.data-group.suggestion {
    background: rgba(139, 92, 246, 0.05);
    border-color: rgba(139, 92, 246, 0.2);
}
.data-group.suggestion h3 { color: #a78bfa; }

/* Custom Scrollbar for Panel */
#data-panel::-webkit-scrollbar {
    width: 6px;
}
#data-panel::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}
#data-panel::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
}
#data-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.4);
}


/* Top Controls */
#controls {
    position: absolute;
    top: 20px;
    right: 30px;
    z-index: 10;
    display: flex;
    gap: 10px;
}

.control-btn {
    padding: 8px 16px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #f8fafc;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Legend */
#legend {
    position: absolute;
    bottom: 30px;
    left: 30px;
    z-index: 10;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px 20px;
    width: 220px;
}

#legend h3 {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#legend ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#legend li {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: #e2e8f0;
}

.color-box {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 10px;
    display: inline-block;
}

/* Adjust data panel so it doesn't overlap controls */
#data-panel {
    top: 70px;
}
