/* =========================
 MOBILE BOTTOM BAR
========================= */

.mobile-bottom-bar{
    position:fixed;
    left:50%;
    bottom:1px;
    transform:translate(-50%,0);
    width:95%;
    max-width:600px;
    height:70px;
    background:#ffffff;
    display:flex;
    justify-content:space-around;
    align-items:center;
    border-radius:0;
    
    z-index:999999;
    transition:.35s ease;
}

/* links */
.mobile-bottom-bar a,
.mobile-bottom-bar button{
    flex:1;
    height:60px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    background:none;
    border:none;
    text-decoration:none;
    color:#333;
    cursor:pointer;
}

/* icon */
.mobile-bottom-bar span{
    font-size:25px;
    line-height:28px;
}

/* text */
.mobile-bottom-bar small{
    font-size:11px;
    margin-top:3px;
    font-family:Arial;
}

/* hover */
.mobile-bottom-bar a:hover,
.mobile-bottom-bar button:hover{
    color:gray;
}

/* =========================
 MOBILE ONLY
========================= */
@media (max-width:768px){

    body{
        padding-bottom:0;
    }



/* ==========================================================================
   FORCED OVER EVERYTHING - CALCULATOR DRAWER CSS
   ========================================================================== */

/* Background Overlay Tint */
.calculator-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 999998 !important; /* One level below drawer */
    opacity: 0;
    pointer-events: none;
    display: none;
    transition: opacity 0.25s ease;
}

.calculator-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* Slide-Up Bottom Container Sheet */
.calculator-drawer {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background: #ffffff !important;
    border-top-left-radius: 24px !important;
    border-top-right-radius: 24px !important;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.25) !important;
    padding-bottom: calc(16px + env(safe-area-inset-bottom)) !important; /* Pushes content up safely */
    box-sizing: border-box !important;
    
    /* Absolute structural stacking priority */
    z-index: 999999 !important; 
    display: none; 
    transform: translateY(100%);
}

/* Active Class Slide Action */
.calculator-drawer.active {
    display: block !important;
    animation: forceDrawerUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes forceDrawerUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Closing Action */
.calculator-drawer.closing {
    display: block !important;
    animation: forceDrawerDown 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes forceDrawerDown {
    from { transform: translateY(0); }
    to { transform: translateY(100%); }
}

/* --- INNER STYLES (HEADER, SCREEN & BUTTONS) --- */
.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 8px 20px;
    position: relative;
    border-bottom: 1px solid #f2f2f7;
}

.sheet-handle {
    width: 44px;
    height: 5px;
    background: #d1d1d6;
    border-radius: 3px;
    position: absolute;
    left: 50%;
    top: 10px;
    transform: translateX(-50%);
}

#calcClose {
    background: #f2f2f7;
    border: none;
    font-size: 16px;
    color: #3a3a3c;
    cursor: pointer;
    padding: 6px 12px;
    margin-left: auto; 
    font-weight: 600;
    border-radius: 50%;
}

.calc-container {
    padding: 16px;
    box-sizing: border-box;
}

.calc-display {
    width: 100%;
    background: #f2f2f7;
    border-radius: 16px;
    padding: 24px 20px;
    font-size: 2.2rem;
    text-align: right;
    font-weight: 600;
    color: #000000;
    margin-bottom: 20px;
    overflow-x: auto;
    white-space: nowrap;
    box-sizing: border-box;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.calc-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px; 
}

.calc-buttons button {
    background: #f2f2f7;
    border: none;
    outline: none;
    padding: 20px 0;
    font-size: 1.4rem;
    font-weight: 500;
    color: #000000;
    border-radius: 14px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.1s ease, transform 0.05s ease;
}

.calc-buttons button:active {
    background: #e5e5ea;
    transform: scale(0.95);
}

.calc-buttons button.op {
    background: #ff9f0a;
    color: #ffffff;
    font-weight: 600;
    font-size: 1.6rem;
}

.calc-buttons button.op:active {
    background: #cc7f08;
}

#calcEqual {
    background: #34c759;
    color: #ffffff;
    font-weight: 600;
    font-size: 1.6rem;
}

#calcEqual:active {
    background: #289e44;
}

/* Tablet Media Adaptor Configuration */
@media (min-width: 576px) {
    .calculator-drawer {
        max-width: 420px !important;
        left: 50% !important;
        right: auto !important;
        border-radius: 24px 24px 0 0 !important;
    }
    .calculator-drawer.active {
        animation: forceTabletUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    }
    .calculator-drawer.closing {
        animation: forceTabletDown 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    }
}

@keyframes forceTabletUp {
    from { transform: translate(-50%, 100%); }
    to { transform: translate(-50%, 0); }
}
@keyframes forceTabletDown {
    from { transform: translate(-50%, 0); }
    to { transform: translate(-50%, 100%); }
}








}
/* =========================
   DESKTOP HIDE
========================= */
@media (min-width:769px){

    .mobile-bottom-bar,
    .calculator-overlay,
    .calculator-drawer{
        display:none !important;
    }

}
