/* ================================================
   databaze-prace.cz – Design System
   Fonts: Manrope (headlines) + Plus Jakarta Sans (body)
   Primary #2E3192 | Secondary #00D2FF | Tertiary #98FFD9
================================================ */

:root {
    --primary:        #2E3192;
    --primary-dark:   #1e2270;
    --primary-light:  #4B4EC7;
    --secondary:      #00D2FF;
    --tertiary:       #98FFD9;
    --bg:             #F5F6FA;
    --bg-card:        #FFFFFF;
    --text-primary:   #111827;
    --text-secondary: #6B7280;
    --text-muted:     #9CA3AF;
    --border:         #E5E7EB;
    --shadow-sm:      0 1px 3px rgba(0,0,0,.06);
    --shadow-md:      0 4px 12px rgba(0,0,0,.08);
    --radius:         14px;
    --radius-sm:      8px;
    --radius-xs:      6px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; overflow-x: hidden; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ================================================
   HEADER
================================================ */
.gh {
    background: var(--gh-bg, #fff);
    border-bottom: 1px solid var(--gh-border, rgba(0,0,0,.08));
    box-shadow: 0 1px 8px rgba(0,0,0,.05);
    position: sticky;
    top: 0;
    z-index: 9000;
    height: 52px;
}

.gh-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.25rem;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 0;
}

.gh-logo {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    font-size: .9rem;
    color: var(--gh-text, #0f172a);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.gh-logo img {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    flex-shrink: 0;
}

.gh-divider {
    width: 1px;
    height: 20px;
    background: var(--gh-border, rgba(0,0,0,.12));
    margin: 0 1rem;
    flex-shrink: 0;
}

.gh-nav { display: flex; align-items: center; }

.gh-nav-row { display: flex; align-items: center; gap: .25rem; }

.gh-link {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: .82rem;
    font-weight: 500;
    color: var(--gh-link, #475569);
    text-decoration: none;
    padding: .4rem .6rem;
    border-radius: 6px;
    transition: background .15s, color .15s;
    white-space: nowrap;
}

.gh-link:hover {
    background: var(--gh-link-hover-bg, rgba(0,0,0,.05));
    color: var(--gh-text, #0f172a);
}

.gh-spacer { flex: 1; }

.gh-actions {
    display: flex;
    align-items: center;
    gap: .35rem;
}

.gh-dark-btn {
    height: 34px;
    padding: 0 .65rem;
    border: 1px solid var(--gh-border, rgba(0,0,0,.1));
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: .35rem;
    color: var(--gh-link, #475569);
    transition: background .15s, border-color .15s;
}

.gh-dark-btn:hover {
    background: var(--gh-link-hover-bg, rgba(0,0,0,.05));
}

/* Hamburger — skrytý na desktopu */
.gh-hamburger { display: none; }

/* ── Dark mode ── */
[data-theme="dark"] {
    --gh-bg:            #0f172a;
    --gh-border:        rgba(255,255,255,.08);
    --gh-text:          #f1f5f9;
    --gh-link:          #94a3b8;
    --gh-link-hover-bg: rgba(255,255,255,.07);
}

[data-theme="dark"] body {
    --bg:             #0f1624;
    --bg-card:        #1a2235;
    --text-primary:   #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted:     #64748b;
    --border:         rgba(255,255,255,.1);
}

/* Mobilní hamburger menu */
@media (max-width: 768px) {
    .gh-divider { display: none; }

    .gh-nav {
        display: none;
        position: absolute;
        top: 52px;
        left: 0;
        right: 0;
        background: var(--gh-bg, #fff);
        border-bottom: 1px solid var(--gh-border, rgba(0,0,0,.08));
        padding: .75rem 1.25rem;
        box-shadow: 0 4px 12px rgba(0,0,0,.08);
        animation: gh-slide-in .18s ease;
    }

    .gh-nav.is-open { display: flex; }

    .gh-nav-row { flex-direction: column; align-items: flex-start; width: 100%; }

    .gh-link { width: 100%; padding: .6rem .75rem; }

    .gh-hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 34px;
        height: 34px;
        border: 1px solid var(--gh-border, rgba(0,0,0,.1));
        border-radius: 8px;
        background: transparent;
        cursor: pointer;
        padding: 0 7px;
    }

    .gh-hamburger span {
        display: block;
        height: 2px;
        background: var(--gh-link, #475569);
        border-radius: 2px;
        transition: all .2s;
    }

    .gh-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .gh-hamburger.is-open span:nth-child(2) { opacity: 0; }
    .gh-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

@keyframes gh-slide-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Stará třída .logo pro zpětnou kompatibilitu */
.logo { display: none; }

/* ================================================
   PAGE LAYOUT — two-column
================================================ */
.page-body {
    flex: 1;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.75rem;
    align-items: start;
}

/* ================================================
   FILTERS SIDEBAR
================================================ */
.filters-sidebar {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    padding: 1.1rem 1rem 1.1rem;
    position: sticky;
    top: 72px;
}

.filters-heading {
    margin-bottom: .9rem;
}

.filters-heading h2 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    font-size: .95rem;
    color: var(--text-primary);
    margin-bottom: .1rem;
}

.filters-heading p {
    font-size: .75rem;
    color: var(--text-muted);
}

.filter-item {
    padding: .6rem 0;
    border-top: 1px solid var(--border);
}

.filter-item:first-of-type {
    border-top: none;
    padding-top: 0;
}

.filter-item-label {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin-bottom: .4rem;
}

.filter-icon {
    width: 20px;
    height: 20px;
    background: rgba(46, 49, 146, .1);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary);
}

.filter-icon svg { width: 11px; height: 11px; }

.filter-item-name {
    font-size: .72rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.filter-body {
    padding: 0;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: .45rem .6rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xs);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: .835rem;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: border-color .2s;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-card);
}

.filter-input::placeholder { color: var(--text-muted); }

.filter-salary-row {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.btn-apply-filters {
    display: block;
    width: 100%;
    margin: .9rem 0 0;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: .65rem 1rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    font-size: .875rem;
    cursor: pointer;
    transition: background .2s;
    text-align: center;
}

.btn-apply-filters:hover { background: var(--primary-light); }

.btn-reset-filters {
    display: block;
    width: 100%;
    margin: .35rem 0 0;
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: .35rem 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: .8rem;
    cursor: pointer;
    text-align: center;
    transition: color .2s;
}

.btn-reset-filters:hover { color: var(--text-primary); }

/* ================================================
   JOBS MAIN COLUMN
================================================ */
.jobs-column {}

.jobs-column-header {
    margin-bottom: 1.25rem;
}

.jobs-column-header h1 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 800;
    font-size: 1.75rem;
    letter-spacing: -.03em;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: .3rem;
}

.jobs-column-header h1 .accent {
    color: var(--primary);
    font-style: italic;
}

.jobs-column-header p {
    color: var(--text-secondary);
    font-size: .9rem;
}

.results-info {
    font-size: .875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.results-info strong { color: var(--text-primary); font-weight: 600; }

/* ================================================
   JOB CARDS
================================================ */
.jobs-list {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.job-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: border-color .18s, box-shadow .18s, transform .15s;
}

.job-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.job-avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    flex-shrink: 0;
    user-select: none;
}

.job-card-body { flex: 1; min-width: 0; }

.job-badges {
    display: flex;
    gap: .3rem;
    margin-bottom: .25rem;
    flex-wrap: wrap;
}

.badge {
    font-size: .67rem;
    font-weight: 700;
    padding: .15rem .5rem;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: .05em;
    line-height: 1.5;
}

.badge-new  { background: var(--tertiary);  color: #065f46; }
.badge-type { background: #ede9fe;          color: var(--primary); }

.job-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    font-size: .975rem;
    color: var(--text-primary);
    margin-bottom: .2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.job-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.job-meta-item {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .8rem;
    color: var(--text-secondary);
}

.job-meta-item svg { width: 12px; height: 12px; flex-shrink: 0; opacity: .7; }
.job-salary-val { font-weight: 600; color: var(--text-primary); }

.btn-view-detail {
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xs);
    padding: .5rem 1.05rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    font-size: .82rem;
    color: var(--text-primary);
    cursor: pointer;
    white-space: nowrap;
    transition: background .18s, border-color .18s, color .18s;
    flex-shrink: 0;
}

.btn-view-detail:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* State messages */
.state-message {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
    font-size: .95rem;
}

.state-message.error { color: #dc2626; }

/* ================================================
   PAGINATION
================================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .35rem;
    margin-top: 1.75rem;
    flex-wrap: wrap;
}

.pagination button {
    min-width: 34px;
    height: 34px;
    padding: 0 .5rem;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-xs);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: .85rem;
    cursor: pointer;
    transition: all .18s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.pagination button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pagination button.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pagination button:disabled { opacity: .35; cursor: not-allowed; }
.pagination span { color: var(--text-muted); font-size: .9rem; padding: 0 .15rem; }

/* ================================================
   FOOTER — light
================================================ */
.footer {
    background: #fff;
    border-top: 1px solid var(--border);
    padding: 1.75rem 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: .82rem;
    margin-top: auto;
}

/* ================================================
   DETAIL PAGE
================================================ */
.detail-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    transition: color .2s;
}

.back-link:hover { color: var(--primary); }

.detail-header-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.detail-header-left {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    flex: 1;
    min-width: 0;
}

.detail-avatar {
    width: 58px;
    height: 58px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: #fff;
    flex-shrink: 0;
}

.detail-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 800;
    font-size: clamp(1.4rem, 3vw, 1.85rem);
    color: var(--text-primary);
    letter-spacing: -.025em;
    line-height: 1.2;
    margin: .3rem 0 .5rem;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .85rem;
}

.detail-meta-item {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .875rem;
    color: var(--text-secondary);
}

.detail-meta-item svg { width: 14px; height: 14px; opacity: .7; }

.detail-header-right {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
}

.btn-apply {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-sm);
    padding: .72rem 1.5rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    font-size: .92rem;
    transition: background .2s;
    display: inline-block;
}

.btn-apply:hover { background: var(--primary-light); }

.detail-columns {
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 1.5rem;
    align-items: start;
}

.detail-main { display: flex; flex-direction: column; gap: 1.5rem; }

.detail-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem 2rem;
}

.section-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.1rem;
}

.section-title::before {
    content: '';
    display: block;
    width: 18px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    flex-shrink: 0;
}

.detail-description {
    font-size: .93rem;
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-line;
}

.detail-tags { display: flex; flex-wrap: wrap; gap: .5rem; }

.detail-tag {
    background: #ede9fe;
    color: var(--primary);
    padding: .3rem .8rem;
    border-radius: 50px;
    font-size: .8rem;
    font-weight: 600;
}

.detail-sidebar { display: flex; flex-direction: column; gap: 1.25rem; }

.key-info-card,
.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.35rem 1.5rem;
}

.key-info-card h3,
.contact-card h3 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    font-size: .93rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border);
}

.key-info-grid { display: flex; flex-direction: column; gap: .85rem; }

.key-info-item { display: flex; align-items: flex-start; gap: .7rem; }

.key-info-icon {
    width: 30px;
    height: 30px;
    background: var(--bg);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary);
}

.key-info-icon svg { width: 14px; height: 14px; }

.key-info-label {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    margin-bottom: .08rem;
}

.key-info-value { font-size: .88rem; font-weight: 600; color: var(--text-primary); }

.contact-list { display: flex; flex-direction: column; gap: .75rem; }
.contact-entry { font-size: .875rem; line-height: 1.6; }
.contact-name { font-weight: 600; color: var(--text-primary); margin-bottom: .1rem; }

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: var(--primary);
    text-decoration: none;
    font-size: .83rem;
    margin-right: .75rem;
}

.contact-link:hover { text-decoration: underline; }
.contact-link svg { width: 12px; height: 12px; }

/* ================================================
   RESPONSIVE
================================================ */

/* ── Detail page ── */
@media (max-width: 860px) {
    .detail-columns { grid-template-columns: 1fr; }
    .detail-sidebar { order: -1; }
    .key-info-grid { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
    .detail-header-card {
        flex-direction: column;
        gap: 1rem;
    }
    .detail-header-right { width: 100%; }
    .btn-apply { width: 100%; text-align: center; }
}

/* ── Mobile filter toggle button ── */
.mobile-filter-toggle {
    display: none;
    align-items: center;
    gap: .45rem;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .55rem 1rem;
    font-weight: 600;
    font-size: .875rem;
    cursor: pointer;
    color: var(--text-primary);
    margin-bottom: 1rem;
    transition: border-color .2s, color .2s;
}

.mobile-filter-toggle:hover,
.mobile-filter-toggle.active { border-color: var(--primary); color: var(--primary); }
.mobile-filter-toggle svg { width: 15px; height: 15px; }

/* ── Filter backdrop ── */
.filter-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 799;
    animation: backdropIn .2s ease;
}

@keyframes backdropIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Mobile layout ── */
@media (max-width: 780px) {
    .page-body {
        grid-template-columns: 1fr;
        padding: 1.25rem 1rem 3rem;
    }

    .filters-sidebar {
        position: fixed;
        top: 52px;
        left: 0;
        bottom: 0;
        width: min(300px, 88vw);
        z-index: 800;
        overflow-y: auto;
        border-radius: 0;
        border-width: 0 1px 0 0;
        transform: translateX(-100%);
        transition: transform .25s ease;
        display: block !important;
    }

    .filters-sidebar.mobile-open {
        transform: translateX(0);
    }

    .filter-backdrop.active { display: block; }

    .mobile-filter-toggle { display: flex; }
}

@media (min-width: 781px) {
    .mobile-filter-toggle { display: none !important; }
    .filter-backdrop { display: none !important; }
    .filters-sidebar { transform: none !important; }
}

/* ── Small screens ── */
@media (max-width: 640px) {
    .detail-wrapper { padding: 1.25rem 1rem 3rem; }
    .detail-header-card { padding: 1.25rem; }
    .job-card { flex-wrap: wrap; }
    .btn-view-detail { width: 100%; text-align: center; justify-content: center; }
    .key-info-grid { grid-template-columns: 1fr; }
    .jobs-column-header h1 { font-size: 1.45rem; }
}
