* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --secondary: #10B981;
    --background: #F9FAFB;
    --surface: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --border: #E5E7EB;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    font-weight: 700;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

main {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
}

.input-section {
    margin-bottom: 24px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.currency {
    position: absolute;
    left: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    pointer-events: none;
}

input[type="text"] {
    width: 100%;
    padding: 14px 16px 14px 45px;
    font-size: 1.125rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    transition: all 0.2s;
    font-family: inherit;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    width: 100%;
    padding: 12px;
    background: var(--background);
    color: var(--text-primary);
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 24px;
}

.btn-secondary:hover {
    background: white;
    border-color: var(--primary);
    color: var(--primary);
}

.results {
    animation: fadeIn 0.3s ease-in;
}

.results.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.total-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    color: white;
}

.total-display .label {
    font-size: 0.95rem;
    opacity: 0.9;
}

.total-display .amount {
    font-size: 1.5rem;
    font-weight: 700;
}

.allocation-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.allocation-item {
    background: var(--background);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.allocation-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.allocation-header {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.allocation-info h3 {
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.allocation-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.allocation-amount {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.percentage {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
}

.value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--secondary);
}

footer {
    text-align: center;
    margin-top: 24px;
    color: white;
    opacity: 0.9;
}

@media (max-width: 640px) {
    header h1 {
        font-size: 1.5rem;
    }

    .total-display {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* PWA Install Button */
.install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 1000;
}

.install-prompt.show {
    display: flex;
}

.install-prompt button {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}
