* {
    font-family: century-gothic, sans-serif;
}
body {
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
}
h1 {
    color: #115072;
    font-weight: bold;
    padding-left: 20px;
}
h1 span {
    color: #217991;
    font-size: 75%;
}
h1 span::before {
    content: "❱❱ ";
    color: #bf5027;
}
h2 {
    color: #115072 !important;
    border-bottom: 2px solid #217991;
    padding-bottom: 8px;
    margin-bottom: 15px;
    font-size: 1.4rem;
    font-weight: 600;
}
p {
    margin-top: 0;
    margin-bottom: 0;
}
.section-card {
    background: #ebebeb;
    border: 2px solid #115072;
    border-radius: 10px;
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
}
.source-note {
    margin-top: auto;
    padding-top: 12px;
}
.data-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    align-items: center;
}
.label {
    font-weight: 600;
}
.nc-stat {
    font-size: 1.2rem;
    font-weight: bold;
    color: #217991;
}
.us-stat {
    font-size: 1.2rem;
    font-weight: bold;
    color: #bf5027;
}
.comparison-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 12px;
}
.comparison-card {
    flex: 1;
    min-width: 200px;
    background: #f8f9fa;
    padding: 8px 15px;
    border-left: 4px solid;
    border-radius: 4px;
}
.comparison-row-sm {
    gap: 10px;
}
.comparison-row-sm .comparison-card {
    padding: 3px 12px;
    min-width: 120px;
}
.nc-card {
    border-left-color: #217991;
}
.us-card {
    border-left-color: #bf5027;
}
.stat-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
}
.text-secondary {
    font-size: 0.8rem !important;
    font-style: italic;
    color: #115072 !important;
}
ul {
    list-style-type: none;
    padding-left: 0;
    margin-bottom: 0;
}
li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 25px;
}
li i {
    position: absolute;
    left: 0;
    top: 3px;
    color: #217991;
}
h3 {
    color: #115072;
    font-weight: 600;
}
h3 i {
    color: #115072;
}
#header {
    top: 0;
    background: #092940;
    transition: all 0.5s;
    z-index: 997;
    height: 70px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
}
#header.header-scrolled {
    box-shadow: 0px 2px 15px rgba(0, 0, 0, 0.1);
}
#header .logo {
    font-size: 30px;
    margin: 0;
    padding: 0;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}
#header .logo a {
    color: #fff;
}
#header .logo img {
    max-height: 40px;
}
.hover-link:hover {
    color: #217991 !important;
    transition: color 0.3s ease;
}
#footer {
    background: #092940;
    color: #fff;
    font-size: 14px;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}
#footer a {
    color: #fff;
}
.footer-link:hover {
    color: #217991 !important;
    transition: color 0.3s ease;
    text-decoration: none;
}
/* Restore original screen order after HTML was reordered for print.
   HTML order: Population(1), Jobs+Estab(2), Incomes(3), Labor Force(4), Employers(5), GDP(6)
   Screen order: Population(1), Labor Force(2), Jobs+Estab(3), Employers(4), Incomes(5), GDP(6) */
@media screen {
    #mainContainer > .row > div:nth-child(1) { order: 1; }
    #mainContainer > .row > div:nth-child(2) { order: 3; }
    #mainContainer > .row > div:nth-child(3) { order: 5; }
    #mainContainer > .row > div:nth-child(4) { order: 2; }
    #mainContainer > .row > div:nth-child(5) { order: 4; }
    #mainContainer > .row > div:nth-child(6) { order: 6; }
}

#print-subtitle {
    display: none;
}

@media (min-width: 993px) {
    #mainContainer {
        padding-left: 150px;
        padding-right: 150px;
        margin: 0 auto;
        max-width: 1400px;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
}

.loading-spinner p {
    color: #115072;
    font-weight: 600;
    font-size: 1.2rem;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
    color: #217991 !important;
}

/* Error Message */
.error-message {
    position: fixed;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    max-width: 90%;
    width: 600px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}


/* Print Styles */
@media print {
    @page {
        margin: 0.5cm;
        size: letter portrait;
    }

    body {
        background-color: white;
        margin: 0;
        padding: 0;
    }

    #header, .back-to-top, .print-button, #footer {
        display: none !important;
    }

    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }

    /*
     * Multi-column on #mainContainer flows cards into two independent columns
     * with no shared row heights. HTML order is: Population, Employers, Incomes,
     * Labor Force, Jobs+Estab, GDP. break-before: column on the 4th card (Labor
     * Force) splits the columns exactly where we want them:
     *
     * Left column:  Population | Employers | Incomes
     * Right column: Labor Force | Jobs+Establishments | GDP
     */
    #mainContainer {
        column-count: 2;
        column-gap: 1rem;
        column-rule: 1px solid #c8dde6;
        padding: 8px 0 !important;
    }
    #mainContainer > h1 {
        column-span: all;
        font-size: 22pt;
        padding: 4px 4px 2px !important;
        margin: 0 !important;
        border-bottom: none;
    }
    #print-subtitle {
        display: block;
        column-span: all;
        font-size: 10pt;
        color: #217991;
        font-weight: 600;
        margin: 0 0 20px 0 !important;
        padding: 2px 0 10px 6px;
        border-bottom: 3px solid #217991;
    }
    #mainContainer > .row {
        display: contents;
    }
    #mainContainer > .row > div {
        break-inside: avoid;
        display: block !important;
        width: 100% !important;
        flex: none !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 0 0.55rem 0 !important;
    }
    /* Labor Force is the 4th card in HTML order — force it to start the right column */
    #mainContainer > .row > div:nth-child(4) {
        break-before: column;
    }

    .section-card {
        box-shadow: none;
        border: 1px solid #217991;
        height: auto !important;
        display: block !important;
        overflow: visible !important;
        padding: 8px 10px !important;
        border-radius: 6px;
    }

    h2 {
        font-size: 9.5pt;
        padding-bottom: 4px;
        margin-bottom: 6px !important;
    }
    h3 {
        font-size: 8pt !important;
        margin-top: 4px !important;
        margin-bottom: 2px !important;
    }

    ul { margin-bottom: 0; }
    p { font-size: 8pt; }
    li {
        font-size: 8pt;
        margin-bottom: 3px;
        padding-left: 16px;
    }
    li i {
        font-size: 7.5pt;
        top: 2px;
    }

    .nc-stat { font-size: 9pt; }
    .us-stat { font-size: 9pt; }
    .stat-title { font-size: 7pt; }
    .source-note { font-size: 7pt !important; padding-top: 5px; }
    .text-secondary { font-size: 7pt !important; }

    .comparison-card { min-width: 60px; padding: 3px 8px; }
    .comparison-row { gap: 8px; margin-bottom: 5px; }

    .g-3 {
        --bs-gutter-x: 0.3rem;
        --bs-gutter-y: 0.3rem;
    }

    /* Bootstrap spacing overrides */
    .py-4 { padding-top: 4px !important; padding-bottom: 4px !important; }
    .mb-3 { margin-bottom: 4px !important; }
    .mt-2, .mt-3 { margin-top: 4px !important; }
}