/* Chapter 3 Specific Styles */

.algebra-container {
    width: 100%;
    max-width: 860px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 18px;
    padding: 14px 20px 16px;
    box-shadow:
        0 10px 28px rgba(67, 97, 238, 0.06),
        inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(67, 97, 238, 0.08);
    height: 100%;
    max-height: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.algebra-container .chapter-title {
    font-size: 1.25rem;
    margin-bottom: 2px;
}

.instruction-text {
    font-size: 0.82rem;
    color: #6c757d;
    margin-bottom: 10px;
    text-align: center;
    letter-spacing: 0.2px;
}

.svg-wrapper-3 {
    width: 100%;
    max-width: 700px;
    flex: 1;
    min-height: 0;
    background: linear-gradient(145deg, #ffffff 0%, #f8faff 100%);
    border-radius: 14px;
    box-shadow:
        inset 0 0 20px rgba(67, 97, 238, 0.03),
        0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 10px;
    overflow: hidden;
    border: 1px solid rgba(67, 97, 238, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.svg-wrapper-3 svg {
    width: 100%;
    height: 100%;
}

.controls-3 {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 0;
    flex-shrink: 0;
}

.btn-step {
    padding: 8px 16px;
    background: linear-gradient(135deg, #4361ee, #3f37c9);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow:
        3px 3px 8px rgba(67, 97, 238, 0.25),
        -2px -2px 6px rgba(255, 255, 255, 0.4);
}

.btn-step:hover {
    transform: translateY(-2px);
    box-shadow:
        4px 4px 12px rgba(67, 97, 238, 0.35),
        -3px -3px 8px rgba(255, 255, 255, 0.5);
}

.btn-step:disabled {
    background: linear-gradient(135deg, #bdc3c7, #a0a4a8);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

.btn-reset {
    padding: 8px 16px;
    background: rgba(239, 71, 111, 0.08);
    color: #ef476f;
    border: 1px solid rgba(239, 71, 111, 0.3);
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-reset:hover {
    background: #ef476f;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 71, 111, 0.3);
}

.equation-display {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2b2d42;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    padding: 10px 24px;
    border-radius: 12px;
    box-shadow:
        4px 4px 10px rgba(0, 0, 0, 0.05),
        -4px -4px 10px rgba(255, 255, 255, 0.8);
    opacity: 0; /* Hidden initially */
    transform: translateY(20px);
    margin-bottom: 10px;
    flex-shrink: 0;
}

.term-a2 { color: #4361ee; }
.term-b2 { color: #e74c3c; }
.term-2ab { color: #2ecc71; }

/* SVG Styles */
.shape-label {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 18px;
    fill: white;
    pointer-events: none;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.gap-indicator {
    fill: none;
    stroke: #e74c3c;
    stroke-width: 2;
    stroke-dasharray: 5, 5;
    opacity: 0;
}

.gap-text {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    fill: #e74c3c;
    font-weight: 600;
    opacity: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .algebra-container {
        padding: 10px 12px;
    }
    .controls-3 {
        gap: 6px;
    }
    .btn-step, .btn-reset {
        padding: 7px 12px;
        font-size: 0.72rem;
    }
    .equation-display {
        font-size: 1.1rem;
        padding: 8px 16px;
    }
}

/* ===== Gonit Ongon 2.0 de-slop (tokens from design-system.css) ===== */
.algebra-container {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}
.instruction-text { color: var(--color-ink-2); }
.svg-wrapper-3 {
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    box-shadow: none;
}
.btn-step {
    background: var(--color-accent);
    color: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--btn-inset);
    transition: transform var(--dur-fast) var(--ease-spring), background-color var(--dur) var(--ease-standard), box-shadow var(--dur) var(--ease-standard);
}
.btn-step:hover { background: var(--color-accent-hover); transform: translateY(-1px); box-shadow: var(--btn-inset), var(--shadow-accent-hover); }
.btn-step:active { transform: translateY(1px) scale(0.98); box-shadow: inset 0 2px 4px rgba(0,0,0,0.18); }
.btn-step:disabled { background: var(--color-surface-2); color: var(--color-muted); box-shadow: none; opacity: 1; }
.btn-reset {
    background: var(--color-danger-soft);
    color: var(--color-danger);
    border: 1px solid var(--color-danger);
    border-radius: var(--radius-md);
}
.btn-reset:hover { background: var(--color-danger); color: #fff; box-shadow: 0 4px 12px rgba(225,29,72,0.25); }
.equation-display {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    color: var(--color-ink);
}
/* term colours: keep distinct but on-brand (emerald / rose / amber) */
.term-a2 { color: var(--color-accent); }
.term-b2 { color: var(--color-danger); }
.term-2ab { color: var(--amber-600); }
.shape-label { font-family: var(--font-sans); }
.gap-indicator, .gap-text { stroke: var(--color-danger); fill: var(--color-danger); }
