/* SVM Visualization Stylesheet */
/* Dark theme consistent with other tutorials */

.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;
}

.class-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
}

.class-a {
    background-color: #ff4444;
    border: 2px solid #ff8888;
}

.class-b {
    background-color: #4444ff;
    border: 2px solid #8888ff;
}

.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-color.margin {
    background-color: #888;
    border-style: dashed;
    border-width: 1px 0;
    height: 0;
}

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

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

/* Slider styling */
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;
}

/* Value display next to sliders */
.slider-value {
    color: #ffcc00;
    font-size: 11px;
    min-width: 50px;
}

/* Step buttons styling */
.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 */
.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 rows */
.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 {
    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;
}

/* Section dividers in step details */
.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 blocks styling */
.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 display */
.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 in step details */
.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 display (change indicators) */
.delta {
    font-size: 10px;
    margin-left: 8px;
}

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

.delta.negative {
    color: #ff6666;
}

/* Condition badge */
.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 styling */
.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;
}

.highlight-green {
    color: #00ff00 !important;
    font-weight: bold;
}

/* Calculation steps display */
.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;
}
