/* Stochastic Gradient Descent Visualizer Stylesheet */
/* Dark theme consistent with other tutorials */

.sgd-container {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 20px;
    margin: 10px 0;
    font-family: 'Courier New', monospace;
    color: #e0e0e0;
    max-width: 800px;
}

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

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

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

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

.sgd-control-row button {
    background-color: #333;
    color: #ff9900;
    border: 1px solid #ff9900;
    padding: 8px 16px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.sgd-control-row button:hover {
    background-color: #ff9900;
    color: #000;
}

.sgd-control-row button.running {
    background-color: #ff4444;
    border-color: #ff4444;
    color: #fff;
}

.sgd-control-row button.running:hover {
    background-color: #cc3333;
}

.sgd-control-row button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sgd-control-row input[type="range"] {
    width: 120px;
    accent-color: #ff9900;
}

.sgd-slider-value {
    color: #00ff88;
    font-size: 12px;
    min-width: 50px;
    text-align: right;
}

/* Canvas Container */
.sgd-canvas-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.sgd-canvas-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sgd-canvas-title {
    color: #ff9900;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sgd-canvas {
    border: 2px solid #444;
    border-radius: 4px;
    background-color: #0a0a0a;
}

/* Stats Display */
.sgd-stats-display {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 10px 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

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

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

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

.sgd-stat-value.highlight {
    color: #ffcc00;
}

/* Step Details Panel */
.sgd-step-details-panel {
    background-color: #1a1a1a;
    border: 1px solid #444;
    border-radius: 5px;
    margin-top: 15px;
    overflow: hidden;
}

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

.sgd-step-details-title {
    color: #ff9900;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sgd-step-counter {
    color: #00ff88;
    font-size: 12px;
}

.sgd-step-details-content {
    padding: 15px;
    max-height: 350px;
    overflow-y: auto;
    font-size: 11px;
    line-height: 1.6;
}

.sgd-step-placeholder {
    color: #666;
    text-align: center;
    padding: 20px;
}

.sgd-step-placeholder .highlight {
    color: #ff9900;
    font-weight: bold;
}

/* Step Sections */
.sgd-step-section {
    background-color: #222;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 12px;
    border-left: 3px solid #666;
}

.sgd-step-section.batch {
    border-left-color: #ff9900;
}

.sgd-step-section.gradient {
    border-left-color: #ff4444;
}

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

.sgd-step-section.comparison {
    border-left-color: #4488ff;
}

.sgd-step-section-title {
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 8px;
}

.sgd-formula {
    color: #ccc;
    margin: 6px 0;
    padding-left: 10px;
}

.sgd-formula .num {
    color: #ffcc00;
}

.sgd-formula .result {
    color: #00ff88;
    font-weight: bold;
}

.sgd-formula .batch-point {
    color: #ff9900;
}

.sgd-calc-steps {
    background-color: #1a1a1a;
    border-radius: 3px;
    padding: 8px 10px;
    margin-top: 8px;
}

.sgd-calc-line {
    color: #aaa;
    font-size: 10px;
    margin: 4px 0;
}

/* Weight Update Block */
.sgd-weight-update-block {
    background-color: #1a1a1a;
    border-radius: 3px;
    padding: 10px;
    margin: 8px 0;
}

.sgd-weight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.sgd-weight-name {
    color: #ff9900;
    font-weight: bold;
}

.sgd-weight-result {
    color: #ccc;
}

.sgd-highlight-green {
    color: #00ff88;
    font-weight: bold;
}

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

.sgd-delta.positive {
    color: #00ff88;
}

.sgd-delta.negative {
    color: #ff6666;
}

/* Legend */
.sgd-legend-box {
    background-color: #222;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 12px 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 15px;
}

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

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

.sgd-legend-line {
    width: 25px;
    height: 3px;
    border-radius: 1px;
}

.sgd-legend-color {
    width: 20px;
    height: 12px;
    border-radius: 2px;
}

/* Instructions */
.sgd-instructions {
    color: #888;
    font-size: 11px;
    text-align: center;
    padding: 10px;
    border-top: 1px solid #333;
    margin-top: 15px;
}

.sgd-instructions span {
    color: #ff9900;
    font-weight: bold;
}

/* Batch Info Display */
.sgd-batch-info {
    background-color: #2a2a1a;
    border: 1px solid #ff9900;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 11px;
}

.sgd-batch-info-title {
    color: #ff9900;
    font-weight: bold;
    margin-bottom: 5px;
}

.sgd-batch-points {
    color: #ffcc00;
    font-family: 'Courier New', monospace;
}

/* Scrollbar styling */
.sgd-step-details-content::-webkit-scrollbar {
    width: 8px;
}

.sgd-step-details-content::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.sgd-step-details-content::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.sgd-step-details-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive */
@media (max-width: 850px) {
    .sgd-canvas-row {
        flex-direction: column;
        align-items: center;
    }
    
    .sgd-control-row {
        flex-direction: column;
        align-items: flex-start;
    }
}
