:root { --bg-color: #0f172a; --panel-bg: rgba(30, 41, 59, 0.85); --text-main: #f8fafc; --text-muted: #94a3b8; --accent: #3b82f6; --positive: #10b981; --negative: #ef4444; --warning: #f59e0b; }
body, html { margin: 0; padding: 0; width: 100%; height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background-color: var(--bg-color); color: var(--text-main); overflow: hidden; }
#top-bar { position: absolute; top: 15px; left: 15px; z-index: 10; display: flex; gap: 10px; }
.secondary-btn { background: rgba(255, 255, 255, 0.1); color: white; border: 1px solid rgba(255,255,255,0.2); padding: 8px 15px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 500; backdrop-filter: blur(5px); transition: background 0.2s; }
.secondary-btn:hover { background: rgba(255, 255, 255, 0.2); }
#network-container { width: 100%; height: 100vh; position: absolute; top: 0; left: 0; z-index: 1; }

#node-panel { position: absolute; top: 0; right: 0; width: 100%; max-width: 420px; height: 100vh; background: var(--panel-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-left: 1px solid rgba(255, 255, 255, 0.1); z-index: 10; transition: transform 0.3s ease-in-out; box-shadow: -5px 0 25px rgba(0,0,0,0.5); overflow-y: auto; }
#node-panel.hidden { transform: translateX(100%); }
#close-panel { position: absolute; top: 15px; right: 15px; background: transparent; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; }
#panel-content { padding: 40px 25px 25px 25px; }

.badge { background: var(--accent); padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: bold; }
.badge-conf { padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: bold; border: 1px solid; }
.badge-conf.abs { background: rgba(245, 158, 11, 0.2); color: var(--warning); border-color: var(--warning); }
.badge-conf.rel { background: rgba(16, 185, 129, 0.2); color: var(--positive); border-color: var(--positive); }
h2 { margin-top: 15px; margin-bottom: 10px; font-size: 22px; }
#node-description { color: var(--text-muted); line-height: 1.6; font-size: 14px; white-space: pre-wrap; }
h3 { font-size: 14px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 5px; margin-top: 15px; }

/* Fonti & Links */
.source-link { color: var(--accent); text-decoration: none; display: flex; align-items: center; gap: 5px; margin-top: 5px; background: rgba(59, 130, 246, 0.1); padding: 5px 8px; border-radius: 4px; border: 1px solid rgba(59, 130, 246, 0.2); transition: 0.2s; }
.source-link:hover { background: rgba(59, 130, 246, 0.2); }

/* Impatti e Tooltip */
.impact-item { display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.2); padding: 10px; border-radius: 8px; margin-bottom: 8px; font-size: 13px; position: relative; cursor: help; }
.impact-item.positive { border-left: 4px solid var(--positive); }
.impact-item.negative { border-left: 4px solid var(--negative); }
.impact-val { font-weight: bold; font-size: 14px; padding: 2px 8px; border-radius: 4px; background: rgba(255,255,255,0.1); }

.deep-dive-area { background: rgba(0,0,0,0.2); padding: 15px; border-radius: 8px; margin-bottom: 15px; border: 1px dashed rgba(255,255,255,0.2); }
.action-area { margin-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px;}
textarea { width: 100%; height: 60px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.2); color: white; padding: 10px; border-radius: 8px; box-sizing: border-box; font-family: inherit; resize: none; margin-bottom: 15px; }
.primary-btn { width: 100%; background: var(--accent); color: white; border: none; padding: 12px; border-radius: 8px; font-weight: bold; cursor: pointer; transition: background 0.2s; }
.primary-btn:hover { background: #2563eb; }
.primary-btn:disabled { background: #475569; cursor: not-allowed; }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(8px); display: flex; justify-content: center; align-items: center; z-index: 100; }
.modal-overlay.hidden { display: none; }
.modal-content { background: var(--panel-bg); padding: 30px; border-radius: 12px; width: 90%; max-width: 480px; border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.input-label { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 5px; font-weight: bold; text-transform: uppercase; }
.input-field { width: 100%; padding: 10px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.2); color: white; border-radius: 6px; box-sizing: border-box; margin-bottom: 15px; font-family: inherit; }

/* Guida UI */
.guide-sidebar { width: 250px; background: rgba(0,0,0,0.3); padding: 20px; border-right: 1px solid rgba(255,255,255,0.1); overflow-y: auto; }
.guide-sidebar ul { list-style: none; padding: 0; margin: 0; }
.guide-sidebar li { padding: 10px; color: var(--text-muted); cursor: pointer; border-radius: 6px; margin-bottom: 5px; font-size: 14px; transition: 0.2s; }
.guide-sidebar li:hover { background: rgba(255,255,255,0.1); }
.guide-sidebar li.active { background: var(--accent); color: white; font-weight: bold; }
.guide-body { flex: 1; padding: 40px; overflow-y: auto; position: relative; }
.guide-section { display: none; }
.guide-section.active { display: block; animation: fadeIn 0.3s ease-in-out; }
.guide-section h2 { color: white; margin-top: 0; }
.guide-section p, .guide-section li { color: #cbd5e1; line-height: 1.7; font-size: 15px; margin-bottom: 15px; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }