/* Perceptron Simulation - Localized CSS */
.perceptron-simulation {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-sizing: border-box;
}

.perceptron-simulation * {
    box-sizing: border-box;
}

.perceptron-simulation .simulation-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.perceptron-simulation .canvas-container {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 20px;
    min-height: 400px;
    position: relative;
    overflow: visible;
}

.perceptron-simulation .perceptron-diagram {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    height: 400px;
    padding: 20px 60px;
    background: #f8f9fa;
    border-radius: 8px;
}


.perceptron-simulation .layer-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 60px;
    z-index: 2;
}

.perceptron-simulation .layer-column.center-column {
    gap: 20px;
    align-items: center;
    justify-content: center;
    position: relative;
}

.perceptron-simulation .layer-column.output {
    justify-content: center;
    align-items: center;
    position: relative;
}

.perceptron-simulation .layer-column.output .output-node {
    margin-top: 0;
    position: relative;
}

.perceptron-simulation .transfer-func-preview {
    width: 80px;
    height: 60px;
    background: white;
    border: 1px solid #ddd;
    position: relative;
    margin-bottom: 10px;
    border-radius: 4px;
}

.perceptron-simulation .bias-container {
    margin-top: 40px;
    text-align: center;
}

.perceptron-simulation .node-label {
    font-size: 14px;
    font-weight: bold;
}

.perceptron-simulation .node-sub {
    font-size: 11px;
    color: #ece9e9;
}

.perceptron-simulation .formula {
    font-style: italic;
    font-family: serif;
    font-size: 18px;
}

.perceptron-simulation .input-layer {
    display: flex;
    gap: 20px;
    align-items: center;
}

.perceptron-simulation .input-node {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: transform 0.2s;
}

.perceptron-simulation .input-node:hover {
    transform: scale(1.1);
}

.perceptron-simulation .input-label {
    font-size: 12px;
    margin-bottom: 4px;
}

.perceptron-simulation .input-value {
    font-size: 18px;
}

.perceptron-simulation .weight-line {
    position: absolute;
    height: 2px;
    background: #6c757d;
    transform-origin: left center;
    z-index: 1;
    transition: background-color 0.3s;
}

.perceptron-simulation .weight-line.positive {
    background: #28a745;
}

.perceptron-simulation .weight-line.negative {
    background: #dc3545;
}

.perceptron-simulation .weight-label {
    position: absolute;
    font-size: 11px;
    font-weight: bold;
    color: #495057;
    background: white;
    padding: 2px 4px;
    border-radius: 3px;
    white-space: nowrap;
}

.perceptron-simulation .connection-layer {
    position: relative;
    width: 100%;
    height: 200px;
}

.perceptron-simulation .bias-node {
    width: 50px;
    height: 35px;
    border-radius: 17px;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #495057;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 3;
}

.perceptron-simulation .perceptron-node {
    width: 180px;
    height: 100px;
    border-radius: 50px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 2;
    margin: 0 auto;
}

.perceptron-simulation .perceptron-label {
    font-size: 12px;
    margin-bottom: 4px;
}

.perceptron-simulation .perceptron-sum {
    font-size: 14px;
    margin: 4px 0;
    opacity: 0.9;
}

.perceptron-simulation .perceptron-output {
    font-size: 20px;
    margin-top: 4px;
}

.perceptron-simulation .output-layer {
    display: flex;
    align-items: center;
    gap: 15px;
}

.perceptron-simulation .output-node {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.perceptron-simulation .output-node.active {
    transform: scale(1.15);
    box-shadow: 0 6px 16px rgba(79, 172, 254, 0.4);
}

.perceptron-simulation .output-label {
    font-size: 12px;
    margin-bottom: 4px;
}

.perceptron-simulation .output-value {
    font-size: 24px;
}

.perceptron-simulation .controls-panel {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.perceptron-simulation .control-group {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
}

.perceptron-simulation .control-group-row {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.perceptron-simulation .control-group-row .control-group {
    flex: 1;
    margin-bottom: 0;
    min-width: 200px;
}

.perceptron-simulation .control-label {
    min-width: 100px;
    font-weight: 500;
    color: #495057;
}

.perceptron-simulation .slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #dee2e6;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.perceptron-simulation .slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    transition: background 0.2s;
}

.perceptron-simulation .slider::-webkit-slider-thumb:hover {
    background: #764ba2;
}

.perceptron-simulation .slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.perceptron-simulation .slider::-moz-range-thumb:hover {
    background: #764ba2;
}

.perceptron-simulation .value-display {
    min-width: 60px;
    text-align: right;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #495057;
}

.perceptron-simulation .button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.perceptron-simulation .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.perceptron-simulation .btn-primary {
    background: #667eea;
    color: white;
}

.perceptron-simulation .btn-primary:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.perceptron-simulation .btn-secondary {
    background: #6c757d;
    color: white;
}

.perceptron-simulation .btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.perceptron-simulation .btn-info {
    background: #17a2b8;
    color: white;
}

.perceptron-simulation .btn-info:hover {
    background: #138496;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.perceptron-simulation .btn-preset {
    background: #17a2b8;
    color: white;
    font-size: 12px;
    padding: 8px 15px;
}

.perceptron-simulation .btn-preset:hover {
    background: #138496;
}

.perceptron-simulation .btn-preset.active {
    background: #28a745;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
    transform: translateY(-1px);
}

.perceptron-simulation .btn-preset.active:hover {
    background: #218838;
}

.perceptron-simulation .info-panel {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.perceptron-simulation .info-panel h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 10px;
}

.perceptron-simulation .info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.perceptron-simulation .info-row:last-child {
    border-bottom: none;
}

.perceptron-simulation .info-label {
    font-weight: 500;
    color: #6c757d;
}

.perceptron-simulation .info-value {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #495057;
}

.perceptron-simulation .activation-select {
    padding: 8px 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.perceptron-simulation .activation-select:hover {
    border-color: #667eea;
}

.perceptron-simulation .activation-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.perceptron-simulation .calculation-steps {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.8;
}

.perceptron-simulation .calculation-steps .step {
    margin: 5px 0;
    color: #495057;
}

.perceptron-simulation .calculation-steps .step.highlight {
    color: #667eea;
    font-weight: bold;
}

.perceptron-simulation .decision-boundary {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.perceptron-simulation .decision-boundary h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #495057;
}

.perceptron-simulation .boundary-canvas {
    width: 100%;
    height: 300px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: crosshair;
}

