/* ==================== NIS2 STATUS TRACKER ==================== */

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
    padding: 40px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
}
.stat-item {
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.3s ease;
}
.stat-item:hover { transform: translateY(-2px); }
.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s ease;
}
.stat-icon.active  { background: rgba(39, 174, 96, 0.1); }
.stat-icon.pending { background: rgba(243, 156, 18, 0.1); }
.stat-icon.stricter { background: rgba(131, 159, 159, 0.12); }
.stat-icon svg { width: 24px; height: 24px; }
.stat-icon.active svg   { color: var(--low-green); }
.stat-icon.pending svg  { color: var(--medium-amber); }
.stat-icon.stricter svg { color: var(--brand-teal-dark); }
.stat-item:hover .stat-icon.active   { background: var(--low-green); }
.stat-item:hover .stat-icon.pending  { background: var(--medium-amber); }
.stat-item:hover .stat-icon.stricter { background: var(--brand-teal); }
.stat-item:hover .stat-icon svg { color: var(--white); }
.stat-number {
    font-family: "Space Mono", monospace;
    font-size: 2rem; font-weight: 700;
    color: var(--brand-navy); line-height: 1;
}
.stat-label {
    font-size: 0.82rem; color: var(--gray-500);
    font-weight: 500; margin-top: 4px;
}

/* ── Controls ─────────────────────────────────────── */
.controls-section {
    padding: 28px 40px;
    background: var(--section-bg);
    border-bottom: 1px solid var(--gray-200);
}
.controls {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Search bar (full width, centered) */
.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 480px;
    align-self: center;
}
.search-icon {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    width: 17px; height: 17px;
    color: var(--gray-400);
    pointer-events: none;
}
.search-input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    font-size: 0.95rem; font-family: inherit;
    color: var(--brand-navy);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 10px; outline: none;
    box-shadow: 0 1px 4px rgba(66,83,105,.05);
    transition: border-color .2s, box-shadow .2s;
}
.search-input::placeholder { color: var(--gray-400); }
.search-input:focus {
    border-color: var(--brand-teal);
    box-shadow: 0 0 0 3px rgba(131,159,159,.15);
}

/* Single filter row — everything inline */
.filter-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Vertical divider between groups */
.filter-divider {
    width: 1px; height: 24px;
    background: var(--gray-200);
    flex-shrink: 0;
    margin: 0 4px;
}

/* Tab group pill container */
.filter-tabs {
    display: inline-flex;
    align-items: center;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
    box-shadow: 0 1px 3px rgba(66,83,105,.06);
}

/* Individual tab button */
.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    font-size: 0.875rem; font-weight: 500;
    color: var(--gray-500);
    background: transparent;
    border: none; border-radius: 7px;
    cursor: pointer;
    transition: all .2s ease;
    font-family: inherit;
    white-space: nowrap;
    line-height: 1;
}
.filter-tab:hover { color: var(--brand-navy); background: var(--gray-100); }
.filter-tab.active {
    color: var(--white);
    background: var(--brand-teal);
    font-weight: 600;
}

/* Count pill (status tabs) */
.filter-tab .count {
    display: inline-flex;
    align-items: center; justify-content: center;
    min-width: 20px; height: 20px;
    padding: 0 5px;
    font-size: 0.72rem; font-weight: 700;
    background: rgba(66,83,105,.1);
    border-radius: 10px;
}
.filter-tab.active .count {
    background: rgba(255,255,255,.25);
    color: var(--white);
}

/* Year count (small muted number) */
.yr-count {
    font-size: 0.72rem;
    color: var(--gray-400);
    font-weight: 600;
}
.filter-tab.active .yr-count {
    color: rgba(255,255,255,.75);
}

/* Status indicator dots */
.status-dot-filter {
    width: 7px; height: 7px;
    border-radius: 50%; flex-shrink: 0;
}
.green-dot { background: var(--low-green); }
.amber-dot { background: var(--medium-amber); }

/* Stricter toggle — looks different from the tab groups (it's a toggle, not a filter) */
.stricter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 0.875rem; font-weight: 600;
    font-family: inherit;
    color: var(--brand-teal-dark);
    background: var(--white);
    border: 1.5px solid var(--brand-teal);
    border-radius: 10px;
    cursor: pointer;
    transition: all .2s ease;
    white-space: nowrap;
}
.stricter-toggle:hover {
    background: var(--brand-teal-bg);
}
.stricter-toggle.active {
    background: var(--brand-teal);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(131,159,159,.25);
}
.stricter-toggle svg { flex-shrink: 0; }

/* ── Country Grid ────────────────────────── */
.grid-section {
    padding: 56px 40px 100px;
    background: var(--white);
}
.country-grid {
    max-width: 1300px; margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(370px, 1fr));
    gap: 20px;
}

/* ── Country Card ────────────────────────── */
.country-card {
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all .25s ease;
    position: relative;
    overflow: hidden;
    animation: fadeInUp .4s ease forwards;
    opacity: 0;
}
.country-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--brand-teal), var(--brand-teal-light));
    opacity: 0;
    transition: opacity .25s ease;
}
.country-card:hover {
    border-color: var(--brand-teal);
    box-shadow: 0 8px 28px rgba(131,159,159,.12);
    transform: translateY(-3px);
}
.country-card:hover::before,
.country-card.expanded::before { opacity: 1; }
.country-card.expanded {
    border-color: var(--brand-teal);
    box-shadow: 0 8px 28px rgba(131,159,159,.12);
}

/* Card header: [flag] [country-info flex:1] [status-badge] */
.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}
.country-flag { font-size: 32px; line-height: 1; flex-shrink: 0; }
.country-info {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 4px;
}
.country-name {
    font-size: 1.1rem; font-weight: 700;
    color: var(--brand-navy);
}

/* Strictness — sub-label under the name, NOT a status */
.strictness-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.65rem; font-weight: 700;
    color: var(--brand-teal-dark);
    background: var(--brand-teal-bg);
    border-radius: 4px;
    padding: 2px 7px;
    width: fit-content;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Status badge — right side, single source of truth */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.72rem; font-weight: 700;
    border-radius: 8px; flex-shrink: 0;
    text-transform: uppercase; letter-spacing: 0.4px;
}
.status-badge.in-force { background: rgba(39,174,96,.1); color: var(--low-green); }
.status-badge.pending  { background: rgba(243,156,18,.1); color: var(--medium-amber); }
.status-dot-small {
    width: 7px; height: 7px;
    border-radius: 50%; background: currentColor;
}

/* Card meta */
.card-meta { display: flex; gap: 24px; flex-wrap: wrap; }
.meta-item { display: flex; flex-direction: column; gap: 4px; }
.meta-label {
    font-size: 0.68rem; color: var(--gray-500);
    text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600;
}
.meta-value { font-size: 0.95rem; color: var(--brand-navy); font-weight: 600; }

/* Expanded details */
.card-details {
    max-height: 0; overflow: hidden;
    transition: max-height .4s cubic-bezier(.4,0,.2,1);
}
.country-card.expanded .card-details { max-height: 340px; }
.details-content {
    padding-top: 18px; margin-top: 18px;
    border-top: 1px solid var(--gray-200);
}
.details-description {
    font-size: 0.88rem; color: var(--gray-600);
    line-height: 1.65; margin-bottom: 12px;
}

/* Source links — plain text, consistent */
.source-link,
.card-details a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem; font-weight: 500;
    color: var(--brand-teal-dark);
    text-decoration: none;
    transition: color .2s;
}
.source-link::before,
.card-details a::before {
    content: "↗";
    font-size: 0.78em; opacity: 0.65;
}
.source-link:hover,
.card-details a:hover {
    color: var(--brand-navy);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Expand indicator */
.expand-indicator {
    display: flex; align-items: center; justify-content: center;
    margin-top: 16px; padding-top: 14px;
    border-top: 1px dashed var(--gray-200);
}
.expand-text {
    font-size: 0.78rem; color: var(--gray-400);
    display: flex; align-items: center; gap: 5px;
    font-weight: 500; user-select: none;
}
.expand-icon {
    width: 15px; height: 15px; color: var(--gray-400);
    transition: transform .3s ease;
}
.country-card.expanded .expand-icon { transform: rotate(180deg); }

/* Empty state */
.empty-state { text-align: center; padding: 80px 24px; color: var(--gray-500); }
.empty-state svg { width: 52px; height: 52px; margin-bottom: 16px; opacity: .3; color: var(--brand-teal); }
.empty-state p { font-size: 0.95rem; }

/* ── Mobile ──────────────────────────────── */
@media (max-width: 768px) {
    .stats-bar { padding: 24px 16px; gap: 12px; flex-direction: column; }
    .stat-item {
        padding: 12px 16px;
        background: var(--section-bg);
        border-radius: 10px; border: 1px solid var(--gray-200);
    }
    .stat-number { font-size: 1.6rem; }
    .controls-section { padding: 20px 16px; }
    .search-wrapper { max-width: 100%; }
    .filter-row { justify-content: flex-start; gap: 6px; }
    .filter-divider { display: none; }
    .filter-tabs { flex-wrap: wrap; }
    .filter-tab { padding: 6px 10px; font-size: 0.82rem; }
    .filter-tab .count { display: none; }
    .grid-section { padding: 32px 16px 80px; }
    .country-grid { grid-template-columns: 1fr; gap: 14px; }
    .country-card { padding: 18px; border-radius: 12px; }
    .country-flag { font-size: 28px; }
    .country-name { font-size: 1rem; }
    .status-badge { padding: 5px 10px; font-size: 0.68rem; }
    .card-meta { gap: 16px; }
}
@media (max-width: 400px) {
    .card-header { flex-wrap: wrap; }
    .status-badge { order: 3; width: 100%; justify-content: center; margin-top: 4px; }
}
