/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c5282;
    --primary-dark: #1a365d;
    --primary-light: #4299e1;
    --success-color: #38a169;
    --warning-color: #dd6b20;
    --danger-color: #c53030;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-light: #718096;
    --bg-white: #ffffff;
    --bg-gray: #f7fafc;
    --bg-light: #edf2f7;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --max-width: 1200px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-gray);
}

/* Container */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: var(--shadow-md);
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main content */
main {
    padding: 2rem 0 3rem 0;
}

section {
    margin-bottom: 3rem;
}

/* Intro section */
.intro {
    margin-top: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.intro p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
}

/* Calculator section */
.calculator-section {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 3rem;
}

.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 968px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }
}

/* Input panel */
.input-panel h3,
.results-panel h3 {
    font-size: 1.5rem;
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-light);
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.input-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.input-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-light);
    font-size: 0.875rem;
}

.calculate-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

/* Results panel */
.results-panel {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.results-content {
    font-size: 1rem;
}

.placeholder-text {
    color: var(--text-light);
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

.result-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

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

.result-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.result-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.result-value.success {
    color: var(--success-color);
}

.result-value.warning {
    color: var(--warning-color);
}

.result-value.danger {
    color: var(--danger-color);
}

.result-description {
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.status-badge.on-track {
    background: #c6f6d5;
    color: #22543d;
}

.status-badge.behind {
    background: #fed7d7;
    color: #742a2a;
}

.status-badge.ahead {
    background: #bee3f8;
    color: #2c5282;
}

/* Chart section */
.chart-section {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.chart-section h3 {
    font-size: 1.5rem;
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
}

.chart-container {
    position: relative;
    height: 400px;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .chart-container {
        height: 300px;
    }
}

/* Info section */
.info-section {
    margin-top: 3rem;
}

.info-section h2 {
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: 2rem;
    text-align: center;
}

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

.info-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.info-card h3 {
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.info-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* FAQ section */
.faq-section {
    max-width: 900px;
    margin: 3rem auto;
}

.faq-section h2 {
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: 2rem;
    text-align: center;
}

.faq-item {
    background: var(--bg-white);
    margin-bottom: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.faq-item summary {
    padding: 1.25rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--primary-dark);
    list-style: none;
    transition: background-color 0.3s ease;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::before {
    content: '+';
    display: inline-block;
    width: 1.5rem;
    margin-right: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-light);
}

.faq-item[open] summary::before {
    content: '−';
}

.faq-item summary:hover {
    background-color: var(--bg-light);
}

.faq-item p {
    padding: 0 1.25rem 1.25rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Footer */
footer {
    background: var(--text-primary);
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

footer p {
    margin-bottom: 0.5rem;
}

.disclaimer {
    font-size: 0.875rem;
    opacity: 0.8;
    max-width: 800px;
    margin: 1rem auto 0;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}
