/* GIAO DIỆN SOFT BRUTALISM - STEP BY STEP MATH */
.tool-container {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    max-width: 1000px; margin: 20px auto;
    border: 3px solid #111111; border-radius: 12px;
    box-shadow: 6px 6px 0px #111111; padding: 30px;
    background: #ffffff; color: #111111; box-sizing: border-box;
}

h2.tool-title {
    font-family: 'Montserrat', sans-serif; font-size: 2rem; text-align: center;
    text-transform: uppercase; margin-top: 0; margin-bottom: 5px; font-weight: 900;
}
.tool-desc { text-align: center; color: #555; margin-bottom: 30px; font-weight: 600; }

.main-layout { display: grid; grid-template-columns: 1fr 1.2fr; gap: 30px; }

/* --- CỘT NHẬP LIỆU --- */
.input-panel {
    background-color: #f4f4f4; border: 3px solid #111111; border-radius: 8px;
    padding: 25px; box-shadow: 4px 4px 0px #111111;
}

.input-group { margin-bottom: 20px; }
.input-group label { display: block; font-weight: 800; margin-bottom: 8px; font-size: 1.05rem; }
.input-group input {
    width: 100%; padding: 12px 15px; font-size: 1.2rem; font-weight: 800; font-family: 'Montserrat', sans-serif;
    border: 3px solid #111111; border-radius: 8px; outline: none; background-color: #fff;
    box-shadow: 2px 2px 0px #111111; transition: transform 0.1s; letter-spacing: 2px;
}
.input-group input:focus { background-color: #e6f7ff; }

/* Nút Chọn Phép Tính */
.operator-group { margin-bottom: 20px; }
.operator-group label { display: block; font-weight: 800; margin-bottom: 8px; font-size: 1.05rem; }
.radio-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.radio-btn { cursor: pointer; display: block; }
.radio-btn input { display: none; }
.radio-btn span {
    display: block; text-align: center; padding: 10px; font-weight: 800; font-size: 1.1rem;
    border: 3px solid #111111; border-radius: 6px; background-color: #fff;
    box-shadow: 2px 2px 0px #111111; transition: background-color 0.2s;
}
.radio-btn input:checked + span { background-color: #ffdac1; box-shadow: inset 2px 2px 0px rgba(0,0,0,0.1); transform: translate(2px, 2px); }

/* Nút Bấm */
.action-buttons { display: grid; grid-template-columns: 2fr 1fr; gap: 15px; margin-top: 25px; }
button {
    cursor: pointer; font-family: 'Montserrat', sans-serif; font-size: 1.1rem;
    font-weight: 900; padding: 15px; border: 3px solid #111111; border-radius: 8px;
    box-shadow: 4px 4px 0px #111111; transition: transform 0.1s, box-shadow 0.1s;
    text-transform: uppercase; color: #111111; outline: none;
}
button:active { transform: translate(4px, 4px); box-shadow: 0px 0px 0px #111111; }
.btn-calculate { background-color: #b5ead7; }
.btn-clear { background-color: #eceae4; }

/* --- CỘT HIỂN THỊ KẾT QUẢ --- */
.result-panel { display: flex; flex-direction: column; gap: 20px; }
.panel-heading {
    font-family: 'Montserrat', sans-serif; font-size: 1.2rem; font-weight: 900;
    margin: 0; border-bottom: 3px dashed #111111; padding-bottom: 10px; text-align: center;
}

/* Hiệu ứng Giấy ô ly */
.paper-grid {
    background-color: #ffffff; min-height: 250px; border: 3px solid #111111; border-radius: 8px;
    box-shadow: 4px 4px 0px #111111; padding: 30px; display: flex; justify-content: center; align-items: center;
    background-image: linear-gradient(#e5e5e5 1px, transparent 1px), linear-gradient(90deg, #e5e5e5 1px, transparent 1px);
    background-size: 20px 20px; overflow-x: auto;
}
.empty-state { font-weight: 600; color: #888; font-style: italic; background: #fff; padding: 10px; }

/* CSS cho Phép tính dọc (Monospace) */
.math-vertical {
    font-family: 'Courier New', Courier, monospace; font-size: 2.2rem; font-weight: 900;
    line-height: 1.5; color: #111; background-color: rgba(255,255,255,0.85);
    padding: 20px 40px; border-radius: 8px; letter-spacing: 8px; white-space: pre;
}

/* CSS riêng cho phép chia kiểu Việt Nam */
.math-division {
    display: flex; font-family: 'Courier New', Courier, monospace; font-size: 2.2rem;
    font-weight: 900; line-height: 1.5; color: #111; background-color: rgba(255,255,255,0.85);
    padding: 20px; border-radius: 8px; letter-spacing: 5px;
}
.div-left { text-align: right; padding-right: 15px; border-right: 3px solid #111; white-space: pre; }
.div-right { padding-left: 15px; text-align: left; white-space: pre; }
.div-hr { border: none; border-top: 3px solid #111; margin: 0; }

.explanation-box { background-color: #e6f7ff; border: 3px solid #111; border-radius: 8px; padding: 20px; }
.explanation-box h4 { margin: 0 0 10px 0; font-family: 'Montserrat', sans-serif; }
#explanationText { font-size: 1rem; line-height: 1.6; color: #333; }
#explanationText ul { margin: 0; padding-left: 20px; }
#explanationText li { margin-bottom: 5px; }

@media (max-width: 800px) {
    .main-layout { grid-template-columns: 1fr; }
    .math-vertical, .math-division { font-size: 1.5rem; letter-spacing: 4px; padding: 15px; }
}