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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #5a5a5a;
    background: linear-gradient(135deg, #ffafbd 0%, #ffc3a0 100%);
    min-height: 100vh;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

header h1 {
    font-size: 2.8rem;
    margin-bottom: 15px;
    font-weight: 700;
    background: white;
    
    background-clip: text;
}

header p {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 300;
}

.controls {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(255, 182, 193, 0.3);
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    align-items: end;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-weight: 600;
    color: #d63384;
    font-size: 0.95rem;
}

.control-group input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 10px;
    background: linear-gradient(90deg, #ffafbd, #ffc3a0);
    outline: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #d63384;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #d63384;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.control-group span {
    font-weight: bold;
    color: #d63384;
    font-size: 1.1rem;
    text-align: center;
    background: rgba(255, 182, 193, 0.2);
    padding: 5px 10px;
    border-radius: 10px;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#trainBtn {
    background: linear-gradient(45deg, #ec407a, #f06292);
    color: white;
}

#trainBtn:hover {
    background: linear-gradient(45deg, #d81b60, #ec407a);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(236, 64, 122, 0.4);
}

#resetBtn {
    background: linear-gradient(45deg, #ffafbd, #ffc3a0);
    color: #d63384;
}

#resetBtn:hover {
    background: linear-gradient(45deg, #ff9aae, #ffafbd);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 175, 189, 0.4);
}

.charts-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 40px;
}

.chart-wrapper {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(255, 182, 193, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

.chart-wrapper:hover {
    transform: translateY(-5px);
}

.chart-wrapper h3 {
    margin-bottom: 20px;
    color: #d63384;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 600;
}

.comparison-table {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(255, 182, 193, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 40px;
}

.comparison-table h3 {
    margin-bottom: 25px;
    color: #d63384;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
}

table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 15px;
    overflow: hidden;
}

th, td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 182, 193, 0.3);
}

th {
    background: linear-gradient(45deg, #ec407a, #f06292);
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

tr:nth-child(even) {
    background-color: rgba(255, 245, 247, 0.8);
}

tr:hover {
    background-color: rgba(255, 228, 235, 0.9);
    transform: scale(1.01);
    transition: all 0.2s ease;
}

.explanation {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(255, 182, 193, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.explanation h3 {
    margin-bottom: 25px;
    color: #d63384;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
}

.algorithms {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.algorithm {
    padding: 25px;
    border: 2px solid rgba(255, 182, 193, 0.3);
    border-radius: 15px;
    background: rgba(255, 245, 247, 0.8);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.algorithm::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(45deg, #ec407a, #f06292);
}

.algorithm:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(255, 182, 193, 0.4);
    border-color: rgba(236, 64, 122, 0.5);
}

.algorithm h4 {
    color: #d63384;
    margin-bottom: 15px;
    font-size: 1.3rem;
    font-weight: 600;
}

.algorithm p {
    margin-bottom: 15px;
    color: #666;
    line-height: 1.7;
}

.algorithm code {
    display: block;
    background: linear-gradient(135deg, #2d1b2e, #3d2b3f);
    color: #ffd6e0;
    padding: 15px;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    line-height: 1.5;
    border-left: 4px solid #ec407a;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #ec407a, #f06292);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #d81b60, #ec407a);
}

/* Animation for header */
header h1 {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 2px 2px 4px rgba(0,0,0,0.2),
                     0 0 20px rgba(255, 255, 255, 0.5);
    }
    to {
        text-shadow: 2px 2px 4px rgba(0,0,0,0.3),
                     0 0 30px rgba(255, 255, 255, 0.8),
                     0 0 40px rgba(255, 255, 255, 0.6);
    }
}

/* Loading animation */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}
@media (max-width: 768px) {
    .charts-container,
    .algorithms {
        grid-template-columns: 1fr;
    }
    
    .controls {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    header h1 {
        font-size: 2.2rem;
    }
    
    .chart-wrapper,
    .algorithm,
    .comparison-table,
    .explanation {
        padding: 20px;
    }
    
    th, td {
        padding: 12px 8px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .controls {
        padding: 20px 15px;
    }
}