/* ============================================================
   Finunite Compliance Screening Stylesheet
   Consistent with the shared frontpage genre (Bootstrap 5)
   ============================================================ */

body {
    font-family: 'Inter', 'Noto Sans SC', 'Segoe UI', 'Microsoft YaHei', sans-serif;
    padding-top: 76px;
    background-color: #f0f2f5;
}

/* --- Hero section (frontpage style) --- */
.hero-section {
    background-color: #f8f9fa;
    padding: 3rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
}

.hero-section h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.2;
}

.hero-section .lead {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
}

/* --- Page header (replaces colored card-header for result page) --- */
.page-header {
    background-color: #f8f9fa;
    padding: 1.5rem 2rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #0d6efd;
}

.page-header h2 {
    margin-bottom: 0.25rem;
    font-weight: 600;
}

/* --- Card refinements (frontpage style) --- */
.card {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.card-header {
    border-bottom: 1px solid #e9ecef;
    background-color: #fff;
    padding: 1rem 1.25rem;
}

.card-header h5 {
    margin-bottom: 0;
    font-weight: 600;
}

/* --- Table refinements --- */
.table-borderless td {
    padding: 0.625rem 0;
}

.table-borderless tr:not(:last-child) td {
    border-bottom: 1px solid #f0f0f0;
}

/* --- Alert refinements --- */
.alert {
    border-radius: 0.5rem;
    border: none;
}

/* --- Navbar brand refinements --- */
.navbar-brand img {
    object-fit: contain;
}
.navbar-brand small {
    font-weight: 400;
    font-size: 0.8rem;
}
/* --- Footer --- */
footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

/* --- Touch-optimized controls for mobile --- */
@media (pointer: coarse) {
    .form-select, .form-control, .btn {
        min-height: 48px;
    }
}

/* --- Methodology steps timeline --- */
.methodology-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background-color: #0d6efd;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.step-body {
    flex: 1;
    padding-top: 0.15rem;
}

.step-body h6 {
    margin-bottom: 0.25rem;
    font-weight: 600;
}

/* --- Dimension cards --- */
.dimension-card {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    height: 100%;
    transition: box-shadow 0.15s ease;
}

.dimension-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.dimension-card h6 {
    font-weight: 600;
}

/* --- Risk level cards --- */
.risk-level-card {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    height: 100%;
    background-color: #fff;
}

.risk-level-icon {
    margin-bottom: 0.75rem;
}

.level-low {
    border-top: 4px solid #198754;
}

.level-medium {
    border-top: 4px solid #ffc107;
}

.level-high {
    border-top: 4px solid #dc3545;
}

/* --- Risk Map --- */
.map-card {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    overflow: hidden;
}

.map-layout {
    display: flex;
    flex-direction: row;
    min-height: clamp(350px, 60vh, 600px);
}

.map-col {
    flex: 3;
    min-width: 0;
}

.side-col {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #e9ecef;
}

.risk-map-container {
    height: 100%;
    width: 100%;
    min-height: clamp(350px, 60vh, 600px);
    background-color: #ffffff;
}

/* ---- Side panel (risk data) ---- */
.risk-side-panel-data {
    flex: 1;
    padding: 0.8rem 1rem;
    color: #212529;
    font-size: 0.85rem;
    overflow-y: auto;
}

.side-loading {
    color: #6c757d;
    font-size: 0.85rem;
    padding: 1rem 0;
    text-align: center;
}

.side-panel-header {
    margin-bottom: 0.6rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.side-country-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.3rem;
}

.side-main-score {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.side-main-score .score-value {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.1;
}

.side-main-score .score-unit {
    font-size: 0.9rem;
    color: #6c757d;
}

.side-main-score .score-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-left: 0.25rem;
}

.side-summary {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #dee2e6;
    font-size: 0.85rem;
    color: #495057;
    line-height: 1.5;
}

/* ---- Static legend bar (below card-header, above map) ---- */
.map-legend-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    padding: 0.4rem 1rem;
    background-color: #ffffff;
    border-top: 1px solid #e9ecef;
    font-size: 0.82rem;
    align-items: center;
}

.map-legend-bar .legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #495057;
    white-space: nowrap;
}

.map-legend-bar .legend-item i {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ---- Hint bar (above legend, below header) ---- */
.map-hint-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem;
    background-color: #f0f8ff;
    border-top: 1px solid #d0d7de;
    font-size: 0.8rem;
    color: #000000;
}

/* Mobile: stack map above side panel */
@media (max-width: 767.98px) {
    .map-layout {
        flex-direction: column;
    }
    .side-col {
        max-width: none;
        border-left: none;
        border-top: 1px solid #e9ecef;
    }
    .risk-map-container {
        min-height: clamp(250px, 45vh, 400px);
    }
    .map-legend-bar {
        gap: 0.15rem 0.5rem;
        font-size: 0.7rem;
    }
}

.dimension-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.dim-btn {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    background-color: #f8f9fa;
    color: #495057;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dim-btn:hover {
    background-color: #e9ecef;
}

.dim-btn.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.dim-btn:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Visually hidden for screen reader announcements */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Color dot in info panel rows */
.color-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    margin-right: 4px;
    vertical-align: middle;
}

/* ---- Info panel ---- */
.risk-info-panel {
    background: #1a1a2e;
    color: #e0e0e0;
    padding: 0.8rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.risk-info-panel .info-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.4rem;
}

.risk-info-panel .info-table {
    width: 100%;
    border-collapse: collapse;
}

.risk-info-panel .info-table td {
    padding: 0.15rem 0;
    font-size: 0.8rem;
}

.risk-info-panel .info-table td:first-child {
    color: #9e9e9e;
    padding-right: 0.75rem;
}

.risk-info-panel .info-table td:last-child {
    text-align: right;
}

.risk-info-panel .info-summary {
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.78rem;
    color: #bdbdbd;
    line-height: 1.4;
}

/* Touch-optimized dimension buttons on mobile */
@media (pointer: coarse) {
    .dim-btn {
        min-height: 40px;
        padding: 0.4rem 0.8rem;
    }
}

/* Mobile adjustments */
@media (max-width: 576px) {
    .risk-map-container {
        height: clamp(250px, 45vh, 400px);
    }
    .risk-info-panel {
        font-size: 0.78rem;
        padding: 0.6rem 0.75rem;
    }
}

/* --- Print-friendly --- */
@media print {
    .navbar, footer, .btn-outline-primary {
        display: none !important;
    }
    body {
        padding-top: 0;
        background-color: #fff;
    }
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    .risk-map-container {
        height: 400px !important;
    }
}
