/* market-map.css - Sustalium Design System */

/* Helper for CSP compliance */
.hidden-svg-defs { width: 0; height: 0; position: absolute; visibility: hidden; }

.map-section { padding: 4rem 1rem; text-align: center; }

.monitoring-stats {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted-foreground);
    margin-bottom: 1.5rem;
}

#selected-count { color: #006039; font-weight: 800; }

.map-toolbar { display: flex; gap: 10px; justify-content: center; margin: 2rem 0; flex-wrap: wrap; }

.zoom-btn {
    background: var(--card); border: 1px solid var(--border); color: var(--foreground);
    padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 0.8rem; font-weight: 600; transition: all 0.2s ease;
}

.zoom-btn:hover { border-color: #006039; color: #006039; background: var(--accent); }

.industry-filter-container { margin: 4rem auto 2rem; max-width: 900px; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.filter-label { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted-foreground); opacity: 0.8; }
.filter-group { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 4px; }

.filter-btn {
    background: var(--muted); border: 1px solid var(--border); padding: 6px 14px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 600; color: var(--muted-foreground); cursor: pointer; white-space: nowrap; transition: all 0.2s ease;
}

.filter-btn:hover { border-color: #006039; color: #006039; }
.filter-btn.active { background: #006039; color: white; border-color: #006039; box-shadow: 0 4px 10px rgba(0, 96, 57, 0.2); }

.map-wrapper {
    background: var(--card); border: 1px solid var(--border); border-radius: 2rem; padding: 2rem; position: relative;
    max-width: 1100px; margin: 0 auto; min-height: 400px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.02);
}

#world-map-svg { width: 100%; height: auto; transition: viewBox 0.4s ease-in-out; }

.country { fill: #f3f4f6; stroke: var(--border); stroke-width: 0.3; transition: all 0.2s ease; cursor: pointer; vector-effect: non-scaling-stroke; }
.dark .country { fill: #1f2937; stroke: #374151; }
.country.active { fill: #006039 !important; filter: drop-shadow(0 2px 4px rgba(0, 96, 57, 0.2)); }

.posters-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; max-width: 1100px; margin: 2rem auto 4rem; text-align: left; }

.poster-card {
    background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; position: relative;
    transition: transform 0.2s ease, border-color 0.2s ease; display: flex; flex-direction: column;
}

.poster-card.upcoming { border-style: dashed; opacity: 0.9; }
.poster-card:hover { border-color: #006039; transform: translateY(-3px); }

.poster-status-row { display: flex; align-items: center; gap: 10px; margin-bottom: 0.75rem; }
.status-pill { font-size: 0.6rem; font-weight: 900; padding: 1px 6px; border-radius: 3px; text-transform: uppercase; }
.status-active { background: rgba(0, 96, 57, 0.1); color: #006039; border: 1px solid #006039; }
.status-upcoming { background: rgba(245, 158, 11, 0.1); color: #f59e0b; border: 1px solid #f59e0b; }
.status-date { font-size: 0.65rem; font-weight: 700; color: var(--muted-foreground); }

.poster-badge { position: absolute; top: -10px; right: 15px; padding: 2px 10px; font-size: 0.65rem; font-weight: 900; border-radius: 4px; color: white; background: #f59e0b; }

.poster-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--foreground); display: block; }
a.poster-title { 
    background: #006039; 
    color: white; 
    text-decoration: none; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    display: inline-block;
}
a.poster-title:hover { background: #004d2a; box-shadow: 0 2px 6px rgba(0, 96, 57, 0.3); }
.poster-desc { font-size: 0.85rem; color: var(--muted-foreground); margin-bottom: 1rem; flex-grow: 1; }
.poster-risk { font-size: 0.75rem; font-weight: 700; color: #ca3214; padding: 0.75rem 0; border-top: 1px solid var(--border); }

.sustalium-layer { margin-top: 0.5rem; padding-top: 1rem; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 0.75rem; }
.sustalium-meta-row { display: flex; flex-wrap: wrap; gap: 8px; }
.sustalium-role { font-size: 0.65rem; color: #006039; background: rgba(0, 96, 57, 0.05); padding: 2px 6px; border-radius: 4px; border: 1px solid rgba(0, 96, 57, 0.2); }
.sustalium-registry { font-size: 0.65rem; color: var(--muted-foreground); font-weight: 700; display: flex; align-items: center; }
.sustalium-registry::before { content: "•"; margin-right: 5px; color: #006039; }

.effort-container { display: flex; flex-direction: column; gap: 4px; }
.effort-label { font-size: 0.6rem; font-weight: 800; text-transform: uppercase; color: var(--muted-foreground); letter-spacing: 0.5px; }
.effort-bar-bg { height: 6px; background: var(--muted); border-radius: 3px; overflow: hidden; }

.empty-state { grid-column: 1/-1; text-align: center; padding: 3rem; opacity: 0.5; color: var(--foreground); }
.map-error-state { padding: 3rem; text-align: center; color: #ca3214; }

/* Ensure the automation bars fill their container without inline style needs */
.effort-bar-bg svg {
    display: block;
    width: 100%;
}

/* Materials Tags */
.poster-materials { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 1rem; }
.material-tag { 
    font-size: 0.6rem; font-weight: 700; padding: 2px 8px; border-radius: 4px;
    background: var(--muted); color: var(--muted-foreground); border: 1px solid var(--border);
}

/* Data Intensity Component */
.intensity-container { margin-top: 1rem; }
.intensity-label { font-size: 0.6rem; font-weight: 800; text-transform: uppercase; color: var(--muted-foreground); margin-bottom: 6px; }
.intensity-blocks { display: flex; gap: 4px; }
.i-block { width: 15px; height: 8px; background: var(--muted); border-radius: 2px; }
.i-block.active { background: #006039; }
.dark .i-block.active { background: var(--primary-500); }

.effort-bar-svg {
    display: block;
    width: 100%;
}

/* Subtle Material Color Coding */
.m-tag-1 { background: rgba(59, 130, 246, 0.08); color: #2563eb; border-color: rgba(59, 130, 246, 0.2); } /* Plastics - Blue */
.m-tag-2 { background: rgba(100, 116, 139, 0.08); color: #475569; border-color: rgba(100, 116, 139, 0.2); } /* Metals - Slate */
.m-tag-3 { background: rgba(180, 83, 9, 0.08); color: #b45309; border-color: rgba(180, 83, 9, 0.2); }    /* Wood - Amber */
.m-tag-4 { background: rgba(16, 185, 129, 0.08); color: #059669; border-color: rgba(16, 185, 129, 0.2); } /* Fibers - Green */
.m-tag-5 { background: rgba(139, 92, 246, 0.08); color: #7c3aed; border-color: rgba(139, 92, 246, 0.2); } /* Chemicals - Purple */
.m-tag-6 { background: rgba(234, 179, 8, 0.08); color: #ca8a04; border-color: rgba(234, 179, 8, 0.2); }    /* Electronics - Gold */
.m-tag-7 { background: rgba(249, 115, 22, 0.08); color: #ea580c; border-color: rgba(249, 115, 22, 0.2); }  /* Food - Orange */
.m-tag-8 { background: rgba(107, 114, 128, 0.08); color: #374151; border-color: rgba(107, 114, 128, 0.2); } /* Minerals - Gray */
.m-tag-9 { background: rgba(6, 182, 212, 0.08); color: #0891b2; border-color: rgba(6, 182, 212, 0.2); }   /* Software - Cyan */
.m-tag-10 { background: rgba(120, 53, 15, 0.08); color: #78350f; border-color: rgba(120, 53, 15, 0.2); }  /* Leather - Brown */
.m-tag-11 { background: rgba(14, 165, 233, 0.08); color: #0284c7; border-color: rgba(14, 165, 233, 0.2); } /* Glass - Sky */
.m-tag-12 { background: rgba(225, 29, 72, 0.08); color: #e11d48; border-color: rgba(225, 29, 72, 0.2); }   /* Batteries - Rose */

/* Accessibility: Dark Mode Adjustments for contrast */
.dark .material-tag { background: rgba(255, 255, 255, 0.05); color: var(--foreground); border-color: var(--border); }


.scope-filter-container { margin: 2rem auto; text-align: center; }
.scope-filter-group { display: flex; justify-content: center; gap: 8px; margin-top: 0.5rem; }

.scope-btn {
    background: var(--background); border: 1px solid var(--border); padding: 6px 12px; border-radius: 6px;
    font-size: 0.7rem; font-weight: 700; color: var(--muted-foreground); cursor: pointer; transition: all 0.2s;
}

.scope-btn:hover { border-color: var(--primary-700); color: var(--primary-700); }
.scope-btn.active { background: var(--secondary); color: white; border-color: var(--secondary); }