/* Gradient Descent with Regularisation demo styles */

.demo-tabs {
    margin-top: 30px;
}

.demo-tab-header {
    display: flex;
    gap: 12px;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.demo-tab-btn {
    padding: 10px 22px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    transition: color 0.15s ease, border-bottom-color 0.15s ease, background 0.15s ease;
}

.demo-tab-btn:hover {
    color: #1d4ed8;
    background: rgba(29, 78, 216, 0.08);
}

.demo-tab-btn.active {
    color: #1d4ed8;
    border-bottom-color: #1d4ed8;
}

.demo-tab-content {
    display: none;
}

.demo-tab-content.active {
    display: block;
}

.demo-area {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

/* Plot Section (2/3) */
.plot-section {
    flex: 0 0 calc((100% - 20px) * 0.6667);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.plot-container {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    padding: 16px;
    display: flex;
    justify-content: center;
}

.plot-container canvas {
    max-width: 100%;
    width: 600px;
    height: 400px;
}

/* Controls Section (1/3) */
.controls {
    flex: 0 0 calc((100% - 20px) * 0.3333);
    background: #f5f7fa;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-sizing: border-box;
}

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

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

.train-btn {
    padding: 12px 24px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    width: 100%;
}

.train-btn:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 10px rgba(29, 78, 216, 0.35);
    transform: translateY(-1px);
}

.train-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(29, 78, 216, 0.25);
}

.stop-btn {
    padding: 12px 24px;
    background: #dc2626;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    width: 100%;
}

.stop-btn:hover {
    background: #b91c1c;
    box-shadow: 0 4px 10px rgba(185, 28, 28, 0.35);
    transform: translateY(-1px);
}

.stop-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(185, 28, 28, 0.25);
}

.metriclabel {
    position: relative;
    padding: 0 15px 15px 15px;
    border-radius: 0;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    word-break: break-all;
    overflow-wrap: break-word;
    line-height: 1.2;
    margin: 10px 0;
    min-height: 60px;
    box-sizing: border-box;
    padding-top: 10px;
    width: 100%;
    /* background, color, border, border-left are set by MetricLabel */
}

@media (max-width: 768px) {
    .demo-area {
        flex-direction: column;
    }

    .plot-section,
    .controls {
        flex: 1 1 100%;
        width: 100%;
    }

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