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

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    margin: 0;
    font-size: 2.5em;
    font-weight: 300;
}

.comparison-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.code-panel {
    padding: 25px;
    border-right: 2px solid #ecf0f1;
}

.code-panel:last-child {
    border-right: none;
}

.code-panel h2 {
    color: #2c3e50;
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 3px solid #3498db;
}

.code-block {
    background: #2d3748;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    overflow-x: auto;
    margin: 15px 0;
}

.optimization-analysis {
    background: #f8f9fa;
    padding: 30px;
    border-top: 2px solid #ecf0f1;
}

.pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 20px 0;
}

.pros, .cons {
    padding: 20px;
    border-radius: 8px;
}

.pros {
    background: #d4edda;
    border-left: 4px solid #28a745;
}

.cons {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
}

.execution-section {
    padding: 30px;
    background: #f1f3f4;
}

.controls {
    text-align: center;
    margin: 20px 0;
}

button {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 25px;
    margin: 5px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

button:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.output-panel {
    background: #2d3748;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    height: 300px;
    overflow-y: auto;
    margin: 20px 0;
}

.step-highlight {
    background: #3498db;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.visual-hanoi {
    display: flex;
    justify-content: space-around;
    align-items: end;
    height: 200px;
    background: #34495e;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.tower {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 120px;
}

.tower-name {
    color: white;
    font-weight: bold;
    margin-bottom: 10px;
}

.rod {
    width: 6px;
    height: 150px;
    background: #95a5a6;
    position: relative;
}

.base {
    width: 100px;
    height: 8px;
    background: #95a5a6;
    margin-top: 2px;
}

.disk {
    height: 20px;
    border-radius: 10px;
    position: absolute;
    bottom: 8px;
    transition: all 0.5s ease;
}

.disk-1 { 
    width: 40px; 
    background: #e74c3c; 
}

.disk-2 { 
    width: 60px; 
    background: #f39c12; 
}

.disk-3 { 
    width: 80px; 
    background: #2ecc71; 
}

.disk-4 { 
    width: 100px; 
    background: #9b59b6; 
}

.disk-5 { 
    width: 120px; 
    background: #3498db; 
}

.disk-6 { 
    width: 140px; 
    background: #e67e22; 
}

.disk-7 { 
    width: 160px; 
    background: #1abc9c; 
}

.disk-8 { 
    width: 180px; 
    background: #34495e; 
}

.winner {
    background: #2ecc71;
    color: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    margin: 20px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .comparison-section {
        grid-template-columns: 1fr;
    }
    
    .code-panel {
        border-right: none;
        border-bottom: 2px solid #ecf0f1;
    }
    
    .pros-cons {
        grid-template-columns: 1fr;
    }
    
    .visual-hanoi {
        height: 150px;
        padding: 10px;
    }
    
    .tower {
        width: 80px;
    }
    
    .rod {
        height: 100px;
    }
    
    .base {
        width: 70px;
    }
}