:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #f3f4f6;
    --secondary-hover: #e5e7eb;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --bg-color: #f9fafb;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --danger-color: #ef4444;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    padding: 2rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header {
    text-align: center;
    margin-bottom: 1rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-muted);
}

main {
    display: grid;
    grid-template-columns: 1fr 2fr;
    /* Settings take 1/3 width */
    gap: 2rem;
    align-items: start;
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }

    .chart-section {
        position: static;
    }
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid #cbd5e1;
    /* slate-300 - darker border */
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0;
    /* Remove bottom margin as it's now in card-header */
    color: var(--text-color);
}

.collapsible-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin-bottom: 1rem;
}

.toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    color: var(--text-muted);
}

.toggle-icon.collapsed {
    transform: rotate(-90deg);
}

.card-content {
    transition: all 0.3s ease;
}

.card-content.collapsed {
    display: none;
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #94a3b8;
    /* slate-400 - visible border */
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.periods-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.9rem;
}

.btn.primary {
    background-color: var(--primary-color);
    color: white;
    width: 100%;
}

.btn.primary:hover {
    background-color: var(--primary-hover);
}

.btn.secondary {
    background-color: var(--secondary-color);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border: 1px solid #d1d5db;
    /* Add border to secondary button */
}

.btn.secondary:hover {
    background-color: var(--secondary-hover);
}

.period-item {
    background: var(--bg-color);
    border: 1px solid #cbd5e1;
    /* slate-300 - darker border */
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.period-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.period-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
}

.remove-period-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0 0.5rem;
    line-height: 1;
}


.period-inputs .input-group,
.initial-settings .input-group,
.pension-settings .input-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.period-inputs .input-group label,
.initial-settings .input-group label,
.pension-settings .input-group label {
    margin-bottom: 0;
    margin-right: 1rem;
    font-size: 0.85rem;
}

.period-inputs .input-group input,
.initial-settings .input-group input,
.pension-settings .input-group input {
    width: 100px;
    padding: 0.5rem;
    font-size: 0.9rem;
}

/* Usage Instructions */
.usage-instructions {
    background-color: #eff6ff;
    /* blue-50 */
    border-left: 4px solid #60a5fa;
    /* blue-400 */
    padding: 1rem;
    margin-bottom: 2rem;
    border-radius: 0.375rem;
}

.usage-instructions h3 {
    color: #1e40af;
    /* blue-800 */
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.usage-instructions ol {
    list-style-type: decimal;
    list-style-position: inside;
    color: #1d4ed8;
    /* blue-700 */
    font-size: 0.875rem;
}

.usage-instructions li {
    margin-bottom: 0.25rem;
}

.usage-instructions strong {
    font-weight: 600;
}