/* =========================================================
   Recruiter Directory – Frontend Styles
   ========================================================= */

:root {
    --rd-primary:       #1e40af;
    --rd-primary-light: #3b82f6;
    --rd-accent:        #0ea5e9;
    --rd-surface:       rgba(255,255,255,0.72);
    --rd-border:        rgba(0,0,0,0.10);
    --rd-text:          #1e293b;
    --rd-text-muted:    #64748b;
    --rd-badge-r-bg:    #dbeafe;
    --rd-badge-r-clr:   #1d4ed8;
    --rd-badge-h-bg:    #f0fdf4;
    --rd-badge-h-clr:   #15803d;
    --rd-badge-rh-bg:   #faf5ff;
    --rd-badge-rh-clr:  #7c3aed;
    --rd-radius:        14px;
    --rd-shadow:        0 4px 24px rgba(0,0,0,0.10);
    --rd-transition:    0.22s cubic-bezier(.4,0,.2,1);
}

/* ── Wrap ──────────────────────────────────────────────── */
.rd-wrap { font-family: inherit; color: var(--rd-text); }

/* ── Filters ───────────────────────────────────────────── */
.rd-filters {
    background: var(--rd-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--rd-border);
    border-radius: var(--rd-radius);
    padding: 16px 22px;
    margin-bottom: 20px;
    box-shadow: var(--rd-shadow);
}

.rd-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.rd-filter-group { display: flex; flex-direction: column; gap: 5px; flex: 1 1 0; min-width: 140px; align-items: stretch; }
.rd-filter-group label { font-size: 12px; font-weight: 600; color: var(--rd-text-muted); text-transform: uppercase; letter-spacing: .04em; }

.rd-filter-group select {
    padding: 9px 12px;
    border: 1.5px solid var(--rd-border);
    border-radius: 9px;
    font-size: 14px;
    background: rgba(255,255,255,0.85);
    outline: none;
    cursor: pointer;
    transition: border-color var(--rd-transition);
}
.rd-filter-group select:focus { border-color: var(--rd-primary-light); }

.rd-filter-checkboxes {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
}

.rd-check-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}
.rd-check-label input[type="checkbox"] {
    width: 17px; height: 17px;
    accent-color: var(--rd-primary);
    cursor: pointer;
}

/* CTA Button – organic hill shape */
.rd-filter-cta {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    position: relative;
}
.rd-btn-join {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px 10px 20px;
    background: linear-gradient(135deg, var(--rd-primary) 0%, var(--rd-primary-light) 100%);
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    position: relative;
    /* Organic hill: flat bottom, irregular bump rising to top-right */
    clip-path: polygon(
        0% 100%,
        0% 28%,
        4% 18%,
        12% 9%,
        24% 3%,
        40% 0%,
        58% 1%,
        74% 5%,
        86% 11%,
        94% 18%,
        100% 28%,
        100% 100%
    );
    padding-top: 18px;
    transition: filter var(--rd-transition), transform var(--rd-transition);
    box-shadow: 0 4px 18px rgba(30,64,175,0.22);
    min-width: 160px;
}
.rd-btn-join:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
}
.rd-btn-join:active { transform: translateY(0); }

/* ── Table ─────────────────────────────────────────────── */
.rd-table-wrap {
    background: var(--rd-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--rd-border);
    border-radius: var(--rd-radius);
    overflow: hidden;
    box-shadow: var(--rd-shadow);
}

.rd-result-info {
    font-size: 13px;
    color: var(--rd-text-muted);
    padding: 10px 18px 0;
}

.rd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.rd-table thead tr {
    background: rgba(30,64,175,0.06);
    border-bottom: 1.5px solid var(--rd-border);
}
.rd-table th {
    padding: 13px 16px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--rd-text-muted);
    text-align: left;
}

.rd-row {
    border-bottom: 1px solid var(--rd-border);
    cursor: pointer;
    transition: background var(--rd-transition);
}
.rd-row:last-child { border-bottom: none; }
.rd-row:hover,
.rd-row:focus { background: rgba(59,130,246,0.06); outline: none; }
.rd-row:focus-visible { outline: 2px solid var(--rd-primary-light); outline-offset: -2px; }

.rd-table td { padding: 14px 16px; vertical-align: top; }

.rd-td-name {
    display: flex;
    align-items: center;
    gap: 11px;
    font-weight: 600;
}

.rd-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--rd-primary);
    display: flex; align-items: center; justify-content: center;
}
.rd-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rd-avatar-initials {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rd-primary), var(--rd-accent));
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.rd-empty {
    text-align: center;
    padding: 40px !important;
    color: var(--rd-text-muted);
    font-size: 15px;
}

/* Type badge */
.rd-type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
    white-space: nowrap;
}
[class*="rd-type-recruiter"] { background: var(--rd-badge-r-bg); color: var(--rd-badge-r-clr); }
[class*="rd-type-headhunter"] { background: var(--rd-badge-h-bg); color: var(--rd-badge-h-clr); }
[class*="rd-type-recruiter-headhunter"],
[class*="rd-type-headhunter-recruiter"] { background: var(--rd-badge-rh-bg); color: var(--rd-badge-rh-clr); }

/* ── Pagination ────────────────────────────────────────── */
.rd-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 14px;
}
.rd-page-btn {
    padding: 6px 13px;
    border: 1.5px solid var(--rd-border);
    border-radius: 8px;
    background: rgba(255,255,255,0.8);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--rd-transition);
}
.rd-page-btn:hover { border-color: var(--rd-primary-light); color: var(--rd-primary); }
.rd-page-btn.active { background: var(--rd-primary); color: #fff; border-color: var(--rd-primary); }

/* ── Modal ──────────────────────────────────────────────── */
.rd-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(15,23,42,0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: rd-overlay-in var(--rd-transition) both;
}
.rd-modal-overlay[hidden] { display: none; }

@keyframes rd-overlay-in { from { opacity:0 } to { opacity:1 } }

.rd-modal-box {
    background: rgba(255,255,255,0.62);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1.5px solid rgba(255,255,255,0.75);
    border-radius: 22px;
    box-shadow:
        0 8px 48px rgba(0,0,0,0.18),
        inset 0 1px 0 rgba(255,255,255,0.8);
    width: 100%;
    max-width: 580px;
    max-height: 88vh;
    overflow-y: auto;
    animation: rd-modal-in 0.28s cubic-bezier(.34,1.56,.64,1) both;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.15) transparent;
}

@keyframes rd-modal-in {
    from { opacity:0; transform: scale(0.92) translateY(12px) }
    to   { opacity:1; transform: scale(1) translateY(0) }
}

.rd-modal-inner {
    padding: 30px 28px 28px;
    position: relative;
}

.rd-modal-close {
    position: absolute;
    top: 16px; right: 16px;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--rd-border);
    background: rgba(255,255,255,0.8);
    font-size: 16px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--rd-transition);
    line-height: 1;
    color: var(--rd-text-muted);
}
.rd-modal-close:hover { background: #fff; color: var(--rd-text); border-color: rgba(0,0,0,0.2); }

.rd-modal-photo {
    width: 90px; height: 90px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 16px;
    border: 3px solid rgba(255,255,255,0.9);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.rd-modal-photo img { width:100%; height:100%; object-fit:cover; }
.rd-modal-initials {
    background: linear-gradient(135deg, var(--rd-primary), var(--rd-accent));
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

.rd-modal-name {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--rd-text);
}
.rd-modal-type { display: block; text-align: center; margin-bottom: 22px; }

.rd-modal-fields { margin: 0; padding: 0; }

.rd-modal-field {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 4px 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    align-items: baseline;
}
.rd-modal-field:last-child { border-bottom: none; }

.rd-modal-field dt {
    font-size: 12px;
    font-weight: 600;
    color: var(--rd-text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.rd-modal-field dd {
    margin: 0;
    font-size: 14px;
    color: var(--rd-text);
    line-height: 1.55;
    word-break: break-word;
}
.rd-modal-field dd a {
    color: var(--rd-primary);
    text-decoration: none;
}
.rd-modal-field dd a:hover { text-decoration: underline; }

.rd-tag-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.rd-tag-list li {
    background: rgba(30,64,175,0.08);
    color: var(--rd-primary);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.rd-modal-loading {
    padding: 40px;
    text-align: center;
    color: var(--rd-text-muted);
}

/* ── Registration Form ─────────────────────────────────── */
.rd-register-wrap {
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    padding: 0 18px;
    box-sizing: border-box;
}
.rd-register-form h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 24px 0 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--rd-border);
    color: var(--rd-primary);
}

.rd-form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.rd-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.rd-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--rd-text-muted);
}
.rd-field label small { font-weight: 400; }
.rd-field input,
.rd-field textarea,
.rd-field select {
    padding: 10px 13px;
    border: 1.5px solid var(--rd-border);
    border-radius: 9px;
    font-size: 14px;
    font-family: inherit;
    background: rgba(255,255,255,0.85);
    outline: none;
    transition: border-color var(--rd-transition);
    box-sizing: border-box;
    width: 100%;
}
.rd-field input:focus,
.rd-field textarea:focus { border-color: var(--rd-primary-light); }
.rd-field textarea { resize: vertical; }

.rd-check-group { display: flex; gap: 20px; flex-wrap: wrap; }

/* ── Photo Upload (Registration) ───────────────────────── */
.rd-photo-upload-area {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px;
    border: 1.5px dashed var(--rd-border);
    border-radius: 12px;
    background: rgba(255,255,255,0.6);
}

.rd-photo-preview-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--rd-primary), var(--rd-accent));
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
    border: 3px solid rgba(255,255,255,0.9);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.rd-photo-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    position: absolute;
    top: 0; left: 0;
}

#rd-photo-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0; left: 0;
}

.rd-photo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.42);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--rd-transition);
    color: #fff;
    gap: 3px;
}
.rd-photo-preview-circle:hover .rd-photo-overlay { opacity: 1; }
.rd-photo-overlay-icon { font-size: 20px; line-height: 1; }
.rd-photo-overlay-text { font-size: 11px; font-weight: 600; }

.rd-photo-upload-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.rd-photo-hint {
    margin: 0;
    font-size: 13px;
    color: var(--rd-text-muted);
}

.rd-btn-upload-photo {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(30,64,175,0.08);
    color: var(--rd-primary);
    border: 1.5px solid rgba(30,64,175,0.2);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--rd-transition);
    text-align: center;
}
.rd-btn-upload-photo:hover {
    background: rgba(30,64,175,0.14);
    border-color: var(--rd-primary-light);
}

.rd-btn-remove-photo {
    display: inline-block;
    padding: 6px 14px;
    background: transparent;
    color: #dc2626;
    border: 1.5px solid rgba(220,38,38,0.25);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--rd-transition);
}
.rd-btn-remove-photo:hover {
    background: rgba(220,38,38,0.06);
    border-color: #dc2626;
}

/* ── Submit ─────────────────────────────────────────────── */
.rd-btn-primary {
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--rd-primary), var(--rd-primary-light));
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity var(--rd-transition), transform var(--rd-transition);
}
.rd-btn-primary:hover { opacity: .9; transform: translateY(-1px); }
.rd-btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.rd-field-submit {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.rd-submit-note { font-size: 13px; color: var(--rd-text-muted); }

.rd-register-notice {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}
.rd-register-notice.success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.rd-register-notice.error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 680px) {
    .rd-filters { padding: 14px 14px; }

    .rd-filter-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    /* All filter groups: same full width, same select height — no staircase */
    .rd-filter-group {
        flex: 0 0 auto;
        width: 100%;
        min-width: 0;
        align-items: stretch;
    }
    .rd-filter-group label {
        text-align: left;
    }
    .rd-filter-group select {
        width: 100%;
        box-sizing: border-box;
        height: 42px; /* unified height kills the staircase */
    }
    .rd-filter-checkboxes {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        flex: 0 0 auto;
        width: 100%;
    }
    .rd-filter-cta {
        flex: 0 0 auto;
        width: 100%;
        align-items: stretch;
    }
    .rd-btn-join {
        width: 100%;
        text-align: center;
        display: block;
        box-sizing: border-box;
        clip-path: none;
        border-radius: 14px;
        padding: 12px 20px;
    }

    #rd-table thead th:nth-child(2),
    #rd-table td:nth-child(2),
    #rd-table thead th:nth-child(3),
    #rd-table td:nth-child(3) { display: none; }

    .rd-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    .rd-modal-box {
        max-width: 100%;
        max-height: 94vh;
        border-radius: 22px 22px 0 0;
        animation: rd-modal-slide-up 0.3s cubic-bezier(.4,0,.2,1) both;
    }
    @keyframes rd-modal-slide-up {
        from { opacity:0; transform: translateY(100%) }
        to   { opacity:1; transform: translateY(0) }
    }

    .rd-modal-field { grid-template-columns: 1fr; gap: 2px; }

    /* Form: comfortable padding from screen edges on mobile */
    .rd-register-wrap {
        width: 100%;
        padding: 0 16px;
        box-sizing: border-box;
    }
    .rd-register-form {
        width: 100%;
        padding: 0 4px; /* extra inner buffer so fields breathe */
        box-sizing: border-box;
    }
    .rd-filter-group, .rd-filter-group select { max-width: 100%; }
    .rd-filter-row > * { margin-left: 0 !important; margin-right: 0 !important; }
    .rd-form-grid-2 { grid-template-columns: 1fr; }

    .rd-photo-upload-area {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* =========================================================
   Simple directory tables – Voľné pozície / Personálne agentúry /
   Pracovné servery / Relokačné agentúry. Reuses the same design
   tokens and wrapper classes as the main recruiter directory so
   all tables sit at the same visual level, with a single search
   field instead of dropdown filters.
   ========================================================= */

.rd-filters-search-only { padding: 14px 22px; }
.rd-search-row { display: flex; }
.rd-simple-search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--rd-border);
    border-radius: 9px;
    font-size: 14px;
    background: rgba(255,255,255,0.85);
    outline: none;
    transition: border-color var(--rd-transition);
}
.rd-simple-search-input:focus { border-color: var(--rd-primary-light); }

.rd-simple-wrap .rd-result-info { padding-bottom: 10px; }

/* ── Spoločnosť / Názov cell: name on top, big 16:9 logo stretched to
   the full cell width underneath (only grows the row when a logo exists)
   ── */
.rd-simple-table-frontend .rd-td-name-stacked {
    padding: 14px 16px;
}
.rd-simple-name {
    display: block;
    font-weight: 600;
    color: var(--rd-text);
    line-height: 1.3;
    margin-bottom: 8px;
}
.rd-simple-logo-wide {
    display: block;
    width: 100%;
    max-height: 220px;
    text-align: center;
}
.rd-simple-logo-wide img {
    display: inline-block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 220px;
    border-radius: 8px;
}

/* ── Jobboards: big logo + name/website/description card ── */
.rd-jobboard-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rd-jobboard-card {
    display: flex;
    gap: 18px;
    align-items: center;
    background: var(--rd-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--rd-border);
    border-radius: var(--rd-radius);
    padding: 18px 20px;
    box-shadow: var(--rd-shadow);
    transition: transform var(--rd-transition), box-shadow var(--rd-transition);
}
.rd-jobboard-card:hover { transform: translateY(-2px); }

.rd-jobboard-logo {
    /* Fixed width/height box (not max-width/max-height) so every card's
       logo takes up exactly the same footprint no matter the source
       image's format/orientation — this is what keeps the name, website
       and description text starting at the same column across all cards. */
    width: 140px;
    height: 140px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rd-jobboard-logo img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
}
.rd-jobboard-logo-empty { width: 100%; height: 100%; background: #f1f5f9; display: block; border-radius: 12px; }

.rd-jobboard-body { flex: 1 1 auto; min-width: 0; }
.rd-jobboard-name {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--rd-text);
}
.rd-jobboard-website { font-size: 13px; margin-bottom: 8px; }
.rd-jobboard-website a { color: var(--rd-primary); text-decoration: none; }
.rd-jobboard-website a:hover { text-decoration: underline; }
.rd-jobboard-desc {
    font-size: 14px;
    line-height: 1.55;
    color: var(--rd-text-muted);
    margin: 0;
}

@media (max-width: 640px) {
    .rd-jobboard-card { flex-direction: column; align-items: center; text-align: center; }
    .rd-jobboard-logo { width: 120px; height: 120px; }
}

/* ── Small pill buttons used by Voľné pracovné pozície (Web / ORSR / HV
   columns show an action button instead of a raw link/text) ── */
.rd-btn-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(30,64,175,0.08);
    color: var(--rd-primary) !important;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background var(--rd-transition), transform var(--rd-transition);
    margin-bottom: 4px;
}
.rd-btn-pill:hover { background: var(--rd-primary); color: #fff !important; }
.rd-btn-pill:last-child { margin-bottom: 0; }

/* Keep the "Spoločnosť / Názov" column from stretching too wide just
   because it now contains a big 16:9 logo image. */
.rd-simple-table-frontend { table-layout: fixed; }
.rd-simple-table-frontend th:first-child,
.rd-simple-table-frontend td.rd-td-name-stacked { width: 26%; }

@media (max-width: 900px) {
    .rd-simple-table-frontend { table-layout: auto; }
    .rd-simple-wrap .rd-table-wrap { overflow-x: auto; }
    .rd-simple-table-frontend { min-width: 640px; }
}
