* { margin: 0; padding: 0; box-sizing: border-box; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }
* { scrollbar-width: thin; scrollbar-color: #334155 #0f172a; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: #0f172a; color: #e2e8f0; height: 100vh; overflow: hidden; }
#app { display: flex; flex-direction: column; height: 100vh; }

header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 20px; background: #1e293b; border-bottom: 1px solid #334155;
}
header h1 { font-size: 1.4rem; color: #38bdf8; }
.user-bar { display: flex; align-items: center; gap: 10px; }
.user-bar input { background: #0f172a; border: 1px solid #334155; color: #e2e8f0; padding: 4px 8px; border-radius: 4px; }
.user-bar button { background: #38bdf8; color: #0f172a; border: none; padding: 4px 12px; border-radius: 4px; cursor: pointer; font-weight: 600; }
#userInfo { font-size: 0.85rem; color: #94a3b8; }

main { display: flex; flex: 1; overflow: hidden; }

#sidebar {
  width: 260px; background: #1e293b; padding: 15px; display: flex;
  flex-direction: column; gap: 15px; overflow-y: auto; border-right: 1px solid #334155;
}
#sidebar h3 { font-size: 0.85rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.explore-box input, .style-box select, .search-box input {
  width: 100%; background: #0f172a; border: 1px solid #334155;
  color: #e2e8f0; padding: 6px 10px; border-radius: 4px; margin-bottom: 6px;
}
.explore-box button, .style-box button, .search-box button {
  width: 100%; background: #38bdf8; color: #0f172a; border: none;
  padding: 6px 12px; border-radius: 4px; cursor: pointer; font-weight: 600;
}
.explore-box button:hover, .style-box button:hover, .search-box button:hover { background: #0ea5e9; }
#exploreStatus { font-size: 0.8rem; color: #fbbf24; margin-top: 4px; }

.search-box { border-top: 1px solid #334155; padding-top: 10px; }
#searchResults { font-size: 0.8rem; margin-top: 4px; max-height: 120px; overflow-y: auto; }
.search-item { padding: 4px 6px; cursor: pointer; border-radius: 3px; margin-bottom: 2px; }
.search-item:hover { background: #334155; }

#medalsList { display: flex; flex-wrap: wrap; gap: 6px; }
.medal { background: #334155; padding: 4px 10px; border-radius: 12px; font-size: 0.75rem; color: #fbbf24; border: 1px solid #fbbf24; }

.data-box { border-top: 1px solid #334155; padding-top: 10px; }
.data-box button {
  width: 100%; background: #475569; color: #e2e8f0; border: none;
  padding: 6px 12px; border-radius: 4px; cursor: pointer; font-weight: 600; margin-bottom: 4px;
}
.data-box button:hover { background: #64748b; }

#graph-container { flex: 1; position: relative; min-width: 300px; }
#graph { width: 100%; height: 100%; }

#content-panel {
  width: 420px; background: #1e293b; padding: 15px; overflow-y: auto;
  border-left: 1px solid #334155;
}
#nodoContent .hint { color: #64748b; text-align: center; margin-top: 40%; font-style: italic; }
#nodoContent h2 { color: #38bdf8; margin-bottom: 10px; }
#nodoContent .area { color: #94a3b8; font-size: 0.8rem; margin-bottom: 15px; }
#nodoContent .bloque { background: #0f172a; padding: 12px; border-radius: 6px; margin-bottom: 10px; border-left: 3px solid #38bdf8; }
#nodoContent .bloque p { white-space: pre-wrap; line-height: 1.5; }
#nodoContent .bloque strong { color: #fbbf24; }

.tags-box { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; align-items: center; }
.tag { background: #1e3a5f; color: #60a5fa; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; border: 1px solid #3b82f6; }
.tag-edit { cursor: pointer; font-size: 0.85rem; opacity: 0.6; margin-left: 4px; }
.tag-edit:hover { opacity: 1; }

.tags-view-box { border-top: 1px solid #334155; padding-top: 10px; }
.tags-list { display: flex; flex-wrap: wrap; gap: 4px; max-height: 120px; overflow-y: auto; }
.tag-option { background: #1e293b; color: #94a3b8; padding: 3px 10px; border-radius: 12px; font-size: 0.75rem; border: 1px solid #475569; cursor: pointer; }
.tag-option:hover { background: #334155; color: #e2e8f0; border-color: #60a5fa; }
.tag-option.tag-active { background: #1e3a5f; color: #60a5fa; border-color: #3b82f6; font-weight: 600; }
.tag-filter-info { margin-top: 6px; font-size: 0.8rem; display: flex; align-items: center; gap: 6px; }
.tag-clear { cursor: pointer; color: #ef4444; font-weight: bold; font-size: 0.9rem; }
.tag-clear:hover { color: #f87171; }

.quiz-box { background: #0f172a; padding: 15px; border-radius: 6px; margin-top: 15px; border: 1px solid #334155; }
.quiz-box h3 { color: #fbbf24; margin-bottom: 10px; font-size: 0.9rem; }
.pregunta { margin-bottom: 12px; }
.pregunta p { font-size: 0.9rem; margin-bottom: 6px; color: #e2e8f0; }
.pregunta label { display: block; padding: 4px 8px; cursor: pointer; font-size: 0.85rem; border-radius: 3px; }
.pregunta label:hover { background: #334155; }
.pregunta input { margin-right: 6px; }
#submitQuiz, .quizResult + button { background: #22c55e; color: #0f172a; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; font-weight: 600; width: 100%; margin-top: 8px; }
.quizResult { margin-top: 8px; font-weight: bold; text-align: center; font-size: 1rem; padding: 8px; border-radius: 4px; }
.quizResult.pass { color: #22c55e; background: #052e16; }
.quizResult.fail { color: #ef4444; background: #2e0505; }

.video-frame { width: 100%; border-radius: 6px; margin-bottom: 10px; }
.imagen-frame { max-width: 100%; border-radius: 6px; margin-bottom: 10px; }

.config-box { margin-top: auto; padding-top: 10px; border-top: 1px solid #334155; }
#configBtn { width: 100%; background: #6366f1; color: #fff; border: none; padding: 8px 12px; border-radius: 4px; cursor: pointer; font-weight: 600; }
#configBtn:hover { background: #4f46e5; }

.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); align-items: center; justify-content: center; z-index: 1000; }
.modal-content { background: #1e293b; border: 1px solid #334155; border-radius: 12px; padding: 24px; width: 90%; max-width: 480px; max-height: 90vh; overflow-y: auto; position: relative; }
.modal-sm { max-width: 400px; }
.modal-close { position: absolute; top: 12px; right: 16px; font-size: 1.5rem; cursor: pointer; color: #94a3b8; }
.modal-close:hover { color: #ef4444; }
.modal-content h2 { color: #38bdf8; margin-bottom: 16px; font-size: 1.1rem; }
.config-form label { display: block; color: #94a3b8; font-size: 0.85rem; margin-top: 12px; margin-bottom: 4px; }
.config-form input[type="text"], .config-form input[type="number"], .config-form input[type="password"] { width: 100%; background: #0f172a; border: 1px solid #334155; color: #e2e8f0; padding: 8px 10px; border-radius: 4px; }
.config-form input[type="range"] { width: 100%; margin-top: 4px; }
.config-actions { display: flex; gap: 10px; margin-top: 18px; }
.config-actions button { flex: 1; padding: 8px 12px; border: none; border-radius: 4px; cursor: pointer; font-weight: 600; }
#testBtn { background: #475569; color: #e2e8f0; }
#testBtn:hover { background: #64748b; }
#saveBtn { background: #22c55e; color: #0f172a; }
#saveBtn:hover { background: #16a34a; }
.config-actions button:disabled { opacity: 0.5; cursor: not-allowed; }
#configStatus { margin-top: 12px; font-size: 0.9rem; text-align: center; }
.config-meta { margin-top: 12px; font-size: 0.75rem; color: #64748b; text-align: center; border-top: 1px solid #334155; padding-top: 10px; }
