/**
 * Job Market Pages CSS
 * Version: 1.0
 * 
 * Used by:
 * - /job-market/usa/index.php
 * - /job-market/canada/index.php
 * - /job-market/index.php
 * - City pages under /job-market/[state]/[city]/
 * 
 * Place in: /asset/css/pages/job-market.css
 */

/* ==========================================
   CSS VARIABLES
   ========================================== */
:root {
    --jm-primary: #1e3a5f;
    --jm-secondary: #2563eb;
    --jm-accent: #02c153;
    --jm-text: #1f2937;
    --jm-text-light: #6b7280;
    --jm-border: #e5e7eb;
    --jm-bg: #f9fafb;
    --jm-card: #ffffff;
    --jm-high: #dc2626;
    --jm-medium: #f59e0b;
    --jm-low: #22c55e;
}

/* ==========================================
   HERO SECTION
   ========================================== */
.jm-hero {
    background: var(--jm-card);
    border-bottom: 1px solid var(--jm-border);
    padding: 40px 20px;
}

.jm-hero-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.jm-hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 20px;
}

.jm-hero-title-area {
    flex: 1;
    min-width: 300px;
}

.jm-breadcrumb {
    font-size: 0.875rem;
    color: var(--jm-text-light);
    margin-bottom: 8px;
}

.jm-breadcrumb a {
    color: var(--jm-secondary);
    text-decoration: none;
}

.jm-breadcrumb a:hover {
    text-decoration: underline;
}

.jm-data-date {
    display: inline-block;
    background: var(--jm-bg);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--jm-text-light);
    margin-bottom: 12px;
}

.jm-hero-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--jm-primary);
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.jm-hero-intro {
    color: var(--jm-text);
    font-size: 1.1rem;
    margin: 0;
    line-height: 1.6;
    max-width: 700px;
}

.jm-hero-intro strong {
    color: var(--jm-primary);
}

/* ==========================================
   COUNTRY/REGION SWITCH
   ========================================== */
.jm-country-switch {
    display: flex;
    gap: 8px;
}

.jm-country-btn {
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
}

.jm-country-btn.active {
    background: var(--jm-primary);
    color: white;
}

.jm-country-btn:not(.active) {
    background: var(--jm-bg);
    color: var(--jm-text);
    border: 1px solid var(--jm-border);
}

.jm-country-btn:not(.active):hover {
    background: var(--jm-border);
}

/* ==========================================
   STATS BADGES
   ========================================== */
.jm-stats-badges {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

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

.jm-stat-badge-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--jm-primary);
    display: block;
    line-height: 1.2;
}

.jm-stat-badge-value.highlight {
    color: var(--jm-accent);
}

.jm-stat-badge-label {
    font-size: 0.8rem;
    color: var(--jm-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ==========================================
   DATA CARDS (Industries, Roles)
   ========================================== */
.jm-data-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.jm-data-card {
    background: var(--jm-bg);
    border: 1px solid var(--jm-border);
    border-radius: 12px;
    padding: 20px;
}

.jm-data-card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--jm-primary);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.jm-data-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.jm-data-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--jm-border);
    font-size: 0.9rem;
}

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

.jm-data-name {
    color: var(--jm-text);
}

.jm-data-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.jm-data-badge.high {
    background: #fee2e2;
    color: var(--jm-high);
}

.jm-data-badge.medium {
    background: #fef3c7;
    color: #d97706;
}

.jm-data-badge.low {
    background: #dcfce7;
    color: #16a34a;
}

/* ==========================================
   CONTENT AREA
   ========================================== */
.jm-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ==========================================
   COMPETITION LEGEND
   ========================================== */
.jm-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
    padding: 16px 20px;
    background: var(--jm-card);
    border: 1px solid var(--jm-border);
    border-radius: 8px;
}

.jm-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
}

.jm-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.jm-legend-dot.high {
    background: var(--jm-high);
}

.jm-legend-dot.medium {
    background: var(--jm-medium);
}

.jm-legend-dot.low {
    background: var(--jm-low);
}

/* ==========================================
   SECTION TITLES & INTROS
   ========================================== */
.jm-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--jm-primary);
    margin: 48px 0 12px 0;
}

.jm-section-intro {
    color: var(--jm-text-light);
    font-size: 1rem;
    margin: 0 0 24px 0;
    line-height: 1.6;
    max-width: 900px;
}

/* ==========================================
   KEY FINDINGS BOX (AEO Optimized)
   ========================================== */
.jm-key-findings {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-left: 4px solid var(--jm-secondary);
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 24px;
}

.jm-key-findings h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--jm-primary);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.jm-key-findings ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.jm-key-findings li {
    padding: 6px 0;
    font-size: 0.95rem;
    color: var(--jm-text);
    line-height: 1.5;
}

.jm-key-findings li strong {
    color: var(--jm-primary);
}

/* ==========================================
   SUBSECTION TITLES & RANKED LISTS
   ========================================== */
.jm-subsection-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--jm-primary);
    margin: 32px 0 8px 0;
}

.jm-subsection-intro {
    color: var(--jm-text-light);
    font-size: 0.95rem;
    margin: 0 0 16px 0;
}

.jm-ranked-list {
    background: var(--jm-card);
    border: 1px solid var(--jm-border);
    border-radius: 8px;
    padding: 16px 16px 16px 40px;
    margin: 0 0 24px 0;
}

.jm-ranked-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--jm-border);
    font-size: 0.95rem;
    line-height: 1.5;
}

.jm-ranked-list li:last-child {
    border-bottom: none;
}

.jm-ranked-list li strong {
    color: var(--jm-text);
}

/* ==========================================
   DATA TABLES
   ========================================== */
.jm-table-container {
    background: var(--jm-card);
    border: 1px solid var(--jm-border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}

.jm-table {
    width: 100%;
    border-collapse: collapse;
}

.jm-table th {
    background: var(--jm-bg);
    padding: 14px 18px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--jm-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--jm-border);
}

.jm-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--jm-border);
    font-size: 0.95rem;
}

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

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

.jm-table .jobs-col {
    color: var(--jm-text-light);
    font-size: 0.85rem;
}

.jm-table-toggle {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--jm-bg);
    border: none;
    border-top: 1px solid var(--jm-border);
    color: var(--jm-secondary);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
}

.jm-table-toggle:hover {
    background: var(--jm-border);
}

.jm-table-hidden {
    display: none;
}

.jm-table-hidden.show {
    display: table-row-group;
}

/* ==========================================
   STATE/PROVINCE CARDS
   ========================================== */
.jm-states-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.jm-state-card {
    background: var(--jm-card);
    border: 1px solid var(--jm-border);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.jm-state-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.jm-state-card-header {
    background: var(--jm-bg);
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--jm-border);
}

.jm-state-card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--jm-primary);
}

.jm-state-avg {
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
}

.jm-state-avg.high {
    background: #fee2e2;
    color: var(--jm-high);
}

.jm-state-avg.medium {
    background: #fef3c7;
    color: #d97706;
}

.jm-state-avg.low {
    background: #dcfce7;
    color: #16a34a;
}

/* ==========================================
   PROVINCE OVERVIEW CARDS (Canada)
   ========================================== */
.jm-province-overview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.jm-province-card {
    background: var(--jm-card);
    border: 1px solid var(--jm-border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: box-shadow 0.2s;
}

.jm-province-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.jm-province-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--jm-primary);
    margin: 0 0 8px 0;
}

.jm-province-avg-big {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1;
}

.jm-province-avg-big.high {
    color: var(--jm-high);
}

.jm-province-avg-big.medium {
    color: var(--jm-medium);
}

.jm-province-avg-big.low {
    color: var(--jm-low);
}

.jm-province-avg-label {
    font-size: 0.7rem;
    color: var(--jm-text-light);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.jm-province-meta {
    font-size: 0.75rem;
    color: var(--jm-text-light);
}

/* Province Detail Cards */
.jm-provinces-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

.jm-province-detail-card {
    background: var(--jm-card);
    border: 1px solid var(--jm-border);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.jm-province-detail-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.jm-province-detail-header {
    background: var(--jm-bg);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--jm-border);
}

.jm-province-detail-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    color: var(--jm-primary);
}

.jm-province-badge {
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
}

.jm-province-badge.high {
    background: #fee2e2;
    color: var(--jm-high);
}

.jm-province-badge.medium {
    background: #fef3c7;
    color: #d97706;
}

.jm-province-badge.low {
    background: #dcfce7;
    color: #16a34a;
}

/* ==========================================
   CITY LIST (within state/province cards)
   ========================================== */
.jm-city-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.jm-city-item {
    border-bottom: 1px solid var(--jm-border);
}

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

.jm-city-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    text-decoration: none;
    color: var(--jm-text);
    transition: background 0.2s;
}

.jm-city-link:hover {
    background: var(--jm-bg);
}

.jm-city-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.jm-city-name {
    font-weight: 500;
}

.jm-city-jobs {
    font-size: 0.8rem;
    color: var(--jm-text-light);
}

.jm-city-badge {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 600;
}

.jm-city-badge.high {
    background: #fee2e2;
    color: var(--jm-high);
}

.jm-city-badge.medium {
    background: #fef3c7;
    color: #d97706;
}

.jm-city-badge.low {
    background: #dcfce7;
    color: #16a34a;
}

/* ==========================================
   FAQ SECTION
   ========================================== */
.jm-faq {
    margin-top: 48px;
}

.jm-faq-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--jm-primary);
    margin: 0 0 24px 0;
}

.jm-faq-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.jm-faq-item {
    background: var(--jm-card);
    border: 1px solid var(--jm-border);
    border-radius: 12px;
    overflow: hidden;
}

.jm-faq-question {
    font-size: 1rem;
    font-weight: 600;
    color: var(--jm-primary);
    padding: 20px;
    margin: 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.jm-faq-question::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--jm-text-light);
    transition: transform 0.2s;
}

.jm-faq-item.open .jm-faq-question::after {
    transform: rotate(45deg);
}

.jm-faq-answer {
    padding: 0 20px 20px;
    color: var(--jm-text);
    line-height: 1.7;
    display: none;
}

.jm-faq-item.open .jm-faq-answer {
    display: block;
}

.jm-faq-answer p {
    margin: 0 0 12px 0;
}

.jm-faq-answer p:last-child {
    margin-bottom: 0;
}

/* ==========================================
   CTA SECTION
   ========================================== */
.jm-cta {
    background: var(--jm-primary);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    margin-top: 48px;
}

.jm-cta h2 {
    font-size: 1.5rem;
    margin: 0 0 12px 0;
    color: #ffffff;
}

.jm-cta p {
    margin: 0 0 24px 0;
    color: #ffffff;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.jm-cta-btn {
    display: inline-block;
    background: var(--jm-accent);
    color: #ffffff;
    padding: 14px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.jm-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(2, 193, 83, 0.4);
}

/* ==========================================
   METHODOLOGY SECTION
   ========================================== */
.jm-methodology {
    background: var(--jm-bg);
    border: 1px solid var(--jm-border);
    border-radius: 12px;
    padding: 24px;
    margin-top: 48px;
}

.jm-methodology h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--jm-primary);
    margin: 0 0 12px 0;
}

.jm-methodology p {
    font-size: 0.9rem;
    color: var(--jm-text-light);
    line-height: 1.6;
    margin: 0 0 8px 0;
}

.jm-methodology p:last-child {
    margin-bottom: 0;
}

.jm-data-attribution {
    font-size: 0.85rem;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--jm-border);
}

.jm-data-attribution a {
    color: var(--jm-secondary);
    text-decoration: none;
}

.jm-data-attribution a:hover {
    text-decoration: underline;
}

/* ==========================================
   COMPETITION DOTS (for tables)
   ========================================== */
.jm-competition-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

.jm-competition-dot.jm-high {
    background: var(--jm-high);
}

.jm-competition-dot.jm-medium {
    background: var(--jm-medium);
}

.jm-competition-dot.jm-low {
    background: var(--jm-low);
}

.jm-competition-high {
    color: var(--jm-high);
    font-weight: 600;
}

.jm-competition-medium {
    color: var(--jm-medium);
    font-weight: 600;
}

.jm-competition-low {
    color: var(--jm-low);
    font-weight: 600;
}

/* ==========================================
   FAQ GRID (City Pages)
   ========================================== */
.jm-faq-section {
    margin-top: 48px;
}

.jm-faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.jm-faq-item {
    background: var(--jm-card);
    border: 1px solid var(--jm-border);
    border-radius: 12px;
    padding: 20px 24px;
}

.jm-faq-question {
    font-size: 1rem;
    font-weight: 600;
    color: var(--jm-primary);
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.jm-faq-answer {
    margin: 0;
}

.jm-faq-answer p {
    font-size: 0.95rem;
    color: var(--jm-text);
    line-height: 1.6;
    margin: 0;
}

.jm-faq-answer a {
    color: var(--jm-secondary);
}

/* ==========================================
   CTA SECTION (City Pages)
   ========================================== */
.jm-cta-section {
    background: var(--jm-primary);
    border-radius: 16px;
    padding: 48px 32px;
    margin: 48px 0;
    text-align: center;
}

.jm-cta-inner h2 {
    color: #ffffff;
    font-size: 1.75rem;
    margin: 0 0 16px 0;
}

.jm-cta-inner p {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
    margin: 0 0 24px 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.jm-cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.jm-cta-btn {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.2s;
}

.jm-cta-primary {
    background: var(--jm-accent);
    color: #ffffff;
}

.jm-cta-primary:hover {
    background: #01a847;
    transform: translateY(-2px);
}

.jm-cta-secondary {
    background: rgba(255,255,255,0.15);
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.3);
}

.jm-cta-secondary:hover {
    background: rgba(255,255,255,0.25);
}

/* ==========================================
   METHODOLOGY SECTION (City Pages)
   ========================================== */
.jm-methodology-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--jm-border);
}

.jm-methodology-text {
    font-size: 0.9rem;
    color: var(--jm-text-light);
    line-height: 1.7;
    max-width: 900px;
}

.jm-methodology-text a {
    color: var(--jm-secondary);
}

/* ==========================================
   MAIN CONTENT CONTAINER
   ========================================== */
.jm-main {
    background: var(--jm-bg);
    padding: 40px 0;
}

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

.jm-section {
    margin-bottom: 32px;
}

/* ==========================================
   RESPONSIVE BREAKPOINTS
   ========================================== */
@media (max-width: 900px) {
    .jm-stats-badges {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .jm-data-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .jm-hero-title {
        font-size: 1.5rem;
    }
    
    .jm-stat-badge-value {
        font-size: 1.5rem;
    }
    
    .jm-provinces-grid {
        grid-template-columns: 1fr;
    }
    
    .jm-section-title {
        font-size: 1.25rem;
    }
    
    .jm-table th,
    .jm-table td {
        padding: 10px 12px;
    }
}

@media (max-width: 500px) {
    .jm-stats-badges {
        grid-template-columns: 1fr;
    }
    
    .jm-faq-grid {
        grid-template-columns: 1fr;
    }
    
    .jm-cta-section {
        padding: 32px 20px;
    }
    
    .jm-cta-inner h2 {
        font-size: 1.4rem;
    }
    
    .jm-cta-buttons {
        flex-direction: column;
    }
    
    .jm-cta-btn {
        width: 100%;
        text-align: center;
    }
}
