/* =============================================
   TI-30X IIS Scientific Calculator - Styles
   ============================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* =============================================
   Calculator Body
   ============================================= */

.calculator-body {
    width: 340px;
    background: linear-gradient(180deg, #1a3a5c 0%, #1e4d7a 8%, #1a4570 50%, #163d65 100%);
    border-radius: 18px 18px 24px 24px;
    padding: 16px 18px 22px 18px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 8px 20px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
    position: relative;
    user-select: none;
}

/* Subtle texture overlay */
.calculator-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 18px 18px 24px 24px;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 1px,
        rgba(255, 255, 255, 0.005) 1px,
        rgba(255, 255, 255, 0.005) 2px
    );
    pointer-events: none;
}

/* =============================================
   Solar Panel
   ============================================= */

.solar-panel {
    display: flex;
    gap: 3px;
    margin: 0 auto 10px auto;
    width: 120px;
    padding: 4px 6px;
    background: #0a0a12;
    border-radius: 3px;
    border: 1px solid #2a2a3a;
}

.solar-cell {
    flex: 1;
    height: 14px;
    background: linear-gradient(180deg, #1a1a3a 0%, #2a2a5a 40%, #1a1a3a 100%);
    border-radius: 1px;
    border: 1px solid #0a0a1a;
}

/* =============================================
   Branding
   ============================================= */

.branding {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0 4px;
    margin-bottom: 8px;
}

.brand-name {
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.65);
    text-transform: uppercase;
}

.model-name {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.5px;
}

/* =============================================
   Display
   ============================================= */

.display-bezel {
    background: #b8bfaa;
    border-radius: 6px;
    padding: 4px;
    margin-bottom: 14px;
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 1px 0 rgba(255, 255, 255, 0.1);
}

.display {
    background: #c8d4a9;
    border-radius: 4px;
    padding: 6px 10px 8px 10px;
    min-height: 72px;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
}

.display-indicators {
    display: flex;
    gap: 6px;
    margin-bottom: 2px;
    flex-wrap: wrap;
}

.indicator {
    font-size: 7px;
    font-weight: 600;
    color: transparent;
    letter-spacing: 0.3px;
    font-family: 'Courier New', monospace;
    transition: color 0.15s ease;
}

.indicator.active {
    color: #2a3a1a;
}

.display-line {
    font-family: 'Courier New', 'Consolas', monospace;
    color: #2a3a1a;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    min-height: 1.2em;
}

.display-line-1 {
    font-size: 14px;
    line-height: 1.3;
    text-align: right;
    opacity: 0.85;
    min-height: 20px;
}

.display-line-2 {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    text-align: right;
    letter-spacing: 1px;
}

/* =============================================
   Button Grid
   ============================================= */

.button-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px 5px;
    padding: 0 2px;
}

.btn-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.second-label {
    font-size: 7.5px;
    font-weight: 600;
    color: #f0c040;
    letter-spacing: 0.2px;
    min-height: 11px;
    text-align: center;
    line-height: 1;
    text-shadow: 0 0 3px rgba(240, 192, 64, 0.3);
}

/* =============================================
   Button Base Styles
   ============================================= */

.btn {
    width: 100%;
    height: 34px;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: all 0.08s ease;
    letter-spacing: 0.3px;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    outline: none;
}

.btn:active {
    transform: translateY(1px);
    box-shadow: none !important;
}

/* =============================================
   Button Variants
   ============================================= */

/* 2nd button - Yellow/Gold */
.btn-2nd {
    background: linear-gradient(180deg, #f5c842 0%, #d4a017 100%);
    color: #1a1a1a;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    font-weight: 700;
    font-size: 10px;
}

.btn-2nd:hover {
    background: linear-gradient(180deg, #f7d058 0%, #e0ac1f 100%);
}

.btn-2nd.active {
    background: linear-gradient(180deg, #ffe066 0%, #f5c842 100%);
    box-shadow:
        0 0 8px rgba(245, 200, 66, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Top function row (Mode, DEL, arrows) - Dark gray/charcoal */
.btn-func-top {
    background: linear-gradient(180deg, #4a4a52 0%, #35353d 100%);
    color: #e8e8e8;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    font-size: 10px;
}

.btn-func-top:hover {
    background: linear-gradient(180deg, #555560 0%, #404048 100%);
}

/* Arrow buttons */
.btn-arrow {
    font-size: 12px;
    padding: 0;
}

/* Scientific function buttons - Medium gray */
.btn-func {
    background: linear-gradient(180deg, #5c6068 0%, #464a52 100%);
    color: #e8e8e8;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    font-size: 10px;
}

.btn-func:hover {
    background: linear-gradient(180deg, #686c74 0%, #52565e 100%);
}

/* Number buttons - Dark charcoal/black */
.btn-num {
    background: linear-gradient(180deg, #3a3a42 0%, #252528 100%);
    color: #ffffff;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    font-size: 14px;
    font-weight: 700;
}

.btn-num:hover {
    background: linear-gradient(180deg, #48484f 0%, #303035 100%);
}

/* Operation buttons (+, −, ×, ÷) - Blue */
.btn-op {
    background: linear-gradient(180deg, #4a7fb5 0%, #2e5f8a 100%);
    color: #ffffff;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    font-size: 15px;
    font-weight: 700;
}

.btn-op:hover {
    background: linear-gradient(180deg, #5890c5 0%, #3a6f9a 100%);
}

/* ON/C button - Red accent */
.btn-onc {
    background: linear-gradient(180deg, #c44040 0%, #a02020 100%);
    color: #ffffff;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    font-size: 9px;
    font-weight: 700;
}

.btn-onc:hover {
    background: linear-gradient(180deg, #d05050 0%, #b03030 100%);
}

/* Enter/= button - Dark blue */
.btn-enter {
    background: linear-gradient(180deg, #2c5aa0 0%, #1a3d70 100%);
    color: #ffffff;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    font-size: 16px;
    font-weight: 700;
}

.btn-enter:hover {
    background: linear-gradient(180deg, #3868b0 0%, #264d80 100%);
}

/* =============================================
   Bottom Branding
   ============================================= */

.bottom-branding {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

.ti-logo {
    font-size: 18px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 2px;
    font-style: italic;
}

/* =============================================
   Animations
   ============================================= */

@keyframes press {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.btn.pressed {
    animation: press 0.1s ease;
}

/* =============================================
   Error state
   ============================================= */

.display.error .display-line-2 {
    color: #6a1a1a;
}

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 380px) {
    .calculator-body {
        width: 300px;
        padding: 14px 14px 18px 14px;
    }

    .btn {
        height: 30px;
        font-size: 10px;
    }

    .btn-num {
        font-size: 13px;
    }

    .btn-op {
        font-size: 14px;
    }

    .btn-enter {
        font-size: 14px;
    }

    .display-line-2 {
        font-size: 20px;
    }
}

@media (min-width: 500px) {
    .calculator-body {
        width: 380px;
        padding: 20px 22px 26px 22px;
    }

    .btn {
        height: 38px;
        font-size: 12px;
    }

    .btn-num {
        font-size: 16px;
    }

    .btn-op {
        font-size: 17px;
    }

    .btn-enter {
        font-size: 18px;
    }

    .second-label {
        font-size: 8px;
    }

    .display-line-1 {
        font-size: 15px;
    }

    .display-line-2 {
        font-size: 24px;
    }
}
