:root {
    --bg-img: url('image_8ea965.jpg'); 
    --calc-glass: rgba(255, 255, 255, 0.85);
    --text-main: #1a1a1a;
    --accent: #4a5d4d;
    --btn-bg: rgba(255, 255, 255, 0.95);
    --shadow: rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] {
    --bg-img: url('image_8efb5f.jpg');
    --calc-glass: rgba(15, 23, 30, 0.9);
    --text-main: #fcfcfc;
    --accent: #a29bfe;
    --btn-bg: rgba(45, 52, 63, 0.85);
    --shadow: rgba(0, 0, 0, 0.5);
}

body {
    margin: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: var(--bg-img);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    transition: background 0.8s ease;
    font-family: 'Segoe UI', sans-serif;
}

/* --- THE CALCULATOR --- */
.calculator {
    background: var(--calc-glass);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    
    /* FIX: Large top padding so numbers aren't cut off */
    padding: 80px 25px 40px 25px; 
    
    border-radius: 40px;
    width: 340px;
    height: auto; 
    min-height: 580px; 
    
    box-shadow: 0 25px 50px var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 10;
}

#display {
    text-align: right;
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 20px;
    word-wrap: break-word;
}

#history {
    min-height: 20px;
    font-size: 1rem;
    color: var(--accent);
    text-align: right;
}

/* --- TABS --- */
.solver-tabs {
    display: flex; gap: 8px; margin-bottom: 30px;
    background: rgba(0, 0, 0, 0.05); padding: 5px; border-radius: 20px;
}

.tab-btn {
    flex: 1; padding: 12px; border-radius: 15px; border: none;
    cursor: pointer; font-weight: 700; color: var(--text-main); background: transparent;
}

.tab-btn.active { background: var(--accent); color: white !important; }

/* --- BUTTONS --- */
.buttons {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; justify-items: center;
}

.btn {
    width: 62px; height: 62px; border-radius: 50%; border: none;
    background: var(--btn-bg); color: var(--text-main);
    font-size: 1.1rem; font-weight: 700; cursor: pointer;
    box-shadow: 0 4px 8px var(--shadow);
    display: flex; align-items: center; justify-content: center;
    transition: 0.2s;
}

.btn:hover { background: var(--accent); color: white; transform: scale(1.1); }

/* --- THEME TOGGLE PILL --- */
#theme-toggle {
    position: fixed; top: 25px; right: 25px;
    padding: 10px 20px; border-radius: 30px; border: none;
    background: var(--calc-glass); color: var(--text-main);
    cursor: pointer; font-weight: 600; z-index: 999;
    box-shadow: 0 4px 15px var(--shadow);
}
