@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(15, 23, 42, 0.6);
    --accent: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    overflow-x: hidden;
}

.container {
    max-width: 500px;
    /* Adjusted for better fluidity */
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    margin: 0 auto;
}

/* Fluid transition for larger screens */
@media (min-width: 992px) {
    .container {
        max-width: 1000px;
        display: grid;
        grid-template-columns: 1.1fr 0.9fr;
        align-items: start;
        gap: 2rem;
    }
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

@media (min-width: 850px) {
    .card {
        padding: 2.5rem;
    }
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (min-width: 850px) {
    h1 {
        font-size: 2rem;
    }
}

p.subtitle {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.input-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper span {
    position: absolute;
    left: 0.8rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

input,
select {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.65rem 0.8rem;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

.has-prefix input {
    padding-left: 2.3rem;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.results-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(16, 185, 129, 0.15) 100%);
    position: relative;
    overflow: hidden;
}

@media (min-width: 850px) {
    .results-card {
        position: sticky;
        top: 2rem;
    }
}

.result-item {
    margin-bottom: 1.5rem;
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.result-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
}

.small-value {
    font-size: 1.3rem;
}

@media (min-width: 850px) {
    .result-value {
        font-size: 2.4rem;
    }

    .small-value {
        font-size: 1.6rem;
    }
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent);
    margin-bottom: 1rem;
}

/* Toggle & Collapsible */
.toggle-container {
    margin-bottom: 1rem;
}

.toggle-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.toggle-btn .chevron {
    font-style: normal;
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.toggle-btn.active .chevron {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, opacity 0.3s ease;
    opacity: 0;
}

.collapsible-content.show {
    max-height: 500px;
    /* Large enough for content */
    opacity: 1;
    margin-bottom: 1.5rem;
}

.footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}