/* ============================================================
   Werk — components.css
   Navbar, footer, search bar, job card, stat card, pagination,
   charts, tables, filters
   ============================================================ */

/* ---- Navbar ---- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: var(--navbar-height);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--color-text);
    letter-spacing: -0.02em;
}
.navbar-brand:hover { text-decoration: none; }
.navbar-brand img { width: 28px; height: 28px; }

.navbar-toggle {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: 0;
    padding: 0.5rem;
    cursor: pointer;
}
.navbar-toggle span {
    width: 22px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
}

.navbar-links { display: none; }
.navbar-links.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow-md);
}
.navbar-links a {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    color: var(--color-text);
    font-weight: 500;
}
.navbar-links a:hover {
    background: var(--color-bg-alt);
    text-decoration: none;
}
.navbar-links a.is-active {
    color: var(--color-primary);
    font-weight: 700;
}

@media (min-width: 768px) {
    .navbar-toggle { display: none; }
    .navbar-links {
        display: flex;
        gap: 0.25rem;
        position: static;
        padding: 0;
        border: 0;
        box-shadow: none;
    }
}

/* ---- Footer ---- */
.footer {
    background: #111827;
    color: #9ca3af;
    margin-top: 3rem;
    padding: 2.5rem 0 1.5rem;
    font-size: 0.9rem;
}
.footer a { color: #d1d5db; }
.footer h3 { color: #f9fafb; font-size: 1rem; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 0.4rem; }

.footer-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}
@media (min-width: 768px) {
    .footer-grid { grid-template-columns: 2fr 1fr 1.5fr; }
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: space-between;
    border-top: 1px solid #1f2937;
    margin-top: 2rem;
    padding-top: 1rem;
    font-size: 0.85rem;
}

/* ---- Search bar ---- */
.search-bar {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: 1fr;
    background: var(--color-bg);
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}
@media (min-width: 768px) {
    .search-bar {
        grid-template-columns: 1fr 220px auto;
        align-items: center;
    }
}

/* ---- Custom country dropdown (flag-capable replacement for <select>) ---- */
[x-cloak] { display: none !important; }

.country-dd { position: relative; }
.country-dd-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    cursor: pointer;
    text-align: left;
}
.country-dd-current {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.country-dd-current .fi { font-size: 1.1em; flex-shrink: 0; }
.country-dd-caret { font-size: 0.7rem; color: var(--color-text-light); flex-shrink: 0; }

.country-dd-list {
    position: absolute;
    z-index: 50;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 200px;
    max-height: 320px;
    overflow-y: auto;
    margin: 0;
    padding: 0.25rem;
    list-style: none;
    background: var(--color-bg);
    color: var(--color-text); /* don't inherit the hero's white text on the home page */
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}
.country-dd-opt {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.6rem;
    border-radius: var(--radius);
    cursor: pointer;
    white-space: nowrap;
}
.country-dd-label { display: flex; align-items: center; gap: 0.5rem; }
.country-dd-label .fi { font-size: 1.15em; flex-shrink: 0; }
.country-dd-opt.is-active { background: rgba(0, 0, 0, 0.06); }
.country-dd-opt.is-selected { font-weight: 700; }

/* ---- Job card ---- */
.job-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.job-card:hover {
    box-shadow: var(--shadow-md);
    border-color: #d1d5db;
}

.job-card-main {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.job-card-title { margin: 0; font-size: 1.1rem; }
.job-card-title a { color: var(--color-text); }
.job-card-title a:hover { color: var(--color-primary); }

.job-card-company {
    margin: 0;
    font-weight: 600;
    color: var(--color-text-light);
}

.job-card-meta {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    font-size: 0.9rem;
    color: var(--color-text-light);
}
.job-card-salary { color: var(--color-success); font-weight: 600; }

.job-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

@media (min-width: 768px) {
    .job-card {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .job-card-cta { flex-shrink: 0; }
}

/* ---- Stat card ---- */
.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-align: center;
}
.stat-card-icon { font-size: 1.75rem; color: var(--color-primary); line-height: 1; }
.stat-card-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: -0.02em;
}
.stat-card-label { color: var(--color-text-light); font-size: 0.9rem; }
.stat-card-trend { font-size: 0.85rem; font-weight: 700; }
.stat-card-trend.is-up { color: var(--color-success); }
.stat-card-trend.is-down { color: var(--color-danger); }

/* ---- Pagination ---- */
.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 1.5rem;
}
.pagination-link {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    font-weight: 500;
    font-size: 0.95rem;
}
.pagination-link:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary);
    text-decoration: none;
}
.pagination-link.is-current {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}
.pagination-ellipsis { color: var(--color-text-light); padding: 0 0.25rem; }

/* ---- Chart card ---- */
.chart-card { margin-bottom: 1rem; }
.chart-title { margin-bottom: 0.75rem; }
.chart-wrap { position: relative; height: 320px; }
.chart-wrap canvas { width: 100% !important; }

/* ---- Data table ---- */
.data-table { font-size: 0.95rem; }
.data-table th,
.data-table td {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
}
.data-table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-light);
    background: var(--color-bg-alt);
}
.data-table tbody tr:hover { background: var(--color-bg-alt); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Segmented control (time period selector) ---- */
.segmented {
    display: inline-flex;
    flex-wrap: wrap;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-bg);
}
.segmented-item {
    padding: 0.45rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-light);
    border: 0;
    background: none;
    cursor: pointer;
}
.segmented-item:hover { background: var(--color-bg-alt); text-decoration: none; }
.segmented-item.is-active {
    background: var(--color-primary);
    color: #fff;
}

/* ---- Filters sidebar ---- */
.filters .card { padding: 1rem 1.25rem; }
.filters legend { font-size: 0.95rem; }
.filters fieldset {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}
.filters fieldset:last-of-type { border-bottom: 0; }

/* ---- Sidebar info card rows ---- */
.info-list { list-style: none; padding: 0; margin: 0; }
.info-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.4rem 0;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--color-bg-alt);
}
.info-list li:last-child { border-bottom: 0; }
.info-list .label { color: var(--color-text-light); }
.info-list .value { font-weight: 600; text-align: right; }

/* ---- Navbar: Resume Builder product link ---- */
.navbar-links .nav-resume {
    color: var(--color-primary-dark);
    background: var(--color-primary-light);
    font-weight: 600;
    white-space: nowrap;
}
.navbar-links .nav-resume:hover { background: #d9e4f8; }
.navbar-links .nav-resume i { margin-right: 0.3rem; }
@media (min-width: 768px) {
    .navbar-links .nav-resume { margin-left: 0.5rem; }
}

/* ---- Home: resume builder promo banner ---- */
.resume-promo {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    align-items: center;
    gap: 2.5rem;
    background: linear-gradient(150deg, var(--color-primary-dark), var(--color-primary));
    border-radius: var(--radius-lg);
    padding: 2.75rem 3rem;
    color: #fff;
    overflow: hidden;
}
.resume-promo-kicker {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    padding: 0.3rem 0.8rem;
    margin-bottom: 1rem;
}
.resume-promo-copy h2 {
    color: #fff;
    font-size: 1.9rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}
.resume-promo-copy > p {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.1rem;
}
.resume-promo-points {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.resume-promo-points li {
    position: relative;
    padding-left: 1.6rem;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.95rem;
}
.resume-promo-points li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    font-weight: 700;
}
.resume-promo-btn {
    background: #fff;
    color: var(--color-primary-dark);
    font-weight: 700;
    padding: 0.7rem 1.4rem;
}
.resume-promo-btn:hover { background: var(--color-primary-light); color: var(--color-primary-dark); }
.resume-promo-btn i { margin-left: 0.4rem; }

/* CSS-drawn mini resume — a visual, not content (aria-hidden in the markup) */
.resume-promo-visual { display: flex; justify-content: center; }
.promo-doc {
    position: relative;
    width: 240px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    transform: rotate(2.5deg);
}
.promo-doc-head { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.35rem; }
.promo-doc-avatar {
    width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(150deg, var(--color-primary), var(--color-primary-dark));
}
.promo-doc-id { display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.promo-line { display: block; height: 8px; border-radius: 4px; background: #e5e9f0; }
.promo-line-name { width: 75%; height: 10px; background: #c6d2e4; }
.promo-line-sub { width: 50%; }
.promo-line-h { width: 38%; height: 9px; background: var(--color-primary-light); margin-top: 0.35rem; }
.promo-line-short { width: 62%; }
.promo-doc-badge {
    position: absolute;
    right: -12px;
    bottom: 18px;
    background: #157347;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}
.promo-doc-badge i { margin-right: 0.25rem; }

/* animation support (driven by home-promo.js / anime.js) */
.promo-line { transform-origin: left center; }  /* lines "write in" left→right */
.promo-doc.is-floating { animation: promo-float 5.5s ease-in-out infinite; }
@keyframes promo-float {
    0%, 100% { transform: rotate(2.5deg) translateY(0); }
    50%      { transform: rotate(1.2deg) translateY(-9px); }
}
@media (prefers-reduced-motion: reduce) {
    .promo-doc.is-floating { animation: none; }
}

@media (max-width: 820px) {
    .resume-promo { grid-template-columns: 1fr; padding: 2rem 1.5rem; gap: 1.75rem; }
    .resume-promo-visual { display: none; }
}

/* ── Admin-authored banner slot (banner_slot.html + banner-render.js) ── */
.banner-slot {
    display: flex;
    justify-content: center;
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
}
