/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a4d7a;
    --secondary-color: #2e7daf;
    --accent-color: #e67e22;
    --text-dark: #2c3e50;
    --text-light: #555;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #dee2e6;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --error-color: #e74c3c;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.85;
    color: rgba(255, 255, 255, 0.85);
    font-style: italic;
    margin-bottom: 1.5rem;
}

nav {
    margin-top: 1rem;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s;
    font-family: 'Arial', sans-serif;
}

nav a:hover {
    background: rgba(255,255,255,0.2);
}

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

section {
    background: var(--bg-white);
    margin: 2rem 0;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: 0.5rem;
}

h3 {
    color: var(--secondary-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

h4 {
    color: var(--text-dark);
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 2rem;
}

.hero-content h2 {
    border: none;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.hero-content > p {
    font-size: 1.15rem;
    max-width: 800px;
    margin: 0 auto 2rem;
    color: var(--text-light);
}

.key-findings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.finding {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.finding .number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent-color);
    font-family: 'Arial', sans-serif;
}

.finding .label {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* Calculator Section */
.calculator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

.input-panel,
.results-panel {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-family: 'Arial', sans-serif;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-family: 'Arial', sans-serif;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(46, 125, 175, 0.1);
}

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

.form-group .unit {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-left: 0.5rem;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    font-weight: 600;
    transition: background 0.3s, transform 0.1s;
    font-family: 'Arial', sans-serif;
}

.btn-primary:hover {
    background: #d35400;
    transform: translateY(-2px);
}

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

/* Results Panel */
.results-panel h3 {
    margin-top: 0;
}

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

.result-item {
    padding: 1rem;
    margin-bottom: 1rem;
    background: white;
    border-left: 4px solid var(--secondary-color);
    border-radius: 4px;
}

.result-item h4 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
}

.result-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--accent-color);
    font-family: 'Arial', sans-serif;
}

.result-label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.state-distribution {
    margin-top: 1rem;
}

.state-bar {
    margin-bottom: 0.75rem;
}

.state-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.progress-bar {
    height: 20px;
    background: var(--bg-light);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    transition: width 0.5s;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.comparison-table th,
.comparison-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--primary-color);
}

.comparison-table tr:hover {
    background: var(--bg-light);
}

.savings-highlight {
    color: var(--success-color);
    font-weight: bold;
}

/* Theorem Box */
.theorem-box {
    background: #f0f7ff;
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.theorem-box h4 {
    color: var(--primary-color);
    margin-top: 0;
}

.equation {
    text-align: center;
    font-size: 1.2rem;
    font-family: 'Georgia', serif;
    font-style: italic;
    margin: 1rem 0;
    color: var(--text-dark);
}

/* Method Grid */
.method-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.method-card {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.method-card h3 {
    margin-top: 0;
    color: var(--secondary-color);
}

.method-card ul {
    margin-left: 1.5rem;
}

.method-card li {
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

/* Validation Box */
.validation-box {
    background: #f0fff4;
    border: 2px solid var(--success-color);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 6px;
}

.validation-box h3 {
    color: var(--success-color);
    margin-top: 0;
}

.validation-box p {
    margin-bottom: 0.5rem;
}

/* Citation Section */
.citation-box {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 6px;
    margin-top: 1rem;
}

.citation-box h3 {
    margin-top: 1.5rem;
}

.citation-box h3:first-child {
    margin-top: 0;
}

.citation-box pre {
    background: white;
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.5;
    font-family: 'Courier New', monospace;
}

/* Authors Section */
.authors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.author-card {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.author-card h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.author-card p {
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

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

footer p {
    margin-bottom: 0.5rem;
    color: rgba(255,255,255,0.8);
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .calculator-container {
        grid-template-columns: 1fr;
    }

    .key-findings {
        grid-template-columns: 1fr;
    }

    .method-grid {
        grid-template-columns: 1fr;
    }

    .authors-grid {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    nav {
        flex-direction: column;
        gap: 0.5rem;
    }

    section {
        padding: 1.5rem;
    }

    h2 {
        font-size: 1.5rem;
    }
}

/* Print Styles */
@media print {
    header,
    nav,
    footer {
        display: none;
    }

    section {
        page-break-inside: avoid;
        box-shadow: none;
    }
}
