/* Illinois Campaign Finance Tracker - Stylesheet */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
}

a {
    color: #0066cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Navigation */
.navbar {
    background-color: #1a365d;
    color: white;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-brand a {
    color: white;
    font-size: 1.25rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-links a {
    color: #e2e8f0;
}

.nav-links a:hover {
    color: white;
}

.nav-search {
    margin-left: auto;
}

.nav-search form {
    display: flex;
    gap: 0.5rem;
}

.nav-search input {
    padding: 0.375rem 0.75rem;
    border: none;
    border-radius: 4px;
    width: 200px;
}

.nav-search button {
    padding: 0.375rem 0.75rem;
    background-color: #2c5282;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.nav-search button:hover {
    background-color: #2b6cb0;
}

/* Main container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    min-height: calc(100vh - 120px);
}

/* Footer */
.footer {
    background-color: #2d3748;
    color: #a0aec0;
    text-align: center;
    padding: 1rem;
    font-size: 0.875rem;
}

/* Flash messages */
.flash-messages {
    margin-bottom: 1rem;
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.flash-success {
    background-color: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.flash-error {
    background-color: #fed7d7;
    color: #822727;
    border: 1px solid #fc8181;
}

/* Headings */
h1 {
    font-size: 1.75rem;
    color: #1a365d;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.25rem;
    color: #2d3748;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.subtitle {
    color: #718096;
    margin-bottom: 1rem;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    font-size: 0.875rem;
    color: #718096;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: bold;
    color: #1a365d;
}

.stat-detail {
    font-size: 0.875rem;
    color: #718096;
    margin-top: 0.25rem;
}

/* Two column layout */
.two-column {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.column {
    background: white;
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.column h2 {
    margin-top: 0;
}

/* Data tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.column .data-table {
    box-shadow: none;
}

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

.data-table th {
    background-color: #f7fafc;
    font-weight: 600;
    color: #4a5568;
}

.data-table th a {
    color: inherit;
    text-decoration: none;
    display: inline-block;
    width: 100%;
}

.data-table th a:hover {
    text-decoration: underline;
}

.data-table tr:hover {
    background-color: #f7fafc;
}

.data-table small {
    color: #718096;
}

/* Info tables (key-value) */
.info-table {
    width: auto;
    margin-bottom: 1rem;
}

.info-table th {
    text-align: right;
    padding-right: 1rem;
    white-space: nowrap;
    font-weight: 600;
    color: #4a5568;
}

.info-table td {
    padding: 0.5rem 0;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    text-transform: lowercase;
}

.badge-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-in_progress {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-scraped,
.badge-completed {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-skipped {
    background-color: #e5e7eb;
    color: #374151;
}

.badge-error {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-paper {
    background-color: #fef3c7;
    color: #92400e;
}

.status-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.status-section {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.status-section h2 {
    margin-top: 0;
}

.federal-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.federal-subnav-link {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #334155;
    background: #f8fafc;
    font-size: 0.85rem;
}

.federal-subnav-link:hover {
    background: #eef2ff;
    text-decoration: none;
}

.federal-subnav-link.active {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #ffffff;
}

.analytics-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.analytics-subnav-link {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #334155;
    background: #f8fafc;
    font-size: 0.85rem;
}

.analytics-subnav-link:hover {
    background: #ecfeff;
    text-decoration: none;
}

.analytics-subnav-link.active {
    background: #0f766e;
    border-color: #0f766e;
    color: #ffffff;
}

.analytics-form {
    flex-wrap: wrap;
    align-items: flex-end;
}

.analytics-form label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: #334155;
    font-weight: 600;
}

.analytics-form input,
.analytics-form select {
    flex: 0 0 auto;
    min-width: 120px;
}

.analytics-inline-form {
    margin-bottom: 0;
}

/* Analytics network graph */
.network-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.network-controls label {
    font-weight: 600;
    color: #334155;
}

.chord-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.chord-controls label {
    font-weight: 600;
    color: #334155;
}

.network-controls select,
.network-controls button,
.chord-controls select,
.chord-controls button {
    padding: 0.35rem 0.55rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
}

.network-controls button {
    background: #0f766e;
    color: #fff;
    border-color: #0f766e;
    cursor: pointer;
}

.network-controls button:hover {
    background: #115e59;
}

.chord-controls button {
    background: #1d4ed8;
    color: #fff;
    border-color: #1d4ed8;
    cursor: pointer;
}

.chord-controls button:hover {
    background: #1e40af;
}

.network-svg-wrap {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
    overflow-x: auto;
}

#network-svg {
    width: 100%;
    min-width: 760px;
    height: 520px;
    display: block;
}

.network-chord-block {
    margin: 1rem 0;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.network-chord-block h3 {
    margin-bottom: 0.5rem;
}

#chord-svg {
    width: 100%;
    min-width: 760px;
    height: 560px;
    display: block;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1rem;
}

.page-info {
    color: #718096;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background-color: #3182ce;
    color: white;
}

.btn-primary:hover {
    background-color: #2c5282;
}

.btn-success {
    background-color: #38a169;
    color: white;
}

.btn-success:hover {
    background-color: #2f855a;
}

.btn-danger {
    background-color: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background-color: #c53030;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

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

.form-group label {
    display: block;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 0.25rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.875rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

/* Search form */
.search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.search-form input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
}

.search-form select {
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
}

.graph-controls {
    align-items: flex-end;
    gap: 0.75rem;
}

.graph-controls label {
    color: #334155;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.search-results section {
    margin-bottom: 2rem;
}

.no-results {
    color: #718096;
    font-style: italic;
}

/* Filter and sort controls */
.filter-controls,
.sort-controls {
    margin-bottom: 1rem;
    color: #718096;
}

.filter-controls a,
.sort-controls a {
    color: #4a5568;
}

.filter-controls a.active,
.sort-controls a.active {
    color: #3182ce;
    font-weight: 600;
}

/* Summaries */
.committee-summary,
.donor-summary,
.report-summary {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.total-amount {
    font-size: 1.125rem;
    margin-top: 1rem;
}

.error-text {
    color: #c53030;
}

.source-link {
    margin-top: 1rem;
    font-size: 0.875rem;
}

/* Manual entry form */
.entry-form {
    background: white;
    padding: 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.entry-form h2 {
    margin-top: 0;
}

.report-info {
    background: white;
    padding: 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.report-info h2 {
    margin-top: 0;
}

.contributions-list {
    background: white;
    padding: 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.contributions-list h2 {
    margin-top: 0;
}

.complete-section {
    margin-top: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
    }

    .nav-links {
        order: 3;
        width: 100%;
        margin-top: 0.75rem;
        flex-wrap: wrap;
    }

    .nav-search {
        margin-left: 0;
    }

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

    .data-table {
        font-size: 0.875rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
}
