/* Receiver Operating Characteristic module - based on Mean and SD styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 10px;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
    flex-wrap: wrap;
}

.page-header h1 {
    font-size: 1.5rem;
    color: #232D4B;
    flex: 1;
    min-width: 200px;
}

.back-link {
    color: #E57200;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 8px 12px;
    border: 1px solid #E57200;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.back-link:hover {
    background-color: #E57200;
    color: white;
}

.attribution, .date {
    font-size: 0.9rem;
    color: #888;
    margin-top: 5px;
}

.navigation { margin-top: 20px; }

.intro {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1rem;
    color: #555;
    padding: 0 10px;
}

.exercise-nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.exercise-link {
    display: block;
    padding: 20px;
    background-color: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
    min-height: 80px;
}

.exercise-link:hover {
    background-color: #E57200;
    color: white;
    border-color: #E57200;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.exercise-link h4 { font-size: 1.2rem; margin-bottom: 8px; color: inherit; }
.exercise-link p { font-size: 0.95rem; color: inherit; opacity: 0.9; }

.exercise-container { width: 100%; }

.controls {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

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

.control-group.control-group-centered {
    justify-content: center;
}

.control-group label {
    font-weight: 500;
    min-width: 150px;
    font-size: 0.95rem;
}

.control-group input[type="range"] {
    flex: 1;
    min-width: 200px;
    height: 8px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

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

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

.control-group span {
    font-weight: 600;
    color: #E57200;
    min-width: 50px;
    text-align: right;
    font-size: 1rem;
}

.info-box {
    background-color: #e3f2fd;
    border-left: 4px solid #2196F3;
    padding: 12px 15px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.info-box p { margin: 0; font-size: 0.95rem; }

.canvas-container {
    width: 100%;
    margin: 20px 0;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    overflow: hidden;
}

#confusion-matrix-canvas,
#fpr-fnr-canvas,
#roc-canvas {
    width: 100%;
    height: auto;
    display: block;
    max-width: 100%;
}

.stats-display {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    font-size: 0.95rem;
}

.stats-display p { margin: 5px 0; }
.stats-display strong { color: #232D4B; }

.metrics-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 0.95rem;
}

.metrics-table th,
.metrics-table td {
    border: 1px solid #ddd;
    padding: 10px 12px;
    text-align: center;
}

.metrics-table th {
    background-color: #232D4B;
    color: white;
    font-weight: 500;
}

.metrics-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.equation-block {
    margin: 8px 0;
    font-family: ui-monospace, monospace;
    font-size: 0.9rem;
}

.buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

.btn {
    padding: 12px 24px;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    min-height: 44px;
    min-width: 120px;
    flex: 1;
    max-width: 200px;
}

.btn-primary {
    background-color: #E57200;
    color: white;
}

.btn-primary:hover {
    background-color: #d16500;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

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

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

@media (min-width: 768px) {
    body { padding: 20px; }
    .container { max-width: 900px; padding: 30px; }
    .page-header h1 { font-size: 1.8rem; }
    .canvas-container { padding: 15px; }
    #confusion-matrix-canvas,
    #fpr-fnr-canvas,
    #roc-canvas { max-height: 600px; }
}

@media print {
    body { background-color: white; }
    .buttons, .controls { display: none; }
}
