:root {
    --primary-gradient: linear-gradient(135deg, #6366f1, #a855f7);
    --bg-dark: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --positive: #22c55e;
    --negative: #ef4444;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Background Blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(100px);
    border-radius: 50%;
    opacity: 0.2;
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: #6366f1;
    top: -100px;
    right: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: #a855f7;
    bottom: -100px;
    left: -100px;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: #ec4899;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* App Layout */
.app-container {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.year-badge {
    font-size: 0.9rem;
    background: var(--primary-gradient);
    -webkit-text-fill-color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    vertical-align: middle;
}

header p {
    color: var(--text-muted);
}

/* Calculator Card */
.calculator-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.label-with-input {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    min-height: 32px; /* Standardize height to match the percentage input */
}

.label-with-input label {
    margin-bottom: 0 !important;
}

.percent-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.2rem 0.5rem;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.percent-input-wrapper input {
    background: transparent;
    border: none;
    color: white;
    width: 35px;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
}

.percent-input-wrapper input:focus {
    outline: none;
}


.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.25rem;
    color: white;
    font-size: 1.25rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.currency {
    position: absolute;
    right: 1.25rem;
    font-weight: 600;
    color: var(--text-muted);
}

.divider {
    height: 1px;
    background: var(--glass-border);
    margin: 2rem 0;
}

/* Results Section */
.results-section h3 {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.result-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-item .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.result-item .value {
    font-size: 1.25rem;
    font-weight: 600;
}

.result-item.highlight .value {
    color: var(--positive);
}

.positive { color: var(--positive); }
.negative { color: var(--negative); }

/* Summary Section */
.summary-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px dashed var(--glass-border);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-item .label {
    font-size: 1rem;
    font-weight: 600;
}

.summary-item .value {
    font-size: 1.5rem;
    font-weight: 700;
}

footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Micro-animations */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

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

.calculator-card {
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 600px) {
    .app-container { padding: 1rem; }
    .calculator-card { padding: 1.5rem; }
    header h1 { font-size: 1.8rem; }
}
