/* Main CSS - Loaded async for below-the-fold content */

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; margin-top: 2rem; }
h3 { font-size: 1.5rem; margin-top: 1.5rem; }
h4 { font-size: 1.25rem; margin-top: 1rem; }

p { margin-bottom: 1rem; }

a {
    color: #0066cc;
    transition: color 0.2s;
}

a:hover { color: #004080; }

/* Layout */
.section {
    padding: 2rem 1rem;
}

.section-alt {
    background: #f8f9fa;
}

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

.card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    transition: box-shadow 0.3s, transform 0.3s;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.card h3 {
    color: #003366;
    margin-top: 0;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: #fff;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

th {
    background: #003366;
    color: #fff;
    font-weight: 600;
}

tr:hover {
    background: #f8f9fa;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #1a1a1a;
}

input, select, textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0,102,204,0.1);
}

/* Lists */
ul, ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

.checklist {
    list-style: none;
    margin-left: 0;
}

.checklist li {
    padding-left: 1.75rem;
    position: relative;
}

.checklist li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: 700;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* Comparison Table */
.comparison-table {
    overflow-x: auto;
}

.comparison-table th {
    min-width: 150px;
}

/* Breadcrumbs */
.breadcrumb {
    padding: 1rem 0;
    font-size: 0.875rem;
}

.breadcrumb a {
    color: #666;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #0066cc;
}

.breadcrumb span {
    margin: 0 0.5rem;
    color: #999;
}

/* Footer */
.footer {
    background: #1a1a1a;
    color: #fff;
    padding: 3rem 1rem 1rem;
}

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

.footer h4 {
    color: #fff;
    margin-bottom: 1rem;
}

.footer ul {
    list-style: none;
    margin: 0;
}

.footer ul li {
    margin-bottom: 0.5rem;
}

.footer a {
    color: #ccc;
    text-decoration: none;
}

.footer a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: #999;
}

/* Calculator Styles */
.calculator {
    background: #fff;
    border: 2px solid #0066cc;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.calculator-result {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.125rem;
    display: none;
}

.calculator-result.show {
    display: block;
}

/* State Grid */
.state-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.state-link {
    display: block;
    padding: 1rem;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    text-align: center;
    text-decoration: none;
    color: #003366;
    font-weight: 500;
    transition: all 0.3s;
}

.state-link:hover {
    background: #0066cc;
    color: #fff;
    border-color: #0066cc;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Glossary */
.glossary {
    margin: 2rem 0;
}

.glossary-term {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.glossary-term:last-child {
    border-bottom: none;
}

.glossary-term h3 {
    color: #003366;
    margin-bottom: 0.5rem;
}

.glossary-nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    position: sticky;
    top: 70px;
    background: #fff;
    padding: 1rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.glossary-nav a {
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    border-radius: 4px;
    text-decoration: none;
    color: #003366;
    font-weight: 600;
}

.glossary-nav a:hover {
    background: #0066cc;
    color: #fff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

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

    .hero {
        padding: 2rem 1rem;
    }

    .section {
        padding: 2rem 1rem;
    }

    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: 0.5rem;
    }
}

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

    body {
        font-size: 12pt;
        color: #000;
    }

    a {
        color: #000;
        text-decoration: underline;
    }
}

/* Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Performance: GPU acceleration for animations */
.card, .btn, .state-link {
    will-change: transform;
    backface-visibility: hidden;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0066cc;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
