/* Helianthus - Kansas Legislative Intelligence System */
:root {
    --primary: #1a5276;
    --primary-light: #2980b9;
    --accent: #f39c12;
    --success: #27ae60;
    --danger: #c0392b;
    --warning: #e67e22;
    --info: #3498db;
    --bg: #f8f9fa;
    --bg-card: #ffffff;
    --text: #2c3e50;
    --text-muted: #7f8c8d;
    --border: #dee2e6;
    --radius: 6px;
}

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

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

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

/* Layout */
.header {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.header h1 { font-size: 1.25rem; font-weight: 600; }
.header h1 a { color: white; }
.header nav { display: flex; gap: 1.5rem; }
.header nav a { color: rgba(255,255,255,0.85); font-size: 0.9rem; }
.header nav a:hover { color: white; text-decoration: none; }
.header .user-info { font-size: 0.85rem; color: rgba(255,255,255,0.7); }

.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }
.content { margin-top: 1rem; }

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.card h2, .card h3 { margin-bottom: 0.75rem; color: var(--primary); }
.card h2 { font-size: 1.1rem; }
.card h3 { font-size: 1rem; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--bg); font-weight: 600; color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; }
tr:hover { background: #f0f4f8; }

/* Badges */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-support { background: #d4edda; color: #155724; }
.badge-oppose { background: #f8d7da; color: #721c24; }
.badge-monitor { background: #fff3cd; color: #856404; }
.badge-amend { background: #d1ecf1; color: #0c5460; }
.badge-pending { background: #e2e3e5; color: #383d41; }
.badge-draft { background: #cce5ff; color: #004085; }
.badge-finalized { background: #d4edda; color: #155724; }
.badge-introduced { background: #e2e3e5; color: #383d41; }
.badge-enacted { background: #d4edda; color: #155724; }
.badge-dead { background: #f8d7da; color: #721c24; }

/* Score colors */
.score-high { color: var(--danger); font-weight: 700; }
.score-medium { color: var(--warning); font-weight: 600; }
.score-low { color: var(--text-muted); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
}
.btn:hover { background: var(--bg); text-decoration: none; }
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-light); }
.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-warning { background: var(--warning); color: white; border-color: var(--warning); }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.8rem; }

/* Forms */
input, select, textarea {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    width: 100%;
}
textarea { min-height: 150px; resize: vertical; }
label { display: block; font-weight: 600; margin-bottom: 0.25rem; font-size: 0.85rem; }
.form-group { margin-bottom: 1rem; }

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 0.75rem;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.filter-bar .form-group { margin-bottom: 0; }
.filter-bar select { width: auto; min-width: 120px; }

/* Section headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}
.stat-card .stat-value { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-card .stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; }

/* HTMX indicators */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-block; }
.htmx-request.htmx-indicator { display: inline-block; }

/* Responsive */
@media (max-width: 768px) {
    .header { flex-direction: column; gap: 0.5rem; }
    .header nav { flex-wrap: wrap; }
    .container { padding: 1rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .filter-bar { flex-direction: column; }
    table { font-size: 0.8rem; }
    th, td { padding: 0.35rem 0.5rem; }
}

/* Login page */
.login-container {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
}
.login-container h2 { text-align: center; margin-bottom: 1.5rem; }
.login-error { color: var(--danger); font-size: 0.85rem; margin-bottom: 1rem; }

/* Page title */
.page-title { font-size: 1.25rem; font-weight: 700; color: var(--primary); margin-bottom: 1rem; }

/* Detail sections */
.detail-section { margin-bottom: 1.5rem; }
.detail-section h3 { font-size: 1rem; border-bottom: 2px solid var(--primary); padding-bottom: 0.25rem; margin-bottom: 0.75rem; }
.detail-section ul { list-style: disc; padding-left: 1.25rem; }
.detail-section li { margin-bottom: 0.25rem; }

/* Grade display */
.grade { font-size: 1.5rem; font-weight: 700; display: inline-block; width: 2.5rem; height: 2.5rem; line-height: 2.5rem; text-align: center; border-radius: 50%; }
.grade-a { background: #d4edda; color: #155724; }
.grade-b { background: #cce5ff; color: #004085; }
.grade-c { background: #fff3cd; color: #856404; }
.grade-d { background: #f8d7da; color: #721c24; }
.grade-f { background: #c0392b; color: white; }
