:root {
    /* Light Theme Variables */
    --bg-color: #f0f2f5;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --text-color: #333;
    --btn-bg: rgba(255, 255, 255, 0.5);
    --btn-hover: rgba(255, 255, 255, 0.9);
    --accent-color: #4a90e2;
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

[data-theme="dark"] {
    /* Dark Theme Variables */
    --bg-color: #1a1a2e;
    --glass-bg: rgba(22, 33, 62, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-color: #e0e0e0;
    --btn-bg: rgba(255, 255, 255, 0.05);
    --btn-hover: rgba(255, 255, 255, 0.15);
    --accent-color: #64ffda;
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Segoe UI', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    transition: background 0.3s ease;
}

/* Background Shapes for Glassmorphism effect */
.background-shapes .shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
}
.shape-1 { 
    top: -10%; 
    left: -10%; 
    width: 500px; 
    height: 500px; 
    background: #ff00cc; 
    opacity: 0.3; 
}
.shape-2 { 
    bottom: -10%; 
    right: -10%; 
    width: 400px; 
    height: 400px; 
    background: #3333ff; 
    opacity: 0.3; 
}

.calculator-container {
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 20px;
    transition: all 0.3s ease;
    max-width: 400px;
    margin: 20px;
}

/* Header & Toggle */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.icon-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}
.icon-btn:hover {
    background: var(--btn-bg);
}

/* Asset Selector */
.asset-selector select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: var(--btn-bg);
    color: var(--text-color);
    margin-bottom: 10px;
    font-size: 1rem;
    cursor: pointer;
}

/* Display */
.display-container {
    text-align: right;
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(0,0,0,0.05);
    border-radius: 10px;
}
#customAmount {
    width: 100%;
    padding: 8px;
    margin-bottom: 8px;
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    background: var(--btn-bg);
    color: var(--text-color);
    font-size: 0.9rem;
    outline: none;
}
#display {
align-self: center; 
width: 100%;
max-width: 100%;
box-sizing: border-box;   
font-family: 'Orbitron', sans-serif;
font-size: 28px;
text-align: right;
background: linear-gradient(145deg, #0f1a2f, #0a1425);
color: #00ffcc;
border: none;
padding: 15px;
border-radius: 8px;
box-shadow: inset 0 0 10px rgba(0,255,200,0.3);
caret-color: transparent;
animation: infinite alternate;
}

@keyframes glow {
from { box-shadow: inset 0 0 5px rgba(0,255,200,0.3); }
to { box-shadow: inset 0 0 20px rgba(0,255,200,0.8); }
}

.live-data {
    font-size: 0.85rem;
    color: var(--accent-color);
    margin-top: 8px;
    opacity: 0.9;
    min-height: 20px;
}

/* Keypad Grid */
.keypad {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.btn {
    padding: 18px;
    border-radius: 16px;
    border: none;
    background: var(--btn-bg);
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
    min-height: 50px;
}

.btn:active {
transform: translateY(3px);
box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

.btn .ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple-animation 600ms linear;
    background-color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.btn:hover {
    background: var(--btn-hover);
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn.op { 
    color: var(--accent-color); 
    font-weight: bold; 
}
.btn.equal { 
    background: var(--accent-color); 
    color: #fc7146; 
    grid-column: span 2; 
}
.btn.equal:hover {
    background: var(--accent-color);
    opacity: 0.9;
}
.btn.func { 
    color: #ff5722; 
}
.btn.sci {
    font-size: 1rem;
    background: rgba(0,0,0,0.03);
}

/* Responsive */
@media (max-width: 400px) {
    .calculator-container {
        width: 90%;
    }
}

@media (max-width: 480px) {
    body {
        align-items: flex-start;
        padding-top: 30px;
    }
    .calculator-container {
        max-width: 95%;
        padding: 18px;
    }
    .btn {
        padding: 16px;
        font-size: 1.1rem;
    }
    #display {
        font-size: 2rem;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.currency-select{
  width:100%;
  padding:12px 16px;
  font-size:16px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.15);
  background:#1f2a44;
  color:white;
  outline:none;
}

.currency-select option{
  font-size:16px;
}

.currency-row{
display:flex;
align-items:center;
gap:10px;
}


.swap-btn{
background:var(--accent-color);
border:none;
color:#fc7146;
font-size:18px;
padding:10px 14px;
border-radius:10px;
cursor:pointer;
transition:0.3s;
}

.swap-btn:hover{
transform:rotate(180deg) scale(1.1);
}

#display{
text-align:right;
font-family:Orbitron;
letter-spacing:2px;
}

.INR-Flag {
    width: 20px;;
}

.currency-select {
    /* This ensures flags render correctly across systems */
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', 'Segoe UI', sans-serif;
}
