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

:root {
    /* Color Palette */
    --primary-color: #2ecc71;
    --primary-dark: #27ae60;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --background: #f8f9fa;
    --surface: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #e1e8ed;
    --success: #27ae60;
    --warning: #f39c12;
    --info: #3498db;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Courier New', monospace;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.1);
}

body {
    font-family: var(--font-primary);
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

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

.header-title-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.header-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 8px;
}

.header-text {
    flex: 1;
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: var(--spacing-md);
}

.header-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-md);
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.last-updated {
    font-size: 0.9rem;
    opacity: 0.9;
}

.btn-primary {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-md);
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Main Content */
main {
    padding: var(--spacing-xl) 0;
}

section {
    margin-bottom: var(--spacing-xl);
}

.intro {
    background-color: var(--surface);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.intro h2 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
    font-size: 1.8rem;
}

.intro p {
    color: var(--text-secondary);
    line-height: 1.8;
}

.intro a {
    color: var(--secondary-color);
    font-weight: 600;
    text-decoration: none;
}

.intro a:hover {
    text-decoration: underline;
}

/* Filters */
.filters {
    background-color: var(--surface);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.filters h3 {
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.filter-controls {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--spacing-sm);
}

#searchInput,
select {
    padding: var(--spacing-sm);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: var(--font-primary);
    transition: border-color 0.3s ease;
}

#searchInput:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.stat-card {
    background-color: var(--surface);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.stat-card h4 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--spacing-xs);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Bills List */
.bills-list h3 {
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

#billsContainer {
    display: grid;
    gap: var(--spacing-md);
}

.bill-card {
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

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

.bill-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: var(--spacing-md);
    gap: var(--spacing-md);
}

.bill-title {
    flex: 1;
}

.bill-meta-top {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    flex-wrap: wrap;
}

.state-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
}

.state-badge-federal {
    background-color: #e3f2fd;
    color: #1565c0;
}

.state-badge-state {
    background-color: #f3e5f5;
    color: #6a1b9a;
}

.bill-number {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-weight: 600;
}

.bill-title h4 {
    color: var(--text-primary);
    font-size: 1.3rem;
    margin-top: var(--spacing-xs);
    line-height: 1.4;
}

.bill-status {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-introduced {
    background-color: #e3f2fd;
    color: #1976d2;
}

.status-committee {
    background-color: #fff3e0;
    color: #f57c00;
}

.status-passed {
    background-color: #e8f5e9;
    color: #388e3c;
}

.status-enacted {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.bill-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--spacing-md);
}

.bill-meta {
    display: flex;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
}

.bill-meta-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.bill-meta-item strong {
    color: var(--text-primary);
}

.bill-sponsors {
    margin-bottom: var(--spacing-md);
}

.bill-sponsors strong {
    display: block;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.sponsor-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.sponsor-tag {
    display: inline-block;
    padding: 4px 10px;
    background-color: var(--background);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.bill-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.btn-analysis {
    background-color: var(--primary-color);
    color: white;
}

.btn-analysis:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-disabled {
    background-color: var(--border-color);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.btn-disabled:hover {
    transform: none;
}

/* Loading State */
.loading {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-md);
}

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

.no-results {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
    background-color: var(--surface);
    border-radius: var(--radius-lg);
}

/* Footer */
footer {
    background-color: var(--text-primary);
    color: white;
    padding: var(--spacing-lg) 0;
    text-align: center;
    margin-top: var(--spacing-xl);
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    margin: 0 var(--spacing-sm);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .header-content h1 {
        font-size: 1.8rem;
    }
    
    .header-logo {
        width: 60px;
        height: 60px;
    }
    
    .filter-controls {
        grid-template-columns: 1fr;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .bill-header {
        flex-direction: column;
    }
    
    .bill-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}
