/* =========================================================
   Boolean Operators Lab - Chapter 4.02
   ========================================================= */

.logic-expression-line {
    display: inline-block;
    margin: 0.7rem 0 1rem;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

.boolean-operator-widget,
.logic-builder-widget {
    margin: 1.5rem 0;
    padding: 1.25rem;
    border-radius: 24px;
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    border: 1px solid #dbeafe;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.boolean-widget-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.boolean-control-group {
    display: grid;
    gap: 0.45rem;
    padding: 1rem;
    border-radius: 18px;
    background: white;
    border: 1px solid #e2e8f0;
}

.boolean-control-group span,
.boolean-control-group label {
    font-weight: 800;
    color: #334155;
}

.bool-toggle,
.boolean-control-group select,
.builder-buttons button {
    appearance: none;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: white;
    color: #0f172a;
    padding: 0.65rem 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bool-toggle.active,
.builder-buttons button.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.boolean-result-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0;
}

.expression-card {
    padding: 1.1rem;
    border-radius: 20px;
    background: white;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.expression-card span {
    display: block;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
    color: #64748b;
    margin-bottom: 0.35rem;
}

.expression-card strong {
    font-size: 1.35rem;
    color: #0f172a;
}

.result-card.true strong { color: #15803d; }
.result-card.false strong { color: #b91c1c; }

.truth-table-wrap {
    overflow-x: auto;
    margin-top: 1rem;
}

.truth-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 18px;
    background: white;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.truth-table th,
.truth-table td {
    padding: 0.8rem 1rem;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.truth-table th {
    background: #e0e7ff;
    color: #1e1b4b;
    font-weight: 900;
}

.truth-table td {
    font-weight: 800;
    color: #334155;
}

.truth-table tr.highlight td {
    background: #fef3c7;
}

.boolean-explanation {
    margin: 1rem 0 0;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
    font-weight: 700;
}

.builder-scenario-card {
    padding: 1.1rem 1.25rem;
    border-radius: 20px;
    background: white;
    border: 1px solid #e2e8f0;
    margin-bottom: 1rem;
}

.builder-scenario-card h3 { margin-top: 0; }

.builder-step-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.builder-panel {
    padding: 1rem;
    border-radius: 20px;
    background: white;
    border: 1px solid #e2e8f0;
    min-height: 190px;
}

.builder-panel h3 { margin-top: 0; }

.condition-pill,
.symbol-pill {
    display: block;
    margin: 0.45rem 0;
    padding: 0.6rem 0.75rem;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #334155;
    font-weight: 700;
}

.symbol-pill strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    margin-right: 0.4rem;
    border-radius: 999px;
    background: #0f172a;
    color: white;
}

.built-expression {
    padding: 0.9rem;
    border-radius: 16px;
    background: #0f172a;
    color: white;
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1.4;
}

.builder-output {
    color: #475569;
    font-weight: 700;
}

.builder-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

@media (max-width: 820px) {
    .boolean-result-panel,
    .builder-step-grid {
        grid-template-columns: 1fr;
    }
}
