/* ==========================================================================
   LUXWAVE — Site Web DataRoom — CSS
   Etend luxwave.css pour la navigation web (sidebar, topbar, responsive)
   ========================================================================== */

/* ---------- Layout ---------- */
.site-wrap {
    display: flex;
    min-height: 100vh;
}
.site-main {
    flex: 1;
    margin-left: 260px;
    padding: 72px 32px 40px 32px;
    max-width: 1200px;
}

/* ---------- Topbar ---------- */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #2B80B9;
    color: var(--white);
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.topbar-logo {
    display: flex;
    align-items: center;
    margin-right: 28px;
    text-decoration: none;
}
.topbar-logo:hover { text-decoration: none; }
.topbar-logo-img {
    height: 40px;
    width: auto;
}
.topbar-nav {
    display: flex;
    gap: 4px;
    flex: 1;
}
.topbar-nav a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 9.5pt;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}
.topbar-nav a:hover,
.topbar-nav a.active {
    background: rgba(255,255,255,0.1);
    color: var(--white);
    text-decoration: none;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.topbar-search {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 14pt;
    padding: 4px 8px;
    border-radius: 4px;
}
.topbar-search:hover {
    background: rgba(255,255,255,0.1);
    color: var(--white);
    text-decoration: none;
}
.country-toggle {
    display: flex;
    gap: 2px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    padding: 2px;
}
.country-toggle a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 9pt;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 3px;
    transition: all 0.15s;
}
.country-toggle a:hover { color: var(--white); text-decoration: none; }
.country-toggle a.active {
    background: rgba(255,255,255,0.2);
    color: var(--white);
}

/* ---------- Hamburger (mobile) ---------- */
.hamburger-btn {
    display: none;
    cursor: pointer;
    font-size: 18pt;
    color: rgba(255,255,255,0.8);
    background: none;
    border: none;
    padding: 4px 8px;
    margin-right: 8px;
    -webkit-tap-highlight-color: transparent;
}

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: 260px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    overflow-y: auto;
    padding: 16px 0;
    z-index: 90;
}
.sidebar-section {
    padding: 0 12px;
    margin-bottom: 8px;
}
.sidebar-title {
    font-size: 8pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--gray-500);
    padding: 8px 8px 4px 8px;
}
.sidebar a {
    display: block;
    padding: 5px 8px;
    font-size: 9.5pt;
    color: var(--navy);
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.1s;
    line-height: 1.4;
}
.sidebar a:hover {
    background: var(--cloud);
    text-decoration: none;
}
.sidebar a.active {
    background: var(--cloud);
    font-weight: 600;
    color: var(--blue);
}
.sidebar details { margin: 0; }
.sidebar summary {
    list-style: none;
    cursor: pointer;
    padding: 5px 8px;
    font-size: 9.5pt;
    font-weight: 600;
    color: var(--navy);
    border-radius: 4px;
    transition: background 0.1s;
    user-select: none;
}
.sidebar summary:hover { background: var(--cloud); }
.sidebar summary::-webkit-details-marker { display: none; }
.sidebar summary::before {
    content: "\25B6";
    font-size: 7pt;
    margin-right: 6px;
    display: inline-block;
    transition: transform 0.15s;
}
.sidebar details[open] > summary::before {
    transform: rotate(90deg);
}
.sidebar details .sidebar-sub {
    padding-left: 16px;
}
.sidebar details .sidebar-sub a {
    font-size: 8.5pt;
    padding: 3px 8px;
    color: var(--gray-700);
}
.sidebar .sidebar-count {
    font-size: 7.5pt;
    color: var(--gray-500);
    font-weight: 400;
}
.sidebar .sidebar-icon {
    margin-right: 4px;
}
/* Nested category details inside sidebar */
.sidebar .sidebar-cat {
    margin: 0;
}
.sidebar .sidebar-cat > summary {
    padding: 3px 4px;
    font-size: 8.5pt;
    font-weight: 600;
    color: var(--gray-700);
}
.sidebar .sidebar-cat > summary a {
    display: inline;
    padding: 0;
    font-size: 8.5pt;
    font-weight: 600;
}
.sidebar .sidebar-cat > summary::before {
    font-size: 6pt;
    margin-right: 4px;
}
.sidebar .sidebar-cat > .sidebar-sub {
    padding-left: 12px;
}
.sidebar .sidebar-cat > .sidebar-sub a {
    font-size: 8pt;
    padding: 2px 6px;
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
    font-size: 8.5pt;
    color: var(--gray-500);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-200);
}
.breadcrumbs a {
    color: var(--blue);
    text-decoration: none;
}
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { margin: 0 6px; color: var(--gray-300); }

/* ---------- Page Header ---------- */
.page-title {
    font-size: 24pt;
    font-weight: 800;
    color: var(--navy);
    margin: 0 0 6px 0;
    line-height: 1.15;
}
.page-subtitle {
    font-size: 11pt;
    color: var(--gray-700);
    margin: 0 0 24px 0;
}

/* ---------- KPI Grid (web variant) ---------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

/* ---------- Chart Container (web) ---------- */
.chart-container {
    max-width: 100%;
    margin: 16px 0;
}
.charts-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 20px 0;
}
.chart-box {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 16px;
}

/* ---------- Navigation Grid ---------- */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin: 20px 0;
}
.nav-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 20px;
    text-decoration: none;
    color: var(--navy);
    transition: box-shadow 0.2s, border-color 0.2s;
    display: block;
}
.nav-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: var(--blue);
    text-decoration: none;
}
.nav-card .nav-icon { font-size: 24pt; margin-bottom: 8px; }
.nav-card .nav-title { font-weight: 700; font-size: 12pt; margin-bottom: 4px; }
.nav-card .nav-desc { font-size: 9pt; color: var(--gray-700); }
.nav-card .nav-count { font-size: 8pt; color: var(--gray-500); margin-top: 6px; }

/* ---------- Category Card ---------- */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin: 16px 0;
}
.cat-card {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 16px;
    text-decoration: none;
    color: var(--navy);
    transition: box-shadow 0.2s;
    display: block;
    border-top: 4px solid var(--blue);
}
.cat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    text-decoration: none;
}
.cat-card .cat-icon { font-size: 20pt; }
.cat-card .cat-name { font-weight: 700; font-size: 11pt; margin: 4px 0; }
.cat-card .cat-meta { font-size: 8.5pt; color: var(--gray-700); }

/* ---------- Filter Bar ---------- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    margin-bottom: 16px;
    align-items: center;
}
.filter-bar input,
.filter-bar select {
    font-family: var(--font-main);
    font-size: 9.5pt;
    padding: 6px 10px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    background: var(--white);
    color: var(--navy);
}
.filter-bar input { min-width: 180px; }
.filter-bar select { min-width: 120px; }
.filter-bar input:focus,
.filter-bar select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(21,101,192,0.15);
}
.filter-label {
    font-size: 8pt;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-500);
    letter-spacing: 0.3px;
}

/* ---------- Sortable Table ---------- */
.sortable th {
    cursor: pointer;
    user-select: none;
    position: relative;
}
.sortable th:hover { background: #0d1f3d; }
.sortable th::after {
    content: " \2195";
    font-size: 8pt;
    opacity: 0.4;
}
.sortable th.sort-asc::after { content: " \2191"; opacity: 1; }
.sortable th.sort-desc::after { content: " \2193"; opacity: 1; }

/* ---------- Heatmap Table ---------- */
.heatmap td {
    text-align: center;
    font-size: 8pt;
    padding: 4px 6px;
    font-weight: 600;
}
.heat-5 { background: #1565C0; color: #fff; }
.heat-4 { background: #42A5F5; color: #fff; }
.heat-3 { background: #90CAF9; color: #0A1628; }
.heat-2 { background: #BBDEFB; color: #0A1628; }
.heat-1 { background: #E3F2FD; color: #0A1628; }
.heat-0 { background: var(--gray-100); color: var(--gray-500); }

/* ---------- Search Page ---------- */
.search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}
.search-box input {
    flex: 1;
    font-family: var(--font-main);
    font-size: 12pt;
    padding: 12px 16px;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    color: var(--navy);
}
.search-box input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(21,101,192,0.15);
}
.search-results { margin-top: 16px; }
.search-result {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
    transition: border-color 0.15s;
}
.search-result:hover { border-color: var(--blue); }
.search-result a {
    font-weight: 700;
    font-size: 11pt;
    color: var(--navy);
    text-decoration: none;
}
.search-result a:hover { color: var(--blue); }
.search-result .result-type {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 7.5pt;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 8px;
    vertical-align: middle;
}
.result-type-sector { background: #E3F2FD; color: var(--blue); }
.result-type-partner { background: #E8F5E9; color: var(--green); }
.result-type-page { background: #FFF3E0; color: var(--amber); }
.search-result .result-snippet {
    font-size: 9pt;
    color: var(--gray-700);
    margin-top: 4px;
}
.search-count {
    font-size: 9pt;
    color: var(--gray-500);
    margin-bottom: 12px;
}

/* ---------- Two Column Layout ---------- */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* ---------- Section Divider ---------- */
.section-divider {
    margin: 32px 0 20px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gray-200);
}

/* ---------- Site Footer ---------- */
.site-footer {
    border-top: 1px solid var(--gray-200);
    padding: 16px 0;
    margin-top: 40px;
    font-size: 7.5pt;
    color: var(--gray-500);
    text-align: center;
}

/* ---------- Spec Grid ---------- */
.spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin: 16px 0;
}
.spec-card {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 16px;
}
.spec-card .spec-label {
    font-size: 8pt;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-500);
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}
.spec-card .spec-value {
    font-size: 14pt;
    font-weight: 700;
    color: var(--navy);
}

/* ---------- Product Card ---------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin: 16px 0;
}
.product-card {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid var(--blue);
}
.product-card .product-name {
    font-weight: 700;
    font-size: 11pt;
    color: var(--navy);
    margin-bottom: 4px;
}
.product-card .product-desc {
    font-size: 9pt;
    color: var(--gray-700);
    margin-bottom: 6px;
}
.product-card .product-meta {
    font-size: 8pt;
    color: var(--gray-500);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .hamburger-btn { display: block; }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }
    .sidebar.sidebar-open {
        transform: translateX(0);
    }
    .site-overlay {
        position: fixed;
        inset: 56px 0 0 0;
        background: rgba(0,0,0,0.4);
        z-index: 85;
    }
    .site-main {
        margin-left: 0;
        padding: 68px 16px 32px 16px;
    }
    .topbar-nav { display: none; }
    .topbar-logo { margin-right: 8px; }
    .two-col { grid-template-columns: 1fr; }
    .charts-row { grid-template-columns: 1fr; }
    /* Tables scroll horizontally */
    .data-table-wrap,
    table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .filter-bar { flex-direction: column; }
    .filter-bar input, .filter-bar select { min-width: 100%; }
}

@media (max-width: 600px) {
    .topbar { padding: 0 10px; }
    .topbar-logo-img { height: 30px; }
    .topbar-right { gap: 4px; }
    .country-toggle a { padding: 4px 6px; font-size: 8pt; }
    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .cat-grid { grid-template-columns: 1fr; }
    .nav-grid { grid-template-columns: 1fr; }
    .page-title { font-size: 18pt; }
    .scenario-grid { grid-template-columns: 1fr; }
    .spec-grid { grid-template-columns: 1fr; }
    .product-grid { grid-template-columns: 1fr; }
    .search-box { flex-direction: column; }
    .search-box input { min-width: 0; }
}

/* ---------- Risk badges ---------- */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: .85em;
    font-weight: 600;
    white-space: nowrap;
}
.badge-red    { background: #fde8e8; color: #c62828; }
.badge-amber  { background: #fff3e0; color: #e65100; }
.badge-green  { background: #e8f5e9; color: #2e7d32; }

/* ---------- Treemap tooltip card ---------- */
.treemap-tooltip {
    width: 250px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,.18);
    font-family: Inter, system-ui, sans-serif;
    font-size: 12px;
    overflow: hidden;
    z-index: 100;
    transition: opacity .15s;
}
.treemap-tooltip .tt-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    color: #fff;
    font-weight: 700;
    font-size: 11px;
}
.treemap-tooltip .tt-icon { font-size: 16px; }
.treemap-tooltip .tt-cat  { flex: 1; }
.treemap-tooltip .tt-prio {
    background: rgba(255,255,255,.25);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
}
.treemap-tooltip .tt-name {
    padding: 8px 10px 4px;
    font-weight: 700;
    font-size: 13px;
    color: #0A1628;
}
.treemap-tooltip .tt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 0 10px 10px;
}
.treemap-tooltip .tt-item {
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f0;
}
.treemap-tooltip .tt-item:nth-last-child(-n+2) { border-bottom: none; }
.treemap-tooltip .tt-label {
    font-size: 9px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.treemap-tooltip .tt-val {
    font-size: 12px;
    font-weight: 600;
    color: #1a1a1a;
}

/* ---------- Info Tooltip ---------- */
.info-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--blue);
    color: #fff;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 700;
    cursor: help;
    margin-left: 4px;
    vertical-align: middle;
    line-height: 1;
}
.info-tooltip .info-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 8.5pt;
    font-weight: 400;
    line-height: 1.4;
    white-space: normal;
    width: 260px;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 200;
    transition: opacity 0.15s, visibility 0.15s;
    pointer-events: none;
}
.info-tooltip .info-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1a1a1a transparent transparent transparent;
}
.info-tooltip:hover .info-text {
    visibility: visible;
    opacity: 1;
}

/* ---------- Activity Markdown content ---------- */
.activity-md {
    font-size: 9pt;
    color: var(--gray-700);
    line-height: 1.55;
    padding: 8px 12px;
    background: var(--gray-50);
    border-radius: 6px;
    border: 1px solid var(--gray-200);
}
.activity-md p { margin: 0 0 6px 0; }
.activity-md p:last-child { margin-bottom: 0; }
.activity-md ul, .activity-md ol {
    margin: 4px 0 6px 0;
    padding-left: 18px;
}
.activity-md li { margin-bottom: 2px; }
.activity-md h1, .activity-md h2, .activity-md h3 {
    font-size: 10pt;
    font-weight: 700;
    color: var(--navy);
    margin: 8px 0 4px 0;
}
.activity-md h1:first-child,
.activity-md h2:first-child,
.activity-md h3:first-child { margin-top: 0; }
.activity-md strong { color: var(--navy); }
.activity-md a { color: var(--blue); text-decoration: none; }
.activity-md a:hover { text-decoration: underline; }
.activity-md blockquote {
    margin: 6px 0;
    padding: 4px 10px;
    border-left: 3px solid var(--blue);
    background: rgba(21,101,192,0.04);
    color: var(--gray-600);
    font-style: italic;
}
.activity-md code {
    font-size: 8.5pt;
    background: var(--gray-200);
    padding: 1px 4px;
    border-radius: 3px;
}
.activity-md pre {
    background: var(--navy);
    color: #e2e8f0;
    padding: 10px 12px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 8.5pt;
    margin: 6px 0;
}
.activity-md pre code {
    background: none;
    padding: 0;
    color: inherit;
}
.activity-md table {
    width: 100%;
    border-collapse: collapse;
    font-size: 8.5pt;
    margin: 6px 0;
}
.activity-md th, .activity-md td {
    border: 1px solid var(--gray-200);
    padding: 4px 8px;
    text-align: left;
}
.activity-md th {
    background: var(--navy);
    color: var(--white);
    font-weight: 600;
}
.activity-outcome {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

/* ---------- Override print styles for web ---------- */
@media screen {
    .page-break { page-break-before: unset; }
    .sector-page { page-break-before: unset; }
    .cover { min-height: auto; page-break-after: unset; }
    .toc { page-break-after: unset; }
}
