/* --- VARIABLES --- */
:root {
    --primary-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --card-bg: #ffffff;
    --btn-num-bg: #f8f9fa;
    --btn-num-text: #212529;
    --screen-bg: #1e272e;
    --screen-text: #0be881; /* Neon green result preview */
    --accent-color: #0d6efd;
}

[data-bs-theme="dark"] {
    --primary-gradient: linear-gradient(135deg, #1e272e 0%, #000000 100%);
    --card-bg: #212529;
    --btn-num-bg: #343a40;
    --btn-num-text: #f8f9fa;
    --screen-bg: #000000;
}

/* --- BASE STYLES --- */
body {
    background: var(--primary-gradient);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-container {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.calc-main-wrapper {
    max-width: 460px;
    background: var(--card-bg);
    border-radius: 32px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.08);
}

/* --- NAVIGATION --- */
.nav-pills .nav-link {
    border-radius: 0;
    padding: 16px;
    color: #6c757d;
    font-weight: 600;
    background: rgba(0,0,0,0.01);
    transition: 0.3s;
}

.nav-pills .nav-link.active {
    background: var(--card-bg);
    color: var(--accent-color);
    border-bottom: 3px solid var(--accent-color);
}

/* --- DISPLAY SECTION --- */
.display-screen {
    background: var(--screen-bg);
    color: #ffffff;
    min-height: 220px;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}

.history-line {
    font-size: 1.1rem;
    color: #8c8c8c;
    min-height: 1.6rem;
    font-family: 'Inter', monospace;
}

.main-input-text {
    font-size: 3.5rem;
    line-height: 1;
    word-wrap: break-word;
    max-width: 100%;
    transition: 0.2s;
}

.preview-result-text {
    font-size: 1.8rem;
    color: #888;
    font-weight: 400;
    transition: 0.3s;
}

/* --- BUTTONS --- */
.btn { 
    border-radius: 16px; 
    transition: transform 0.1s ease, filter 0.2s; 
    border: none;
}

.btn:active { transform: scale(0.94); }

.btn-num { 
    background: var(--btn-num-bg); 
    color: var(--btn-num-text); 
    height: 64px; 
    font-size: 1.25rem;
    font-weight: 500;
}

.btn-sci { 
    background: rgba(13, 110, 253, 0.08); 
    color: var(--accent-color); 
    height: 52px; 
    font-size: 0.95rem; 
    font-weight: 600;
}

.btn-operator { 
    background: rgba(13, 110, 253, 0.12); 
    color: var(--accent-color); 
    height: 64px; 
    font-size: 1.4rem;
    font-weight: bold; 
}

[data-bs-theme="dark"] .btn-operator { 
    background: #0d6efd; 
    color: #fff; 
}

[data-bs-theme="dark"] .btn-num:hover {
    filter: brightness(1.2);
}

/* --- OFFCANVAS --- */
.offcanvas {
    border-radius: 20px 0 0 20px;
}

.list-group-item {
    background: transparent;
    border-left: none;
    border-right: none;
    transition: 0.2s;
}

.list-group-item:hover {
    background: rgba(13, 110, 253, 0.05);
}