/**
 * SVM Video Recommendation Lab - Dark engineering aesthetic
 * Sci-Fi vs Romance: Action vs Dialogue classification with 2D/3D visualization
 */

/* Keep main menu (menu_Websim.html) unchanged – match Websim_SVM.html line spacing */
#menu_Websim table {
  border-collapse: collapse;
  border-spacing: 0;
}
#menu_Websim td {
  padding: 0.75pt;
  line-height: normal;
  vertical-align: top;
}
#menu_Websim p {
  margin: 0;
  padding: 0;
  line-height: normal;
  font-size: 10pt;
}
#menu_Websim span {
  line-height: normal;
}
#menu_Websim a {
  text-decoration: none;
  color: black;
}

#svm-video-root {
  max-width: 1200px;
  margin: 0 auto;
  background: #0a0a0c;
  color: #e0e0e0;
  font-family: "Segoe UI", "Courier New", sans-serif;
  font-size: 12px;
  padding: 16px;
  box-sizing: border-box;
  border: 1px solid #222;
  border-radius: 8px;
}

#svm-video-root * {
  box-sizing: border-box;
}

#svm-video-root .svm-video-title {
  color: #4facfe;
  font-size: 1.2em;
  margin: 0 0 8px 0;
}

#svm-video-root .svm-video-subtitle {
  color: #aaa;
  font-size: 0.9em;
  margin: 0 0 16px 0;
}

#svm-video-root .svm-video-coldstart-note {
  margin-bottom: 14px;
  padding: 10px 14px;
  background: rgba(30, 40, 60, 0.5);
  border-left: 4px solid #4facfe;
  border-radius: 4px;
  font-size: 0.85em;
  color: #b0b8c8;
}

#svm-video-root .svm-video-coldstart-note strong {
  color: #e0e0e0;
}

#svm-video-root .svm-video-controls {
  background: rgba(25, 25, 30, 0.9);
  padding: 14px;
  border-radius: 8px;
  border: 1px solid #333;
  margin-bottom: 14px;
}

#svm-video-root .svm-video-control-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

#svm-video-root .svm-video-control-row:last-child {
  margin-bottom: 0;
}

#svm-video-root .svm-video-control-row label {
  color: #ccc;
  font-size: 0.85em;
  min-width: 100px;
}

#svm-video-root .svm-video-control-row input[type="range"] {
  flex: 1;
  min-width: 80px;
  max-width: 180px;
  accent-color: #4facfe;
}

#svm-video-root .svm-video-control-row select {
  padding: 6px 10px;
  background: #222;
  border: 1px solid #444;
  color: #e0e0e0;
  border-radius: 4px;
  min-width: 180px;
}

#svm-video-root .svm-video-btn {
  padding: 8px 16px;
  background: #4facfe;
  border: none;
  color: #0a0a0c;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}

#svm-video-root .svm-video-btn:hover {
  background: #6bbdff;
}

#svm-video-root .svm-video-split {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 14px;
}

#svm-video-root .svm-video-pane {
  flex: 1;
  min-width: 280px;
  background: #111;
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
}

#svm-video-root .svm-video-pane-label {
  padding: 8px 12px;
  background: #1a1a1e;
  color: #4facfe;
  font-size: 0.9em;
  font-weight: 600;
}

#svm-video-root .svm-video-2d-wrap {
  position: relative;
  width: 100%;
  height: 320px;
  background: #0d0d0f;
}

#svm-video-root .svm-video-tooltip {
  position: fixed;
  z-index: 100;
  background: rgba(20, 20, 28, 0.95);
  border: 1px solid #444;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 0.85em;
  color: #e0e0e0;
  pointer-events: none;
  max-width: 220px;
}

#svm-video-root .svm-video-point-list-label {
  font-size: 0.8em;
  color: #888;
  margin-top: 6px;
  margin-bottom: 4px;
}

#svm-video-root .svm-video-point-list {
  font-size: 0.8em;
  color: #aaa;
  line-height: 1.5;
  min-height: 1.5em;
}

#svm-video-root .svm-video-pt {
  white-space: nowrap;
}

#svm-video-root .svm-video-pt-like {
  color: #00f2fe;
}

#svm-video-root .svm-video-pt-dislike {
  color: #f093fb;
}

#svm-video-root #svm-video-2d {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

#svm-video-root .svm-video-3d-wrap {
  width: 100%;
  height: 320px;
  background: #0d0d0f;
  position: relative;
}

#svm-video-root .svm-video-3d-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#svm-video-root .svm-video-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 10px 0;
  font-size: 0.85em;
  color: #aaa;
}

#svm-video-root .svm-video-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

#svm-video-root .svm-video-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

#svm-video-root .svm-video-legend-dot.like {
  background: #00f2fe;
}

#svm-video-root .svm-video-legend-dot.dislike {
  background: #f093fb;
}

#svm-video-root .svm-video-legend-dot.sv {
  background: transparent;
  border: 2px solid #ffd700;
  box-shadow: 0 0 8px #ffd700;
}

#svm-video-root .svm-video-math {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  font-family: "Courier New", monospace;
  font-size: 0.85em;
  color: #8af;
}

#svm-video-root .svm-video-math kbd {
  color: #4facfe;
}

#svm-video-root .svm-video-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  font-size: 0.85em;
  color: #888;
}

#svm-video-root .svm-video-stats span {
  color: #ccc;
}

/* Recommendation feed (right pane) */
#svm-video-root .svm-video-feed-pane {
  min-width: 200px;
  max-width: 280px;
}

#svm-video-root .svm-video-feed-list {
  padding: 10px 12px;
  min-height: 120px;
  font-size: 0.9em;
}

#svm-video-root .svm-feed-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  margin-bottom: 4px;
  border-radius: 4px;
  background: rgba(20, 20, 28, 0.8);
}

#svm-video-root .svm-feed-item.svm-feed-like {
  border-left: 3px solid #00f2fe;
}

#svm-video-root .svm-feed-item.svm-feed-dislike {
  border-left: 3px solid #f093fb;
}

#svm-video-root .svm-feed-rank {
  flex-shrink: 0;
  width: 20px;
  font-weight: 700;
  color: #888;
}

#svm-video-root .svm-feed-title {
  flex: 1;
  color: #e0e0e0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#svm-video-root .svm-feed-score {
  flex-shrink: 0;
  font-family: "Courier New", monospace;
  font-size: 0.85em;
}

#svm-video-root .svm-feed-item.svm-feed-like .svm-feed-score {
  color: #00f2fe;
}

#svm-video-root .svm-feed-item.svm-feed-dislike .svm-feed-score {
  color: #f093fb;
}

#svm-video-root .svm-feed-empty {
  color: #666;
  font-style: italic;
}

#svm-video-root .svm-feed-hint {
  margin: 8px 12px 0;
  font-size: 0.75em;
  color: #666;
}

/* ========== Styles for Theory tab (from SVM/svm.css – no dependency on svm.css) ========== */
.svm-container {
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 20px;
  margin: 10px 0;
  font-family: "Courier New", monospace;
  color: #e0e0e0;
}

.control-panel {
  background-color: #222;
  border: 1px solid #444;
  border-radius: 5px;
  padding: 15px;
  margin-bottom: 15px;
}

.section-label {
  color: #00ffff;
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.control-row label {
  color: #aaa;
  font-size: 12px;
}

.control-row button {
  background-color: #333;
  color: #00ffff;
  border: 1px solid #00ffff;
  padding: 8px 16px;
  cursor: pointer;
  font-family: "Courier New", monospace;
  font-size: 12px;
  border-radius: 3px;
  transition: all 0.2s;
}

.control-row button:hover {
  background-color: #00ffff;
  color: #000;
}

.control-row button.active {
  background-color: #00ff00;
  color: #000;
  border-color: #00ff00;
}

.control-row button.stop {
  background-color: #ff3333;
  color: #fff;
  border-color: #ff3333;
}

.control-row input[type="range"] {
  width: 120px;
  cursor: pointer;
}

.control-row input[type="checkbox"] {
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.dark-select {
  background-color: #333;
  color: #00ffff;
  border: 1px solid #555;
  padding: 6px 10px;
  font-family: "Courier New", monospace;
  font-size: 12px;
  border-radius: 3px;
  cursor: pointer;
}

.dark-select:hover {
  border-color: #00ffff;
}

.stats-display {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 10px;
  padding: 10px;
  background-color: #1a1a1a;
  border-radius: 3px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.stat-label {
  color: #888;
  font-size: 11px;
}

.stat-value {
  color: #ffcc00;
  font-size: 12px;
  font-weight: bold;
}

.canvas-container {
  background-color: #000;
  border: 1px solid #333;
  border-radius: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  margin-bottom: 10px;
}

#svm-canvas {
  cursor: crosshair;
  border-radius: 3px;
}

.instructions {
  background-color: #222;
  border: 1px solid #333;
  border-radius: 3px;
  padding: 10px 15px;
  margin-top: 10px;
  font-size: 12px;
  color: #888;
  text-align: center;
}

.instructions span {
  color: #00ffff;
  font-weight: bold;
}

.legend-box {
  display: flex;
  gap: 20px;
  padding: 10px;
  background-color: #1a1a1a;
  border-radius: 3px;
  margin-top: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #aaa;
}

.legend-color {
  width: 20px;
  height: 3px;
}

.legend-color.boundary {
  background-color: #00ff00;
}

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

.legend-dot.support {
  border: 3px solid #ffff00;
  background-color: transparent;
}

.slider-value {
  color: #ffcc00;
  font-size: 11px;
  min-width: 50px;
}

.step-btn {
  background-color: #2a2a2a !important;
  color: #ffcc00 !important;
  border: 1px solid #ffcc00 !important;
}

.step-btn:hover {
  background-color: #ffcc00 !important;
  color: #000 !important;
}

.step-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed !important;
}

.step-details-panel {
  background-color: #111;
  border: 2px solid #333;
  border-radius: 5px;
  margin-top: 15px;
  font-family: "Courier New", monospace;
  overflow: hidden;
}

.step-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #222;
  padding: 10px 15px;
  border-bottom: 1px solid #333;
}

.step-details-title {
  color: #00ffff;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 1px;
}

.step-counter {
  color: #ffcc00;
  font-size: 14px;
  font-weight: bold;
}

.step-details-content {
  padding: 15px;
  min-height: 180px;
  font-size: 12px;
  line-height: 1.6;
}

.step-placeholder {
  color: #666;
  font-style: italic;
  text-align: center;
  padding: 50px 20px;
}

.step-placeholder .highlight {
  color: #00ffff;
  font-style: normal;
  font-weight: bold;
}

.step-detail-row {
  display: flex;
  margin-bottom: 8px;
  align-items: flex-start;
}

.step-detail-label {
  color: #888;
  min-width: 160px;
  flex-shrink: 0;
}

.step-detail-value {
  color: #e0e0e0;
}

.step-detail-value.highlight-green,
.highlight-green {
  color: #00ff00;
  font-weight: bold;
}

.step-detail-value.highlight-yellow {
  color: #ffcc00;
  font-weight: bold;
}

.step-detail-value.highlight-red {
  color: #ff4444;
  font-weight: bold;
}

.step-detail-value.highlight-blue {
  color: #4488ff;
  font-weight: bold;
}

.step-section {
  margin: 12px 0;
  padding: 10px;
  background-color: #1a1a1a;
  border-radius: 4px;
  border-left: 3px solid #333;
}

.step-section.prediction {
  border-left-color: #00ffff;
}

.step-section.margin {
  border-left-color: #ffcc00;
}

.step-section.update {
  border-left-color: #00ff00;
}

.step-section.loss {
  border-left-color: #ff6666;
}

.step-section.boundary {
  border-left-color: #00ff00;
}

.step-section.margins {
  border-left-color: #888888;
}

.margin-block {
  margin: 10px 0;
  padding: 8px;
  background-color: #111;
  border-radius: 4px;
}

.margin-block.upper {
  border-left: 3px solid #4488ff;
}

.margin-block.lower {
  border-left: 3px solid #ff4444;
}

.margin-label {
  color: #aaa;
  font-size: 11px;
  margin-bottom: 5px;
}

.margin-width-calc {
  margin-top: 15px;
  padding: 10px;
  background-color: #111;
  border-radius: 4px;
  border-left: 3px solid #ffcc00;
}

.step-section-title {
  color: #aaa;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.formula {
  font-family: "Courier New", monospace;
  background-color: #0a0a0a;
  padding: 8px 12px;
  border-radius: 3px;
  margin: 5px 0;
  color: #e0e0e0;
  display: inline-block;
}

.formula .num {
  color: #ffcc00;
}

.formula .op {
  color: #888;
}

.formula .result {
  color: #00ff00;
}

.point-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background-color: #1a1a1a;
  border-radius: 3px;
  margin-bottom: 10px;
}

.point-indicator .point-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.point-indicator .point-dot.red {
  background-color: #ff4444;
  border: 2px solid #ff8888;
}

.point-indicator .point-dot.blue {
  background-color: #4488ff;
  border: 2px solid #88bbff;
}

.delta {
  font-size: 10px;
  margin-left: 8px;
}

.delta.positive {
  color: #00ff00;
}

.delta.negative {
  color: #ff6666;
}

.condition-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
}

.condition-badge.inside-margin {
  background-color: rgba(255, 204, 0, 0.2);
  color: #ffcc00;
  border: 1px solid #ffcc00;
}

.condition-badge.outside-margin {
  background-color: rgba(0, 255, 0, 0.2);
  color: #00ff00;
  border: 1px solid #00ff00;
}

.condition-badge.misclassified {
  background-color: rgba(255, 68, 68, 0.2);
  color: #ff4444;
  border: 1px solid #ff4444;
}

.weight-update-block {
  margin: 12px 0;
  padding: 10px;
  background-color: #0a0a0a;
  border-radius: 4px;
  border: 1px solid #222;
}

.weight-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #333;
}

.weight-name {
  color: #00ffff;
  font-weight: bold;
  font-size: 13px;
}

.weight-result {
  color: #e0e0e0;
  font-size: 12px;
}

.calc-steps {
  padding-left: 10px;
  border-left: 2px solid #333;
  margin-top: 5px;
}

.calc-formula {
  color: #aaa;
  font-size: 11px;
  margin-bottom: 6px;
  font-style: italic;
}

.calc-line {
  color: #888;
  font-size: 11px;
  margin: 3px 0;
  padding-left: 10px;
}

.calc-line .num {
  color: #ffcc00;
}

.calc-line .result {
  color: #00ff00;
  font-weight: bold;
}

.calc-note {
  color: #666;
  font-size: 10px;
  font-style: italic;
}

input[type="range"] {
  -webkit-appearance: none;
  background: #333;
  height: 6px;
  border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #00ffff;
  border-radius: 50%;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #00ffff;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.svm-tabs-wrapper {
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
  margin: 16px 0 20px 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  position: relative;
}

.svm-tabs-wrapper .svm-tabs-header {
  border-radius: 8px 8px 0 0;
}

.svm-tabs-header {
  display: flex;
  gap: 0;
  padding: 0 12px 0 12px;
  background: #222;
  border-bottom: 2px solid #444;
}

.svm-tab-btn {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: "Segoe UI", "Courier New", sans-serif;
  color: #888;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  cursor: pointer;
  margin-bottom: -2px;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.svm-tab-btn:hover {
  color: #ccc;
  background: rgba(255, 255, 255, 0.05);
}

.svm-tab-btn.active {
  color: #00ffff;
  background: #1a1a1a;
  border-bottom-color: #1a1a1a;
}

.svm-tab-panels {
  padding: 0 0 20px 0;
}

.svm-tab-panel {
  display: none;
  padding: 0 0 20px 0;
}

.svm-tab-panel.active {
  display: block;
}

#content_extra {
  margin-top: 24px;
  margin-bottom: 20px;
}
