/* ==========================================================================
   Premium Dark Calculator Stylesheet - ชัยพฤกษ์เกษตร
   ========================================================================== */

/* Global Reset & Base Setup */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #000000;
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: start;
    min-height: 100vh;
    width: 100vw;
    user-select: none;
    -webkit-user-select: none;
    overscroll-behavior: none;
    overflow-y: scroll;
}

/* Custom History Box Scrollbar */
.no-scrollbar::-webkit-scrollbar {
    display: block;
    width: 6px;
}

.no-scrollbar::-webkit-scrollbar-thumb {
    background-color: #2c2c2e;
    border-radius: 3px;
}

.no-scrollbar {
    -ms-overflow-style: auto;
    scrollbar-width: thin;
    overflow-y: auto;
}

/* App Container Layout */
.calculator-container {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    justify-content: start;
    padding: 1.5rem;
}

/* History Log Box Display */
.history-display-panel {
    width: 100%;
    min-height: 160px;
    max-height: 220px;
    background-color: #1c1c1e;
    border-radius: 1rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid #2c2c2e;
    margin-bottom: 1rem;
}

.history-box {
    flex: 1;
    overflow-y: auto;
    text-align: right;
    padding-right: 0.25rem;
    color: #9ca3af;
    font-size: 0.875rem;
    font-family: monospace;
}

.history-box .empty-log {
    text-align: center;
    color: #4b5563;
    padding-top: 3rem;
    font-family: sans-serif;
}

.history-box .log-row {
    padding-bottom: 0.25rem;
    border-bottom: 1px solid rgba(44, 44, 46, 0.4);
    margin-bottom: 0.25rem;
}

.history-box .log-row:last-child {
    border-bottom: 0;
    margin-bottom: 0;
}

.history-box .log-expr {
    color: #6b7280;
}

.history-box .log-res {
    color: #ff9f0a;
    font-weight: 500;
    cursor: pointer;
}

.history-box .log-res:active {
    color: #ffffff;
}

/* Current Typing Live Expression */
.live-expression {
    border-top: 1px solid #2c2c2e;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    text-align: right;
    color: #6b7280;
    font-size: 0.875rem;
    min-height: 20px;
}

/* Number Display Screen */
.main-screen-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    min-height: 90px;
}

.main-display {
    font-weight: 300;
    letter-spacing: -0.025em;
    word-break: break-all;
    text-align: right;
    width: 100%;
    transition: all 0.1s ease;
}

/* Display Font Sizes Dynamic Class via JS */
.size-7xl {
    font-size: 4.5rem;
    line-height: 1;
}

.size-5xl {
    font-size: 3rem;
    line-height: 1;
}

.size-4xl {
    font-size: 2.25rem;
    line-height: 1;
}

/* Grid Pad Keyboards */
.keyboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Universal Button Keys Style */
.calc-btn {
    width: 5rem;
    /* 80px */
    height: 5rem;
    border-radius: 9999px;
    border: none;
    font-size: 1.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    transition: background-color 0.1s ease;
}

/* Button Variants Skin Tone Color */
.btn-gray-light {
    background-color: #a5a5a5;
    color: #000000;
}

.btn-gray-light:active,
.btn-gray-light.active-state {
    background-color: #d9d9d9;
}

.btn-gray-dark {
    background-color: #333333;
    color: #ffffff;
}

.btn-gray-dark:active,
.btn-gray-dark.active-state {
    background-color: #555555;
}

.btn-brand-orange {
    background-color: #ff9f0a;
    color: #ffffff;
    font-size: 2.25rem;
}

.btn-brand-orange:active,
.btn-brand-orange.active-state {
    background-color: #fcc875;
}

/* Zero Special Column Button */
.btn-zero-wide {
    grid-column: span 2;
    width: 100%;
    height: 5rem;
    border-radius: 9999px;
    padding-left: 2rem;
    justify-content: flex-start;
}

/* Footer Controls Base Navigation */
.footer-nav {
    width: 100%;
    padding-top: 0.5rem;
    padding-bottom: 1.5rem;
}

.btn-back-home {
    width: 100%;
    height: 3.5rem;
    border-radius: 1rem;
    background-color: #1c1c1e;
    color: #9ca3af;
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid #2c2c2e;
    transition: all 0.1s ease;
}

.btn-back-home:active {
    background-color: #2c2c2e;
    color: #ffffff;
}

.btn-back-home svg {
    width: 20px;
    height: 20px;
}