:root {
    --bg-color: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --btn-bg: rgba(255, 255, 255, 0.05);
    --btn-hover: rgba(255, 255, 255, 0.1);
    --danger: #ef4444;
    --font: 'Segoe UI', system-ui, sans-serif;
}

/* Theme: Neon Cyber */
body.theme-neon {
    --bg-color: #050510;
    --glass-bg: rgba(10, 10, 25, 0.8);
    --glass-border: #ff00ff;
    --text-main: #00ffff;
    --text-muted: #ff00ff;
    --accent: #ff00ff;
    --accent-hover: #cc00cc;
    --btn-bg: rgba(0, 255, 255, 0.1);
    --btn-hover: rgba(0, 255, 255, 0.2);
}

/* Theme: Minimal White */
body.theme-minimal {
    --bg-color: #f1f5f9;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(0, 0, 0, 0.1);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent: #0ea5e9;
    --accent-hover: #0284c7;
    --btn-bg: rgba(0, 0, 0, 0.05);
    --btn-hover: rgba(0, 0, 0, 0.1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font);
    min-height: 100vh; /* height: 100vh ki jagah min-height use karein */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.5s ease;
    overflow-y: auto; /* Scroll allow karne ke liye */
    padding: 20px 0;
}

.app-container {
    display: flex;
    gap: 20px;
    width: 95vw;
    max-width: 1400px;
    height: 90vh;
}

.panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.left-panel, .right-panel { flex: 1; }
.center-panel { flex: 1.5; }

.glass-box {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

/* Typography & Display */
h3 { margin-bottom: 15px; font-size: 1.1rem; color: var(--text-muted); display: flex; justify-content: space-between; align-items: center; }

.display-screen {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: right;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
}

.suggestions { font-size: 0.9rem; color: var(--text-muted); position: absolute; top: 10px; left: 15px; }
.expression { font-size: 1.5rem; color: var(--text-muted); min-height: 30px; word-wrap: break-word;}
.live-result { font-size: 3rem; font-weight: 600; color: var(--text-main); word-wrap: break-word;}

/* Keypads */
.keypad { display: grid; gap: 10px; }
.basic-keys { grid-template-columns: repeat(4, 1fr); }
.sci-keys { grid-template-columns: repeat(4, 1fr); margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--glass-border); }
.hidden { display: none; }

.btn {
    background: var(--btn-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 15px;
    font-size: 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.1s ease;
}
.btn:hover { background: var(--btn-hover); transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.btn.op { color: var(--accent); font-weight: bold; }
.btn.calc-btn { background: var(--accent); color: #fff; border: none; }
.btn.calc-btn:hover { background: var(--accent-hover); }
.span-2 { grid-column: span 2; }

/* Controls & Lists */
.controls { display: flex; gap: 10px; justify-content: center; }
.controls button { background: var(--btn-bg); color: var(--text-main); border: 1px solid var(--glass-border); padding: 8px 12px; border-radius: 20px; cursor: pointer; transition: 0.3s; }
.controls button.active { background: var(--accent); border-color: var(--accent); color: white;}

.scroll-list { flex: 1; overflow-y: auto; list-style: none; padding-right: 5px; }
.scroll-list::-webkit-scrollbar { width: 6px; }
.scroll-list::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 10px; }

.history-item, .step-item, .mem-item {
    padding: 10px;
    background: var(--btn-bg);
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    animation: slideIn 0.3s ease forwards;
}
.history-item:hover { background: var(--btn-hover); }
.hist-expr { font-size: 0.9rem; color: var(--text-muted); }
.hist-res { font-size: 1.2rem; font-weight: bold; }

/* Memory & Graph Inputs */
input {
    background: rgba(0,0,0,0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 8px;
    border-radius: 6px;
    outline: none;
    width: 100%;
    margin-bottom: 10px;
}
.memory-inputs { display: flex; gap: 5px; margin-bottom: 10px; }
.memory-inputs button, #btn-graph, h3 button {
    background: var(--accent); color: white; border: none; padding: 5px 10px; border-radius: 6px; cursor: pointer;
}
canvas { background: rgba(0,0,0,0.2); border-radius: 8px; width: 100%; height: 200px; margin-top: 10px; }

@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* Responsive / Mobile Optimization */
@media (max-width: 900px) {
    body {
        padding: 10px;
        align-items: flex-start;
        /* Mobile par top se start ho */
    }
    
    .app-container {
        flex-direction: column;
        height: auto;
        width: 100%;
        padding: 10px 0;
        gap: 15px;
    }
    
    .panel {
        width: 100%;
    }
    
    /* Mobile par buttons aur display thode chhote karein */
    .btn {
        padding: 12px;
        font-size: 1.1rem;
    }
    
    .display-screen {
        min-height: 120px;
        padding: 15px;
    }
    
    .live-result {
        font-size: 2.2rem;
    }
    
    /* Graph canvas ko mobile screen ke hisaab se adjust karein */
    canvas {
        height: 160px;
    }
    
    /* Keyboard mode toggle aur tools ko wrap karein */
    .controls {
        flex-wrap: wrap;
    }
}
