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

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

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

h1 {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.floating-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 1000;
    width: 320px;
}

.controls-title {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
    cursor: grab;
}

.controls-title:active {
    cursor: grabbing;
}

.matrix-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.control-group {
    text-align: center;
}

.control-label {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 14px;
    color: #555;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lock-toggle {
    cursor: pointer;
    margin-left: 8px;
    font-size: 16px;
    transition: color 0.2s;
}

.lock-toggle.locked {
    color: #d32f2f;
}

.slider-container {
    position: relative;
}

.slider {
    width: 100%;
    height: 30px;
    border-radius: 15px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: opacity 0.2s;
}

.slider:disabled {
    opacity: 0.5;
}

.slider:disabled::-webkit-slider-thumb {
    background: #9E9E9E;
    cursor: not-allowed;
}

.slider:disabled::-moz-range-thumb {
    background: #9E9E9E;
    cursor: not-allowed;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4CAF50;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4CAF50;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.slider-value {
    font-weight: bold;
    color: #333;
    margin-top: 5px;
    font-size: 16px;
}

.charts-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.chart-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.chart-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
    color: #333;
}

.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 20px;
}

.confusion-matrix-layout {
    position: relative;
    width: 250px;
    height: 250px;
    margin: 0 auto; /* Center the block horizontally */
    top: 50%;       /* Center the block vertically */
    transform: translateY(-50%);
}

.matrix-ylabel,
.matrix-xlabel {
    position: absolute;
    font-weight: bold;
    color: #555;
    font-style: italic;
    white-space: nowrap;
}

.matrix-ylabel {
    top: 50%;
    left: -20px; /* Position label just outside the container */
    transform: translateY(-50%) rotate(-90deg);
}

.matrix-xlabel {
    bottom: -25px; /* Position label just outside the container */
    left: 50%;
    transform: translateX(-50%);
}

.matrix-canvas-container {
    width: 100%;
    height: 100%;
}

#matrixChart {
    max-width: 100%;
    max-height: 100%;
}

footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
}

footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

footer a:hover {
    color: white;
}

@media (max-width: 1200px) {
    .charts-container {
        grid-template-columns: 1fr;
    }

    .floating-controls {
        position: static;
        width: 100%;
        margin-bottom: 20px;
    }
}
