/* ============================================================
   Web Calculator - MDR Brand Restyle (v1.2.0)
   Charcoal #2a2829 / Yellow #fde900
   ============================================================ */

/* ------------------------------------------------------------
   Panel wrapper - fixed top-right, hidden by default.
   The plugin JS toggles this via .show()/.hide() (inline style)
   which will override display:none set here.
   ------------------------------------------------------------ */
.webcalc-content {
    display: none;
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 100000;
    font-family: "Roboto", "Helvetica", "Arial", sans-serif;
    margin: 0 !important;
}

.webcalc-main-wrapper {
    background: #ffffff;
    border: 2px solid #2a2829;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    width: 260px;
    max-height: calc(100vh - 330px);
    overflow-y: auto;
    box-sizing: border-box;
    padding: 0 !important;
    position: static !important;
    display: block !important;
}

.webcalc-main-inner {
    padding: 0;
}

/* ------------------------------------------------------------
   Workings area
   ------------------------------------------------------------ */
.webcalc-workspace-panel {
    background: transparent;
    box-shadow: none;
    height: auto;
    margin: 0;
    padding: 12px 12px 4px 12px;
}

.webcalc-workspace {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.webcalc-workspace-inner {
    margin: 0;
    width: 100%;
}

.webcalc-workspace-adjustments {
    display: block;
    width: 100%;
    position: relative;
}

.webcalc-workspace-label {
    display: block;
    position: static;
    font-size: 12px;
    font-weight: bold;
    color: #2a2829 !important;
    margin: 0 0 6px 0;
    padding: 0;
    background: transparent;
    transform: none;
    line-height: 1;
    font-family: "Roboto", "Helvetica", "Arial", sans-serif;
    pointer-events: auto;
}

.webcalc-workspace-fieldset-wrapper {
    display: block;
    padding: 0;
    border: none;
    border-radius: 0;
    position: static;
}

.webcalc-workspace-fieldset-wrapper fieldset,
.webcalc-workspace-fieldset-wrapper fieldset legend {
    display: none;
}

.webcalc-workspace-fieldset-wrapper textarea,
.webcalc-workspace-fieldset-wrapper textarea:focus,
.webcalc-workspace-fieldset-wrapper textarea:active {
    display: block;
    width: 100%;
    height: 120px;
    min-height: 120px;
    padding: 8px;
    margin: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #ffffff;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    color: #2a2829;
    resize: vertical;
    box-sizing: border-box;
    outline: none;
}

.webcalc-workspace-fieldset-wrapper textarea:focus {
    border-color: #2a2829;
}

/* ------------------------------------------------------------
   Calculator display + buttons
   ------------------------------------------------------------ */
.webcalc-calc-wrapper {
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
}

.webcalc-calc-inner {
    display: block;
    width: 100%;
    padding: 0;
}

.webcalc-calc-inner > div {
    width: 100%;
}

.webcalc-calc-display {
    display: block;
    background: #2a2829;
    color: #fde900;
    padding: 10px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    font-weight: bold;
    min-height: 30px;
    word-break: break-all;
    border-radius: 4px;
    border: 2px solid #fde900;
    margin: 6px 12px 8px 12px;
    width: auto;
    box-sizing: border-box;
    text-align: right;
    /* Exam integrity: no visual selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Button rows */
.webcalc-buttonset {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 4px 8px;
    width: 100%;
    box-sizing: border-box;
}

/* First row contains only the % button - push to the right */
.webcalc-buttonset:first-of-type {
    justify-content: flex-end;
    padding-right: 12px;
}

.webcalc-buttonset button {
    width: 45px;
    height: 45px;
    min-width: 45px;
    padding: 0;
    margin: 3px;
    background: #2a2829;
    color: #ffffff;
    font-family: "Roboto", "Helvetica", "Arial", sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: none;
    transition: background-color 0.15s ease, transform 0.1s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    outline: none;
    user-select: none;
}

.webcalc-buttonset button:hover {
    background: #3d3b3c;
}

.webcalc-buttonset button:active {
    transform: scale(0.95);
}

/* Equals button - MDR yellow accent */
.webcalc-buttonset .ex-btn {
    background: #fde900;
    color: #2a2829;
    min-width: 45px;
}

.webcalc-buttonset .ex-btn:hover {
    background: #ffed1a;
}

/* Bottom padding under button grid */
.webcalc-calc-inner > div > .webcalc-buttonset:last-of-type {
    margin-bottom: 8px;
}

/* ============================================================
   Floating "Calculator" toggle button (bottom-right, always visible)
   ============================================================ */
.webcalc-open-btn {
    position: fixed;
    bottom: 300px;
    right: 100px;
    z-index: 99999;
    background: #2a2829;
    color: #fde900;
    font-family: "Roboto", "Helvetica", "Arial", sans-serif;
    font-size: 14px;
    font-weight: 700;
    padding: 12px 22px;
    border-radius: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    text-align: center;
    max-width: none !important;
    width: auto !important;
    display: inline-block;
    border: none;
    user-select: none;
    transition: background-color 0.15s ease, transform 0.1s ease;
    line-height: 1.2;
}

.webcalc-open-btn:hover {
    background: #3d3b3c;
}

.webcalc-open-btn:active {
    transform: scale(0.98);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 767px) {
    .webcalc-content {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    .webcalc-main-wrapper {
        width: auto;
        max-width: 100%;
    }
    .webcalc-open-btn {
        bottom: 80px;
        right: 15px;
        padding: 10px 16px;
        font-size: 13px;
        display: inline-block;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .webcalc-open-btn {
        display: inline-block;
    }
}
