:root {
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --accent: #8b5cf6;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --input-bg: rgba(15, 23, 42, 0.6);
    --success: #10b981;
}

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

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

/* Background Effects */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: float 10s ease-in-out infinite alternate;
}

.glow-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.4) 0%, rgba(0, 0, 0, 0) 70%);
    top: -100px;
    left: -100px;
}

.glow-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, rgba(0, 0, 0, 0) 70%);
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 50px) scale(1.1); }
}

/* Container & Header */
.container {
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    z-index: 1;
}

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

header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Card */
.calculator-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.half {
    flex: 1;
}

label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.currency {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}

input, select {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 0.875rem 1rem;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    outline: none;
}

input:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.input-wrapper input {
    padding-left: 2.8rem;
}

select {
    appearance: none;
    cursor: pointer;
}

.select-wrapper::after {
    content: "▼";
    font-size: 0.8rem;
    position: absolute;
    right: 1rem;
    color: var(--text-muted);
    pointer-events: none;
}

/* Buttons */
button {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-calculate {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    margin-top: 1rem;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

.btn-calculate:active {
    transform: translateY(0);
}

.btn-calculate svg {
    transition: transform 0.3s ease;
}

.btn-calculate:hover svg {
    transform: translateX(4px);
}

.btn-reset {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    margin-top: 1.5rem;
}

.btn-reset:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Results Section */
.result-section {
    margin-top: 2rem;
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.result-section.hidden {
    display: none;
}

.result-section h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

.result-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.result-item:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

.result-item .label {
    color: var(--text-muted);
}

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

.result-item.highlight .value {
    color: var(--success);
    font-size: 1.4rem;
    font-weight: 700;
}

.formula-details {
    margin-top: 1rem;
    background: rgba(15, 23, 42, 0.5);
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.formula-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.formula-row:last-child {
    margin-bottom: 0;
}

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

/* Info Box */
.info-box {
    margin-top: 2rem;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.info-box h3 {
    color: var(--text-main);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.info-box p {
    margin-bottom: 0.75rem;
}

.info-box strong {
    color: var(--text-main);
}

.info-box ul {
    margin-left: 1.5rem;
    margin-bottom: 0;
}

.info-box li {
    margin-bottom: 0.5rem;
}

.info-box li:last-child {
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 480px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .form-group.half {
        margin-bottom: 1.5rem;
    }
    .container {
        padding: 1rem;
    }
    header h1 {
        font-size: 1.8rem;
    }
}
