/* Scientific Calculator Premium Styles */

.apple-glass {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.calc-container {
    background: rgba(10, 10, 12, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
    position: relative;
    overflow: hidden;
}

.calc-screen {
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 100px;
    font-family: 'Space Grotesk', monospace;
}

.calc-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem; /* 14px */
    border-radius: 1rem;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    min-height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

/* Button Categories */
.btn-num {
    background: rgba(255, 255, 255, 0.04);
    color: #f4f4f5;
}
.btn-num:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}
.btn-num:active {
    transform: scale(0.95);
}

.btn-op {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.15);
}
.btn-op:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}
.btn-op:active {
    transform: scale(0.95);
}

.btn-fn {
    background: rgba(255, 255, 255, 0.02);
    color: #a1a1aa;
    font-size: 0.75rem;
}
.btn-fn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #f4f4f5;
}
.btn-fn:active {
    transform: scale(0.95);
}

.btn-mem {
    background: rgba(255, 255, 255, 0.01);
    color: #71717a;
    font-size: 0.7rem;
    min-height: 36px;
    border-radius: 0.5rem;
}
.btn-mem:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #a1a1aa;
}

.btn-action {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.15);
}
.btn-action:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-equals {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}
.btn-equals:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}
.btn-equals:active {
    transform: scale(0.95);
}

/* Base selectors in Programmer mode */
.base-row {
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}
.base-row:hover {
    background: rgba(255, 255, 255, 0.02);
}
.base-row.active-base {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
    border-radius: 0.75rem;
}

/* Toggles & Tabs */
.tab-active {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa !important;
    border: 1px solid rgba(59, 130, 246, 0.3);
}
.tab-inactive {
    color: #71717a;
    border: 1px solid transparent;
}
.tab-inactive:hover {
    color: #f4f4f5;
    background: rgba(255, 255, 255, 0.03);
}

/* Programmer base status disabled keys */
.btn-disabled {
    opacity: 0.2;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.01) !important;
    color: #3f3f46 !important;
    border-color: transparent !important;
}

/* History items styling */
.history-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.2s;
}
.history-item:hover {
    background: rgba(255, 255, 255, 0.01);
}
.history-item:last-child {
    border-bottom: none;
}

/* Custom Scrollbar for list panels */
.custom-scroll::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.custom-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}
.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Glow effects */
.glow-blue {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.1);
}

/* Keypad Grid Animations */
.key-press-animation {
    animation: keyPress 0.1s ease;
}
@keyframes keyPress {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* ==========================================================
   LIGHT THEME (NOT DARK) OVERRIDES FOR PREMIUM CALCULATOR
   ========================================================== */
html:not(.dark) .calc-container {
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.06) !important;
}

html:not(.dark) .glow-blue {
    box-shadow: none !important;
}

html:not(.dark) .calc-screen {
    background: rgba(244, 244, 245, 0.8) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

html:not(.dark) #display-history {
    color: #71717a !important;
}

html:not(.dark) #display-main {
    color: #18181b !important;
}

html:not(.dark) #programmer-bases {
    background: rgba(0, 0, 0, 0.02) !important;
    border-color: rgba(0, 0, 0, 0.05) !important;
}

html:not(.dark) .base-row:hover {
    background: rgba(0, 0, 0, 0.02) !important;
}

html:not(.dark) .base-row.active-base {
    background: rgba(59, 130, 246, 0.08) !important;
    border-color: rgba(59, 130, 246, 0.2) !important;
}

html:not(.dark) #base-hex-val,
html:not(.dark) #base-dec-val,
html:not(.dark) #base-oct-val,
html:not(.dark) #base-bin-val {
    color: #18181b !important;
}

/* Button Classes Overrides */
html:not(.dark) .btn-num {
    background: rgba(0, 0, 0, 0.04) !important;
    color: #18181b !important;
    border-color: rgba(0, 0, 0, 0.02) !important;
}

html:not(.dark) .btn-num:hover {
    background: rgba(0, 0, 0, 0.07) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

html:not(.dark) .btn-op {
    background: rgba(59, 130, 246, 0.08) !important;
    color: #2563eb !important;
    border-color: rgba(59, 130, 246, 0.15) !important;
}

html:not(.dark) .btn-op:hover {
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: rgba(59, 130, 246, 0.25) !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.1) !important;
}

html:not(.dark) .btn-fn {
    background: rgba(0, 0, 0, 0.02) !important;
    color: #52525b !important;
    border-color: rgba(0, 0, 0, 0.02) !important;
}

html:not(.dark) .btn-fn:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    color: #18181b !important;
}

html:not(.dark) .btn-mem {
    background: rgba(0, 0, 0, 0.01) !important;
    color: #71717a !important;
}

html:not(.dark) .btn-mem:hover {
    background: rgba(0, 0, 0, 0.04) !important;
    color: #3f3f46 !important;
}

html:not(.dark) .btn-action {
    background: rgba(239, 68, 68, 0.08) !important;
    color: #dc2626 !important;
    border-color: rgba(239, 68, 68, 0.15) !important;
}

html:not(.dark) .btn-action:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.25) !important;
}

html:not(.dark) .btn-disabled {
    opacity: 0.25 !important;
    background: rgba(0, 0, 0, 0.01) !important;
    color: #a1a1aa !important;
}

/* Inactive tabs */
html:not(.dark) .tab-inactive {
    color: #71717a !important;
}

html:not(.dark) .tab-inactive:hover {
    color: #18181b !important;
    background: rgba(0, 0, 0, 0.02) !important;
}

/* 2nd Active Mode Key */
html:not(.dark) #btn-2nd.bg-blue-500\/30 {
    background-color: rgba(59, 130, 246, 0.15) !important;
    color: #2563eb !important;
}

/* Angle Mode Button Overrides */
html:not(.dark) #angle-mode-container {
    background-color: rgba(0, 0, 0, 0.03) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

html:not(.dark) #angle-mode-container button.bg-blue-500\/20 {
    background-color: rgba(59, 130, 246, 0.1) !important;
    color: #2563eb !important;
    border-color: rgba(59, 130, 246, 0.2) !important;
}

html:not(.dark) #angle-mode-container button:not(.bg-blue-500\/20) {
    color: #71717a !important;
}

html:not(.dark) #angle-mode-container button:not(.bg-blue-500\/20):hover {
    color: #18181b !important;
}

/* Secondary Actions button (Share, Clear History) */
html:not(.dark) button.bg-zinc-900,
html:not(.dark) a.bg-zinc-900 {
    background-color: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    color: #334155 !important;
}

html:not(.dark) button.bg-zinc-900:hover,
html:not(.dark) a.bg-zinc-900:hover {
    background-color: rgba(0, 0, 0, 0.07) !important;
    color: #0f172a !important;
}

/* Statistics card blocks */
html:not(.dark) .bg-zinc-950\/40 {
    background-color: rgba(0, 0, 0, 0.02) !important;
    border-color: rgba(0, 0, 0, 0.05) !important;
}

/* Keyboard keys */
html:not(.dark) .font-mono.bg-zinc-900 {
    background-color: rgba(0, 0, 0, 0.04) !important;
    color: #18181b !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

/* Study Guide Section Typography */
html:not(.dark) #guide h2,
html:not(.dark) #guide h3,
html:not(.dark) #guide h4 {
    color: #18181b !important;
}

html:not(.dark) #guide p,
html:not(.dark) #guide li {
    color: #4b5563 !important;
}

/* Study Guide Table Cells styling */
html:not(.dark) .example-row td {
    color: #3f3f46 !important;
}

html:not(.dark) .example-row td.text-zinc-500 {
    color: #71717a !important;
}

html:not(.dark) .example-row td.text-blue-400 {
    color: #2563eb !important;
}

html:not(.dark) .border-white\/\[0\.03\] {
    border-color: rgba(0, 0, 0, 0.04) !important;
}

html:not(.dark) .history-item {
    border-bottom-color: rgba(0, 0, 0, 0.04) !important;
}

html:not(.dark) .history-item:hover {
    background: rgba(0, 0, 0, 0.01) !important;
}

html:not(.dark) .custom-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.08) !important;
}

html:not(.dark) .custom-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.18) !important;
}
