:root {
    --primary: #1a5276;
    --primary-light: #2980b9;
    --accent: #e74c3c;
    --bg: #f8f9fa;
    --card-bg: #ffffff;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --border: #dfe6e9;
    --success: #27ae60;
    --warning: #f39c12;
    --radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

/* Navigation */
header {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-brand a {
    color: white;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: bold;
}

.nav-links a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    margin-left: 24px;
    font-size: 0.95rem;
    transition: color 0.2s;
}

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

/* Main content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 140px);
}

/* Hero */
.hero {
    text-align: center;
    padding: 60px 0 40px;
}

.hero h1 { font-size: 2.5rem; margin-bottom: 12px; }
.hero .subtitle { font-size: 1.2rem; color: var(--text-light); margin-bottom: 40px; }

/* Search box */
.search-box {
    max-width: 700px;
    margin: 0 auto 40px;
}

.search-box form {
    display: flex;
    gap: 8px;
}

.search-box input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1.1rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus { border-color: var(--primary-light); }

.search-box button, button[type="submit"] {
    padding: 14px 28px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.search-box button:hover, button[type="submit"]:hover {
    background: var(--primary-light);
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.feature {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s;
}

.feature:hover { transform: translateY(-4px); }
.feature-icon { font-size: 2.5rem; display: block; margin-bottom: 12px; }
.feature h3 { margin-bottom: 8px; color: var(--primary); }
.feature p { color: var(--text-light); font-size: 0.9rem; }

/* Quick ask */
.quick-ask {
    margin-top: 60px;
    padding: 40px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.quick-ask h2 { margin-bottom: 20px; }

textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    outline: none;
    margin-bottom: 12px;
}

textarea:focus { border-color: var(--primary-light); }

/* Answer */
.answer-result {
    margin-top: 24px;
    padding: 24px;
    background: #f0f8ff;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary-light);
}

.answer-text { margin: 12px 0; line-height: 1.8; }

.sources {
    list-style: none;
    margin-top: 12px;
}

.sources li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.source-content {
    margin-top: 8px;
    padding: 12px;
    background: rgba(0,0,0,0.03);
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Stats */
.stats { margin-top: 60px; text-align: center; }
.stats h2 { margin-bottom: 24px; }

.stats-grid {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.stat-card {
    background: var(--card-bg);
    padding: 30px 50px;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

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

.stat-label { color: var(--text-light); }

/* Search results */
.search-results { margin-top: 30px; }
.results-count { color: var(--text-light); margin-bottom: 20px; }

.result-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.result-card h3 a {
    color: var(--primary);
    text-decoration: none;
}

.result-card h3 a:hover { text-decoration: underline; }
.result-meta { font-size: 0.85rem; color: var(--text-light); margin: 8px 0; }
.result-snippet { line-height: 1.7; }
.result-snippet mark { background: #fff3cd; padding: 2px 4px; border-radius: 2px; }

/* Changes */
.changes-list { margin-top: 24px; }

.change-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    border-left: 4px solid var(--border);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.change-card.added { border-left-color: var(--success); }
.change-card.modified { border-left-color: var(--warning); }
.change-card.repealed { border-left-color: var(--accent); }

.change-type { font-weight: bold; margin-bottom: 8px; }
.change-date { font-size: 0.85rem; color: var(--text-light); margin-top: 8px; }

/* Loading & errors */
.loading { color: var(--text-light); font-style: italic; }
.error { color: var(--accent); }
.no-results { text-align: center; padding: 60px 0; color: var(--text-light); }

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 1.8rem; }
    .features { grid-template-columns: 1fr 1fr; }
    .stats-grid { flex-direction: column; align-items: center; }
    nav { flex-direction: column; height: auto; padding: 12px 20px; gap: 8px; }
    .nav-links a { margin-left: 12px; }
}

@media (max-width: 480px) {
    .features { grid-template-columns: 1fr; }
    .search-box form { flex-direction: column; }
}
