/* Michigan Election Integrity - Main Stylesheet
   Based on ei.ballot.biz design system
   Created: 2026-01-08
*/

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    /* Primary Colors */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-start: #667eea;
    --primary-end: #764ba2;

    /* Text Colors */
    --text-primary: #374151;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --text-white: #ffffff;

    /* Background Colors */
    --bg-light: #f5f5f5;
    --bg-white: #ffffff;
    --bg-card: #ffffff;

    /* Border Colors */
    --border-light: #e5e7eb;
    --border-medium: #d1d5db;

    /* Status Colors */
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    /* Priority Colors */
    --priority-high: #ef4444;
    --priority-medium: #f59e0b;
    --priority-low: #10b981;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 10px 40px rgba(0, 0, 0, 0.12);

    /* Layout */
    --max-width: 900px;
    --header-height: 70px;
    --border-radius: 12px;
    --border-radius-sm: 8px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-light);
    min-height: 100vh;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 28px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
h4 { font-size: 18px; }
h5 { font-size: 16px; }
h6 { font-size: 14px; }

p { margin-bottom: 1rem; }

a {
    color: var(--primary-start);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-end);
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.container-wide {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    background: var(--primary-gradient);
    padding: 20px 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo img {
    height: 40px;
    width: auto;
}

.header-title {
    color: var(--text-white);
    font-size: 20px;
    font-weight: 600;
}

.header-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 400;
}

.header-nav {
    display: flex;
    gap: 8px;
}

.header-nav a {
    color: var(--text-white);
    padding: 8px 16px;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: background var(--transition-fast);
}

.header-nav a:hover,
.header-nav a.active {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main {
    padding: 40px 0;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 24px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 16px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.card-body {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
}

.hero h1 {
    font-size: 32px;
    margin-bottom: 12px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    color: var(--text-secondary);
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto 24px;
}

/* ============================================
   SEARCH
   ============================================ */
.search-box {
    display: flex;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-start);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-input::placeholder {
    color: var(--text-light);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn:hover {
    transform: translateY(-2px);
}

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

.btn-primary:hover {
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--border-light);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* ============================================
   STATS GRID
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 24px;
    text-align: center;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ============================================
   ISSUE CARDS
   ============================================ */
.issue-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 20px;
    margin-bottom: 16px;
    border-left: 4px solid var(--primary-start);
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

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

.issue-card.priority-high {
    border-left-color: var(--priority-high);
}

.issue-card.priority-medium {
    border-left-color: var(--priority-medium);
}

.issue-card.priority-low {
    border-left-color: var(--priority-low);
}

.issue-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.issue-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.issue-type {
    display: inline-block;
    padding: 4px 10px;
    background: var(--bg-light);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.issue-summary {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.issue-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--text-light);
}

.issue-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============================================
   TAGS/BADGES
   ============================================ */
.tag {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-start);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-resolved {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-secondary);
}

/* ============================================
   FILTERS
   ============================================ */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    background: var(--bg-white);
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-start);
}

/* ============================================
   TIMELINE
   ============================================ */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-light);
}

.timeline-item {
    position: relative;
    padding-bottom: 16px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-start);
    border: 2px solid var(--bg-white);
}

.timeline-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 4px;
}

.timeline-content {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border-light);
    padding: 30px 0;
    margin-top: 40px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    font-size: 13px;
    color: var(--text-secondary);
}

.footer-links a:hover {
    color: var(--primary-start);
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.hidden { display: none; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* ============================================
   LOADING STATES
   ============================================ */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary-start);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   MESSAGES
   ============================================ */
.message {
    padding: 16px;
    border-radius: var(--border-radius-sm);
    border-left: 4px solid;
    margin-bottom: 16px;
}

.message-success {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: var(--success);
    color: var(--success);
}

.message-error {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: var(--error);
    color: var(--error);
}

.message-warning {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: var(--warning);
    color: var(--warning);
}

.message-info {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: var(--info);
    color: var(--info);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .header-nav {
        width: 100%;
        justify-content: center;
    }

    .hero {
        padding: 30px 20px;
    }

    .hero h1 {
        font-size: 24px;
    }

    .search-box {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filters {
        flex-direction: column;
    }

    .issue-header {
        flex-direction: column;
        gap: 8px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .header-nav a {
        padding: 8px 12px;
        font-size: 13px;
    }
}
