/* PlainBill - Dark Theme, Mobile-First */

:root {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d27;
    --bg-card: #21242f;
    --bg-hover: #2a2e3b;
    --text-primary: #e8eaed;
    --text-secondary: #9aa0a6;
    --text-muted: #6b7280;
    --accent: #6c9fff;
    --accent-hover: #5a8de6;
    --green: #34d399;
    --red: #f87171;
    --yellow: #fbbf24;
    --border: #2d3140;
    --tx-badge: #c2410c;
    --fed-badge: #1d4ed8;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: "SF Mono", "Fira Code", monospace;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

/* Navbar */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent) !important;
    text-decoration: none !important;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 1.25rem;
    flex: 1;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text-primary);
    text-decoration: none;
}

.location-badge {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius);
}

.location-badge .change-loc {
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Main */
main {
    flex: 1;
    padding: 2rem 1rem;
}

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

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-sub {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto 2rem;
}

.zip-form-container {
    max-width: 400px;
    margin: 0 auto;
}

.zip-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.zip-input-group {
    display: flex;
    gap: 0.5rem;
}

.zip-input-group input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1.1rem;
    text-align: center;
    letter-spacing: 2px;
}

.zip-input-group input::placeholder {
    color: var(--text-muted);
    letter-spacing: normal;
}

/* Buttons */
button, .btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}

button:hover, .btn:hover {
    background: var(--accent-hover);
    text-decoration: none;
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn-outline:hover {
    background: var(--accent);
    color: #fff;
}

/* Feature Grid */
.features { padding: 2rem 0; }

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

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Stats */
.stats { padding: 2rem 0; text-align: center; }

.stats-grid {
    display: flex;
    justify-content: center;
    gap: 3rem;
}

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

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

/* Page Header */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}

.subtext {
    color: var(--text-secondary);
}

/* Filters */
.filters-bar {
    margin-bottom: 1.5rem;
}

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

.search-form input, .search-form select {
    padding: 0.6rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.search-form input { flex: 1; min-width: 200px; }
.search-form select { min-width: 140px; }

/* Bill Cards */
.bill-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bill-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: border-color 0.2s;
}

.bill-card:hover {
    border-color: var(--accent);
}

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

.bill-id {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.bill-id.tx { background: var(--tx-badge); color: #fff; }
.bill-id.fed { background: var(--fed-badge); color: #fff; }

.bill-jurisdiction {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.bill-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: auto;
}

.bill-card h2 {
    font-size: 1.1rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.bill-card h2 a {
    color: var(--text-primary);
}

.bill-card h2 a:hover {
    color: var(--accent);
}

.bill-summary-preview {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.bill-status {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

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

.page-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Bill Detail */
.bill-detail { max-width: 800px; }

.breadcrumb {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.bill-detail-header {
    margin-bottom: 2rem;
}

.bill-detail-header h1 {
    font-size: 1.6rem;
    margin: 0.75rem 0;
}

.bill-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.sponsors {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.sponsor.primary { font-weight: 600; color: var(--text-primary); }

.bill-current-status {
    margin: 0.75rem 0;
    color: var(--text-secondary);
}

/* Summary */
.plain-summary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.plain-summary h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.summary-content {
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.summary-section {
    margin: 1.25rem 0;
}

.summary-section h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

.key-points li {
    margin: 0.4rem 0 0.4rem 1.25rem;
    color: var(--text-secondary);
}

.arguments-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin: 1.25rem 0;
}

.arguments-for h3 { color: var(--green); }
.arguments-against h3 { color: var(--red); }

.arguments-for li, .arguments-against li {
    margin: 0.4rem 0 0.4rem 1.25rem;
    color: var(--text-secondary);
}

.ai-notice {
    margin-top: 1.5rem;
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: var(--radius);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.no-summary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Topics */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.topic-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: border-color 0.2s, transform 0.2s;
    color: var(--text-primary);
}

.topic-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    text-decoration: none;
    color: var(--text-primary);
}

.topic-card h3 {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.topic-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.topic-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.topic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.topic-tag {
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--accent);
}

.topic-tag:hover {
    background: var(--accent);
    color: #fff;
    text-decoration: none;
}

/* Representatives */
.rep-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.rep-card {
    display: flex;
    gap: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.rep-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.rep-photo-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    flex-shrink: 0;
}

.rep-photo-placeholder.large {
    width: 120px;
    height: 120px;
    font-size: 3rem;
}

.rep-info h3 { margin-bottom: 0.25rem; }
.rep-info h3 a { color: var(--text-primary); }

.rep-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}

.party {
    font-size: 0.8rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.party-d { background: #1e40af; color: #fff; }
.party-r { background: #991b1b; color: #fff; }
.party-i { background: #6b7280; color: #fff; }

.chamber, .jurisdiction, .district {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.rep-contact {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.contact-link {
    font-size: 0.85rem;
}

/* Rep Detail */
.rep-detail-header {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.rep-detail-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.contact-item {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.social-links {
    display: flex;
    gap: 0.75rem;
}

.social-link {
    text-transform: capitalize;
}

/* Votes */
.votes-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
}

.votes-table th, .votes-table td {
    padding: 0.6rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.votes-table th {
    color: var(--text-muted);
    font-weight: 600;
}

.vote-badge {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.vote-yea { background: rgba(52,211,153,0.2); color: var(--green); }
.vote-nay { background: rgba(248,113,113,0.2); color: var(--red); }
.vote-abstain, .vote-not_voting { background: rgba(107,114,128,0.2); color: var(--text-muted); }

.votes-list { margin-top: 0.75rem; }

.vote-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.vote-bill { flex: 1; font-size: 0.9rem; }
.vote-date { font-size: 0.8rem; color: var(--text-muted); }

/* Bill Actions */
.action-list {
    list-style: none;
    margin-top: 0.75rem;
}

.action-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
}

.action-date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 90px;
}

.action-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Draft / Workshop */
.draft-page { max-width: 800px; }

.step-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 1.5rem 0 2rem;
    flex-wrap: wrap;
}

.step-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.step-dot.active .step-num {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.step-dot.completed .step-num {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

.step-title {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    max-width: 80px;
}

.step-line {
    width: 40px;
    height: 2px;
    background: var(--border);
    margin: 0 0.25rem;
    align-self: flex-start;
    margin-top: 15px;
}

.step-line.completed { background: var(--green); }

.step-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.step-content h2 {
    margin-bottom: 0.25rem;
}

.step-subtitle {
    color: var(--accent);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.step-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-sans);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group input::placeholder, .form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.draft-form button {
    margin-top: 0.5rem;
}

/* AI Feedback */
.ai-feedback {
    background: var(--bg-primary);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.ai-feedback h3 {
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.ai-text {
    line-height: 1.8;
    white-space: pre-wrap;
}

.jurisdiction-result p {
    margin: 0.5rem 0;
}

.draft-section-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.citizen-side h4 { color: var(--yellow); }
.formatted-side h4 { color: var(--green); }

.explanation {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.message-template {
    margin: 1rem 0;
}

.message-text {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--radius);
    white-space: pre-wrap;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

.share-link input {
    width: 100%;
    padding: 0.6rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--accent);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.next-steps ol {
    margin: 0.5rem 0 0 1.25rem;
    color: var(--text-secondary);
}

.next-steps li { margin: 0.3rem 0; }

/* Draft View (shared) */
.draft-view { max-width: 800px; }

.formatted-draft-view {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.journey-step {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-card);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.journey-step h3 {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.draft-cta {
    text-align: center;
    margin: 2rem 0;
}

/* About */
.about-page section {
    margin: 1.5rem 0;
}

.about-page h2 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

.about-page p, .about-page li {
    color: var(--text-secondary);
    line-height: 1.7;
}

.about-page ul, .about-page ol {
    margin: 0.5rem 0 0.5rem 1.25rem;
}

.about-page li { margin: 0.3rem 0; }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state h2 {
    margin-bottom: 0.75rem;
}

.empty-state p {
    color: var(--text-secondary);
}

.empty-state .zip-form.inline {
    display: inline-flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Error */
.error {
    background: rgba(248,113,113,0.1);
    border: 1px solid var(--red);
    border-radius: var(--radius);
    padding: 0.75rem;
    color: var(--red);
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    text-align: center;
    margin-top: auto;
}

.footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0.25rem 0;
}

/* Mobile */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-toggle { display: block; }
    .nav-links.active {
        display: flex;
        flex-direction: column;
        width: 100%;
        order: 3;
        gap: 0.5rem;
        padding: 0.5rem 0;
    }

    .hero h1 { font-size: 1.8rem; }
    .hero-sub { font-size: 1rem; }

    .arguments-grid { grid-template-columns: 1fr; }
    .draft-section-compare { grid-template-columns: 1fr; }

    .rep-detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .stats-grid { gap: 1.5rem; }
    .stat-number { font-size: 2rem; }

    .bill-header { flex-wrap: wrap; }
    .bill-date { margin-left: 0; }
}

@media (max-width: 480px) {
    .search-form {
        flex-direction: column;
    }

    .search-form input, .search-form select {
        min-width: auto;
        width: 100%;
    }

    .step-title { display: none; }
    .step-line { width: 20px; }
}
