/* OSHA Safety Tracker - Main Styles */

:root {
    /* Primary Colors - All WCAG AA compliant (5.5:1+ against dark backgrounds) */
    --danger: #f87171;           /* Red-400: 5.55:1 contrast */
    --danger-dark: #ef4444;      /* Red-500: for hover states */
    --danger-light: #fecaca;
    --warning: #f59e0b;          /* Already accessible: 7.15:1 */
    --warning-dark: #d97706;
    --safe: #10b981;             /* Already accessible: 6.05:1 */
    --safe-dark: #059669;

    /* Dark Theme */
    --bg-dark: #0a0a0f;
    --bg-surface: #111118;
    --bg-card: #1a1a24;
    --bg-elevated: #24242f;
    --border: #2a2a3a;
    --border-light: #3a3a4a;

    /* Text - All WCAG AA compliant (5.5:1+ against all backgrounds) */
    --text-primary: #f5f5f7;     /* 14.09:1 minimum */
    --text-secondary: #a0a0b0;   /* 5.96:1 minimum */
    --text-muted: #9a9aa8;       /* 5.53:1 minimum */

    /* Accent - All WCAG AA compliant (5.5:1+ against dark backgrounds) */
    --accent-blue: #60a5fa;      /* Blue-400: 6.04:1 */
    --accent-purple: #a78bfa;    /* Violet-400: 5.64:1 */
    --accent-cyan: #06b6d4;      /* Already accessible: 6.32:1 */
    --accent-orange: #fb923c;    /* Already accessible: 6.78:1 */
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
}

.logo {
    display: flex;
    align-items: center;
}

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

@media (max-width: 500px) {
    .logo-img {
        height: 48px;
    }
}

/* Legacy icon logo (kept for reference) */
.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--danger), var(--warning));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #1a1a1a;  /* Dark text for WCAG AA compliance */
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-text span {
    color: var(--danger);
}

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

.nav-link {
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.nav-link.active {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

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

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.btn-primary {
    background: var(--danger);
    color: #1a1a1a;  /* Dark text for WCAG AA compliance on light backgrounds */
}

.btn-primary:hover {
    background: var(--danger-dark);
}

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

.btn-outline:hover {
    background: var(--bg-elevated);
    border-color: var(--border-light);
}

/* Hero Section */
.hero {
    background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-dark) 100%);
    padding: 48px 0 64px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 0%, rgba(220, 38, 38, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.hero h1 span {
    background: linear-gradient(135deg, var(--danger), var(--warning));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* Search Box */
.search-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 8px;
    display: flex;
    gap: 8px;
    max-width: 900px;
    margin: 0 auto;
}

.search-field {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border-radius: 10px;
    min-width: 180px;
}

.search-field i {
    color: var(--text-muted);
    font-size: 16px;
}

.search-field input,
.search-field select {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.search-field select {
    cursor: pointer;
}

.search-field select option {
    background: var(--bg-card);
}

.search-btn {
    padding: 14px 32px;
    white-space: nowrap;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 48px;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    margin-top: 32px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-value.danger {
    color: var(--danger);
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* Section */
.section {
    padding: 48px 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-title {
    font-size: 22px;
    font-weight: 700;
}

.section-link {
    color: var(--danger);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-link:hover {
    text-decoration: underline;
}

/* Company Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 1100px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* Company Card */
.company-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s;
}

.company-card:hover {
    border-color: var(--border-light);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.card-header {
    position: relative;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card));
    border-bottom: 1px solid var(--border);
}

.card-logo {
    width: 56px;
    height: 56px;
    background: var(--bg-dark);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.card-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-danger {
    background: rgba(220, 38, 38, 0.2);
    color: var(--danger);
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-safe {
    background: rgba(16, 185, 129, 0.2);
    color: var(--safe);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.card-company-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.safety-score {
    display: flex;
    align-items: center;
    gap: 12px;
}

.score-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-dark);
    border-radius: 3px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.score-fill.danger {
    background: linear-gradient(90deg, var(--danger), var(--danger-dark));
}

.score-fill.warning {
    background: linear-gradient(90deg, var(--warning), var(--warning-dark));
}

.score-fill.safe {
    background: linear-gradient(90deg, var(--safe), var(--safe-dark));
}

.score-label {
    font-size: 13px;
    font-weight: 600;
    min-width: 50px;
    text-align: right;
}

.score-label.danger {
    color: var(--danger);
}

.score-label.warning {
    color: var(--warning);
}

.score-label.safe {
    color: var(--safe);
}

.card-body {
    padding: 16px 20px 20px;
}

.card-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.card-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.card-stat {
    text-align: center;
}

.card-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.card-stat-value.danger {
    color: var(--danger);
}

.card-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Industry Cards */
.industry-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

@media (max-width: 1100px) {
    .industry-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .industry-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.industry-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s;
}

.industry-card:hover {
    border-color: var(--border-light);
    background: var(--bg-elevated);
}

.industry-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-elevated);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin: 0 auto 12px;
    color: var(--warning);
}

.industry-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.industry-count {
    font-size: 12px;
    color: var(--text-muted);
}

/* State Cards */
.states-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 900px) {
    .states-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.state-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    transition: all 0.2s;
}

.state-card:hover {
    border-color: var(--border-light);
    background: var(--bg-elevated);
}

.state-abbr {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--danger), var(--warning));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;  /* Dark text for WCAG AA compliance */
}

.state-info {
    flex: 1;
}

.state-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.state-stats {
    font-size: 12px;
    color: var(--text-muted);
}

.state-stats strong {
    color: var(--danger);
}

/* Fatality Cards */
.fatality-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fatality-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 24px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    transition: all 0.2s;
}

.fatality-card:hover {
    border-color: var(--border-light);
}

.fatality-icon {
    width: 44px;
    height: 44px;
    background: rgba(220, 38, 38, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--danger);
    font-size: 18px;
    flex-shrink: 0;
}

.fatality-content {
    flex: 1;
}

.fatality-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.fatality-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.fatality-meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.fatality-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--danger-dark), #7f1d1d);
    padding: 64px 0;
    text-align: center;
}

.cta-section h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
}

.cta-section p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 24px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.cta-form {
    display: flex;
    gap: 12px;
    justify-content: center;
    max-width: 400px;
    margin: 0 auto;
}

.cta-form input {
    flex: 1;
    padding: 14px 20px;
    border-radius: 10px;
    border: none;
    font-size: 15px;
    background: white;
    color: #333;
}

.cta-form button {
    padding: 14px 28px;
    background: var(--bg-dark);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.cta-form button:hover {
    background: #000;
}

/* Footer */
.footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 64px 0 32px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 48px;
    margin-bottom: 48px;
}

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 16px;
    max-width: 280px;
}

.footer-col h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 10px;
}

.footer-col a {
    color: var(--text-muted);
    font-size: 14px;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    padding-top: 32px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
}

.footer-social {
    display: flex;
    gap: 16px;
}

.footer-social a {
    color: var(--text-muted);
    font-size: 18px;
    transition: color 0.2s;
}

.footer-social a:hover {
    color: var(--text-primary);
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 16px 0;
    font-size: 13px;
    color: var(--text-muted);
}

.breadcrumbs ol {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
}

.breadcrumbs li {
    display: flex;
    align-items: center;
}

.breadcrumbs a {
    color: var(--text-secondary);
    transition: color 0.2s;
}

.breadcrumbs a:hover {
    color: var(--text-primary);
}

.breadcrumbs .separator {
    margin: 0 8px;
    color: var(--text-muted);
}

/* Page Header */
.page-header {
    padding: 32px 0 48px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 48px;
}

.page-header h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
}

.page-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 2px solid var(--border);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.data-table tr:hover td {
    background: var(--bg-elevated);
}

.data-table .company-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.data-table .company-initial {
    width: 36px;
    height: 36px;
    background: var(--bg-dark);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-primary);
}

/* Popular Links Section */
.popular-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
}

.popular-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 900px) {
    .popular-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.popular-link {
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.2s;
}

.popular-link:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

/* Tags */
.tags-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.tag:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* Utility Classes */
.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

.text-safe {
    color: var(--safe);
}

.text-muted {
    color: var(--text-muted);
}

.mt-4 {
    margin-top: 16px;
}

.mb-4 {
    margin-bottom: 16px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

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

/* ==========================================
   MOBILE NAVIGATION & RESPONSIVE FIXES
   ========================================== */

/* Hamburger Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
}

/* Mobile Navigation Overlay */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-surface);
    z-index: 200;
    padding: 24px;
    flex-direction: column;
}

.mobile-nav.active {
    display: flex;
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.mobile-nav-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 28px;
    cursor: pointer;
    padding: 8px;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-nav-links a {
    padding: 16px;
    font-size: 18px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 12px;
    transition: all 0.2s;
}

.mobile-nav-links a:hover,
.mobile-nav-links a.active {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.mobile-nav-cta {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.mobile-nav-cta .btn {
    width: 100%;
    justify-content: center;
    padding: 16px;
    font-size: 16px;
}

/* Mobile Breakpoint - Header */
@media (max-width: 900px) {
    .nav {
        display: none;
    }

    .header-actions {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }
}

/* Mobile Breakpoint - Search Box */
@media (max-width: 700px) {
    .search-box {
        flex-direction: column;
        padding: 12px;
    }

    .search-field {
        min-width: 100%;
        width: 100%;
    }

    .search-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Mobile Breakpoint - Stats Bar */
@media (max-width: 600px) {
    .stats-bar {
        flex-wrap: wrap;
        gap: 24px 16px;
    }

    .stat-item {
        flex: 0 0 calc(50% - 8px);
    }

    .stat-value {
        font-size: 22px;
    }

    .stat-label {
        font-size: 10px;
    }
}

/* Mobile Breakpoint - CTA Form */
@media (max-width: 500px) {
    .cta-form {
        flex-direction: column;
    }

    .cta-form input,
    .cta-form button {
        width: 100%;
    }

    .cta-section h2 {
        font-size: 24px;
    }
}

/* Mobile Breakpoint - Footer */
@media (max-width: 600px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

/* Mobile Breakpoint - Hero */
@media (max-width: 500px) {
    .hero {
        padding: 32px 0 48px;
    }

    .hero-subtitle {
        font-size: 16px;
    }
}

/* Mobile Breakpoint - Section Headers */
@media (max-width: 500px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .section-title {
        font-size: 18px;
    }
}

/* Mobile Breakpoint - Cards */
@media (max-width: 400px) {
    .card-stats {
        gap: 8px;
    }

    .card-stat-value {
        font-size: 16px;
    }

    .card-meta {
        flex-direction: column;
        gap: 8px;
    }
}

/* Mobile Breakpoint - Breadcrumbs */
@media (max-width: 500px) {
    .breadcrumbs {
        font-size: 12px;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Touch-friendly adjustments */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
    }

    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .tag {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .popular-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Logo Text Styles */
.logo-text {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo-highlight {
    color: var(--danger);
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-blue);
    color: #1a1a1a;  /* Dark text for WCAG AA compliance */
    padding: 8px 16px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* =============================================================================
   AUTOCOMPLETE
   ============================================================================= */

.autocomplete-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-top: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: none;
    max-height: 320px;
    overflow-y: auto;
}

.autocomplete-dropdown.active {
    display: block;
}

.autocomplete-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: var(--bg-elevated);
}

.autocomplete-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.autocomplete-location {
    font-size: 13px;
    color: var(--text-muted);
}

.autocomplete-violations {
    font-size: 13px;
    color: var(--danger);
    font-weight: 500;
}

.autocomplete-empty {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* =============================================================================
   HUB PAGE COMPONENTS
   ============================================================================= */

/* Page Hero (for hub pages) */
.page-hero {
    background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-dark) 100%);
    padding: 48px 0 64px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}

.page-hero h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 16px;
}

.page-hero .lead {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 700px;
    margin-bottom: 24px;
}

/* Violation Hero */
.violation-hero {
    background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-dark) 100%);
    padding: 48px 0 64px;
    border-bottom: 1px solid var(--border);
}

.violation-hero .hero-content {
    margin-bottom: 32px;
}

.violation-hero h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 16px;
}

.violation-hero .lead {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 700px;
    margin-bottom: 8px;
}

/* Inspection Hero */
.inspection-hero {
    background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-dark) 100%);
    padding: 48px 0 64px;
    border-bottom: 1px solid var(--border);
}

.inspection-hero .hero-content {
    margin-bottom: 32px;
}

.inspection-hero h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 16px;
}

.inspection-hero .lead {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.inspection-hero .lead a {
    color: var(--accent-blue);
}

.inspection-date,
.inspection-type {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* Category Badge */
.category-badge {
    display: inline-block;
    background: var(--accent-blue);
    color: #1a1a1a;  /* Dark text for WCAG AA compliance */
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Severity Badge */
.severity-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.severity-badge.fatality {
    background: var(--danger);
    color: #1a1a1a;  /* Dark text for WCAG AA compliance */
}

.severity-badge.accident {
    background: var(--warning);
    color: #1a1a1a;
}

.severity-badge.willful {
    background: var(--accent-orange);
    color: #1a1a1a;  /* Dark text for WCAG AA compliance */
}

/* Stats Cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.stat-card.penalty .stat-card-value {
    color: var(--danger);
}

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-card-label {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Content Card */
.content-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.content-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-card-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.header-note {
    font-size: 13px;
    color: var(--text-muted);
}

.content-card-body {
    padding: 0;
}

@media (max-width: 768px) {
    .content-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Enhanced Data Table (for hub pages) */
.data-table th,
.data-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
    background: var(--bg-surface);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table a {
    color: var(--accent-blue);
    font-weight: 500;
}

.data-table tr:hover {
    background: var(--bg-elevated);
}

/* Table Cell Variants */
.rank-cell {
    font-weight: 700;
    color: var(--text-muted);
    width: 60px;
}

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

.count-cell {
    font-weight: 600;
}

.penalty-cell {
    font-weight: 600;
    color: var(--danger);
}

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

.date-cell {
    white-space: nowrap;
}

.action-cell {
    text-align: right;
}

/* Standard Code Display */
.standard-code {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
    margin-top: 4px;
}

/* Empty State */
.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 48px 0;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-btn {
    display: inline-block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.filter-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #1a1a1a;  /* Dark text for WCAG AA compliance */
}

.state-filter select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 14px;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
}

/* Fatality Row Highlight */
.fatality-row {
    background: rgba(239, 68, 68, 0.05);
}

.fatality-row:hover {
    background: rgba(239, 68, 68, 0.08);
}

.fatality-badge {
    display: inline-block;
    background: var(--danger);
    color: #1a1a1a;  /* Dark text for WCAG AA compliance */
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    text-transform: uppercase;
}

/* View Link Button */
.view-link {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-blue);
    padding: 6px 12px;
    border: 1px solid var(--accent-blue);
    border-radius: 6px;
    transition: all 0.2s;
}

.view-link:hover {
    background: var(--accent-blue);
    color: #1a1a1a;  /* Dark text for WCAG AA compliance */
}

/* Violation Type Badges */
.viol-type {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.viol-type-s {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.viol-type-w {
    background: rgba(239, 68, 68, 0.25);
    color: var(--danger);
}

.viol-type-r {
    background: rgba(251, 146, 60, 0.15);
    color: var(--accent-orange);
}

.viol-type-o,
.viol-type-u {
    background: rgba(156, 163, 175, 0.15);
    color: var(--text-muted);
}

/* Accident Details */
.accident-details {
    padding: 24px;
}

.accident-grid {
    display: grid;
    gap: 24px;
}

.accident-description {
    margin-bottom: 16px;
}

.accident-description strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.accident-description p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.accident-meta {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-value {
    font-size: 14px;
    color: var(--text-primary);
}

/* Company Link Button */
.company-link-section {
    text-align: center;
}

.company-link-button {
    display: inline-block;
    background: var(--accent-blue);
    color: #1a1a1a;  /* Dark text for WCAG AA compliance */
    font-weight: 600;
    padding: 14px 32px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s;
}

.company-link-button:hover {
    background: #2563eb;
}
