:root {
    --bg-speed: 15s;
}

/* Theme 1: Midnight */
.theme-midnight {
    --accent: #7d5fff;
    --bg-1: #0f0c29;
    --bg-2: #302b63;
    --text: #ffffff;
}

/* Theme 2: Emerald */
.theme-emerald {
    --accent: #00ff88;
    --bg-1: #001f11;
    --bg-2: #004d2c;
    --text: #e0fef0;
}

/* Theme 3: Nordic (Minimal Grey) */
.theme-nordic {
    --accent: #8892b0;
    --bg-1: #0a192f;
    --bg-2: #172a45;
    --text: #ccd6f6;
}

/* Theme 4: Berry */
.theme-berry {
    --accent: #ff0077;
    --bg-1: #2d0b1d;
    --bg-2: #520c30;
    --text: #ffe0ed;
}

* {
    margin: 0; padding: 0; box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.8s ease;
}

/* --- Dynamic Mesh Background --- */
.mesh-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    background: linear-gradient(45deg, var(--bg-1), var(--bg-2), var(--bg-1));
    background-size: 400% 400%;
    animation: meshMove var(--bg-speed) infinite alternate ease-in-out;
}

@keyframes meshMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- Calculator UI --- */
.calculator {
    width: 340px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 30px;
    box-shadow: 0 40px 100px rgba(0,0,0,0.5);
}

/* Theme Selector */
.theme-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s transform;
    border: 1px solid rgba(255,255,255,0.2);
}
.dot:hover { transform: scale(1.4); }
.dot-1 { background: #7d5fff; }
.dot-2 { background: #00ff88; }
.dot-3 { background: #8892b0; }
.dot-4 { background: #ff0077; }

.display {
    text-align: right;
    margin-bottom: 30px;
}

.curr-val {
    font-size: 3rem;
    color: var(--text);
    font-weight: 300;
}

.prev-val {
    color: rgba(255,255,255,0.4);
    height: 20px;
}

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

button {
    height: 60px;
    border: none;
    border-radius: 15px;
    background: rgba(255,255,255,0.05);
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
}

button:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

button:active { transform: scale(0.95); }

.operator { color: var(--accent); font-weight: bold; }
.special { color: #ff5e5e; }
.equal { 
    background: var(--accent); 
    color: #000; 
    font-weight: bold; 
}
.equal:hover {
    box-shadow: 0 0 20px var(--accent);
}

.span-two { grid-column: span 2; }


/* ... (Purani CSS Variables aur Mesh BG ka code wahi rahega) ... */

.main-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 90vh; /* Adjust height for spacing */
    z-index: 10;
}

/* --- Header / Logo Styling --- */
.ui-header {
    text-align: center;
    margin-bottom: 20px;
}

.logo {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 5px;
    color: var(--text);
    text-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.logo span {
    color: var(--accent); /* Theme base color */
    font-weight: 300;
}

.tagline {
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 5px;
}

/* --- Footer Styling --- */
.ui-footer {
    width: 100%;
    text-align: center;
    padding: 20px;
    color: rgba(255,255,255,0.4);
}

.footer-line {
    width: 50px;
    height: 2px;
    background: var(--accent);
    margin: 0 auto 15px;
    border-radius: 10px;
    opacity: 0.5;
}

.ui-footer p {
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.calculator {
    margin: 20px 0;
}