/* GIAO DIỆN SOFT BRUTALISM & NAMESPACED - CALCULUS CALCULATOR */
.calcmath-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;
}

.calcmath-container * { box-sizing: border-box; }

.calcmath-title {
    font-family: 'Montserrat', sans-serif; font-size: 2rem; text-align: center;
    text-transform: uppercase; margin-top: 0; margin-bottom: 10px; font-weight: 900;
}

.calcmath-desc { text-align: center; color: #444; font-weight: 600; margin-bottom: 30px; line-height: 1.5; }

/* Mode Selector */
.calcmath-mode-selector {
    display: flex; justify-content: center; gap: 15px; margin-bottom: 30px;
}
.calcmath-radio { cursor: pointer; display: block; }
.calcmath-radio input { display: none; }
.calcmath-radio span {
    display: block; padding: 12px 25px; font-weight: 800; font-size: 1.1rem;
    border: 3px solid #111; border-radius: 8px; background-color: #f4f4f4;
    box-shadow: 3px 3px 0px #111; transition: all 0.1s;
}
.calcmath-radio input:checked + span {
    background-color: #ffdac1; transform: translate(3px, 3px); box-shadow: 0px 0px 0px #111;
}

/* Layout */
.calcmath-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; }

/* Input Panel */
.calcmath-input-panel {
    background-color: #e6f7ff; border: 3px solid #111; border-radius: 10px;
    padding: 25px; box-shadow: 4px 4px 0px #111; display: flex; flex-direction: column;
}

.calcmath-group { margin-bottom: 20px; }
.calcmath-group:last-child { margin-bottom: 0; }
.calcmath-label { display: block; font-weight: 800; font-size: 1.05rem; margin-bottom: 8px; }

.calcmath-input {
    width: 100%; padding: 15px; font-size: 1.3rem; font-weight: 800;
    font-family: 'Courier New', Courier, monospace; border: 3px solid #111;
    border-radius: 8px; outline: none; background-color: #fff; box-shadow: inset 3px 3px 0px rgba(0,0,0,0.05);
}
.calcmath-input:focus { border-color: #2d7bb5; }

.calcmath-group small { display: block; margin-top: 8px; font-weight: 600; color: #555; }

.calcmath-integral-limits {
    display: grid; grid-template-columns: 1fr 1fr; gap: 15px;
    background-color: #fff; border: 3px dashed #111; padding: 15px; border-radius: 8px; margin-bottom: 20px;
}

.calcmath-actions { margin-top: auto; }
.calcmath-btn-primary {
    width: 100%; background-color: #111; color: #fff; font-family: 'Montserrat', sans-serif;
    font-weight: 900; font-size: 1.1rem; padding: 15px; border: 3px solid #111; border-radius: 8px;
    cursor: pointer; box-shadow: 4px 4px 0px #666; transition: transform 0.1s;
}
.calcmath-btn-primary:active { transform: translate(4px, 4px); box-shadow: 0px 0px 0px #666; }

/* Result Panel */
.calcmath-result-panel { display: flex; flex-direction: column; }
.calcmath-panel-heading {
    margin: 0 0 15px 0; font-family: 'Montserrat', sans-serif; font-size: 1.2rem;
    border-bottom: 3px dashed #111; padding-bottom: 10px;
}

.calcmath-result-box {
    flex: 1; background-color: #fdfd96; border: 3px solid #111; border-radius: 10px;
    padding: 25px; box-shadow: 4px 4px 0px #111; display: flex; flex-direction: column;
    justify-content: center; align-items: center; text-align: center;
}

.calcmath-empty { font-weight: 600; color: #555; font-style: italic; }

.calcmath-equation { font-size: 1.1rem; font-weight: 800; color: #333; margin-bottom: 10px; }
.calcmath-value {
    font-family: 'Courier New', Courier, monospace; font-size: 1.8rem; font-weight: 900;
    color: #e05a47; word-break: break-all; margin-bottom: 20px;
}

.calcmath-btn-copy {
    background-color: #fff; border: 3px solid #111; border-radius: 6px;
    padding: 10px 20px; font-weight: 800; font-size: 0.95rem; cursor: pointer;
    box-shadow: 3px 3px 0px #111; transition: transform 0.1s; font-family: 'Montserrat', sans-serif;
}
.calcmath-btn-copy:active { transform: translate(3px, 3px); box-shadow: 0px 0px 0px #111; }

.calcmath-error {
    margin-top: 15px; background-color: #ffe6e6; color: #e05a47; border: 2px dashed #e05a47;
    border-radius: 8px; padding: 12px; font-weight: 700; font-size: 0.95rem; display: none;
}

/* Toast */
#calcmathToast {
    visibility: hidden; min-width: 200px; background-color: #111111; color: #ffffff;
    text-align: center; border-radius: 8px; padding: 12px; position: fixed;
    z-index: 9999; bottom: 30px; left: 50%; transform: translateX(-50%);
    font-weight: bold; opacity: 0; transition: opacity 0.3s, bottom 0.3s;
}
#calcmathToast.show { visibility: visible; opacity: 1; bottom: 50px; }

@media (max-width: 850px) {
    .calcmath-layout { grid-template-columns: 1fr; }
    .calcmath-mode-selector { flex-direction: column; align-items: stretch; }
    .calcmath-radio span { text-align: center; }
}