* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.controls {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    font-weight: 600;
    color: #555;
}

.control-group input[type="range"] {
    width: 150px;
}

.control-group span {
    font-weight: 600;
    color: #667eea;
    min-width: 30px;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 14px;
}

#generateData {
    background: #28a745;
    color: white;
}

#generateData:hover {
    background: #218838;
    transform: translateY(-2px);
}

#playBtn {
    background: #007bff;
    color: white;
}

#playBtn:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

#stepBtn {
    background: #ffc107;
    color: #212529;
}

#stepBtn:hover {
    background: #e0a800;
    transform: translateY(-2px);
}

#resetBtn {
    background: #dc3545;
    color: white;
}

#resetBtn:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.visualization-section, .algorithm-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.visualization-section h2, .algorithm-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

#perceptronCanvas {
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #f8f9fa;
    display: block;
    margin: 0 auto;
}

.canvas-info {
    margin-top: 15px;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

.canvas-info p {
    margin: 5px 0;
}

.algorithm-steps {
    margin-bottom: 25px;
}

.step {
    padding: 10px;
    margin: 8px 0;
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    border-radius: 0 5px 5px 0;
    font-size: 0.95rem;
}

.current-state {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
    padding: 15px;
    background: #e3f2fd;
    border-radius: 8px;
}

.state-item {
    font-size: 1.1rem;
}

.state-item strong {
    color: #1976d2;
}

.state-item span {
    font-weight: 600;
    color: #333;
    margin-left: 5px;
}

.weight-display {
    margin-bottom: 25px;
    padding: 20px;
    background: #f3e5f5;
    border-radius: 8px;
}

.weight-display h3 {
    color: #7b1fa2;
    margin-bottom: 15px;
}

.weight-formula {
    font-size: 1.2rem;
    margin-bottom: 15px;
    text-align: center;
    padding: 10px;
    background: white;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.weight-explanation {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.weight-explanation p {
    text-align: center;
    padding: 8px;
    background: white;
    border-radius: 5px;
    font-size: 0.9rem;
    border: 1px solid #ddd;
}

.decision-boundary {
    padding: 20px;
    background: #e8f5e8;
    border-radius: 8px;
}

.decision-boundary h3 {
    color: #2e7d32;
    margin-bottom: 15px;
}

.equation, .slope-intercept {
    text-align: center;
    margin: 10px 0;
    padding: 10px;
    background: white;
    border-radius: 5px;
    border: 1px solid #ddd;
    font-size: 1.1rem;
}

.learning-process {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.learning-process h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.process-log {
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
}

.process-log p {
    margin: 5px 0;
    padding: 3px 0;
}

.process-log .iteration {
    color: #007bff;
    font-weight: 600;
}

.process-log .misclassified {
    color: #dc3545;
    font-weight: 600;
}

.process-log .weight-update {
    color: #28a745;
    font-weight: 600;
}

.process-log .converged {
    color: #6f42c1;
    font-weight: 600;
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    #perceptronCanvas {
        width: 100%;
        height: auto;
    }
    
    .weight-explanation {
        grid-template-columns: 1fr;
    }
    
    .current-state {
        flex-direction: column;
        gap: 15px;
    }
} 