/* ============================================================
   TUYEN DUNG PLUGIN – style.css
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
    --td-primary:       #c40404;
    --td-primary-dark:  #c40404;
    --td-primary-light: #e8effe;
    --td-accent:        #f97316;
    --td-success:       #16a34a;
    --td-error:         #dc2626;
    --td-text:          #1e293b;
    --td-muted:         #64748b;
    --td-border:        #e2e8f0;
    --td-bg:            #f8fafc;
    --td-white:         #ffffff;
    --td-radius:        12px;
    --td-radius-sm:     8px;
    --td-shadow:        0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.08);
    --td-shadow-lg:     0 8px 32px rgba(26,86,219,.14);
    --td-font:          'htkfont-inter-regu' !important;
}

/* ============================================================
   BASE – scoped vào .td-page-wrap
   ============================================================ */
.td-page-wrap {
    font-family: var(--td-font);
    color: var(--td-text);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}
.td-page-wrap *, .td-page-wrap *::before, .td-page-wrap *::after {
    box-sizing: border-box;
}

/* ============================================================
   HERO BANNER
   ============================================================ */
.td-hero {
        background: linear-gradient(135deg, #d63638 0%, #d63638 55%, #c40404 100%);
    padding: 60px 24px 70px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.td-hero::before {
    content: '';
    position: absolute; inset: 0;
    background-image: radial-gradient(circle at 20% 50%, rgba(255,255,255,.06) 0%, transparent 60%),
                      radial-gradient(circle at 80% 20%, rgba(255,255,255,.04) 0%, transparent 50%);
}
.td-hero-inner {
    position: relative; z-index: 1;
    max-width: 680px; margin: 0 auto;
}
.td-hero-label {
    display: inline-block;
    background: rgba(255,255,255,.15);
    color: rgba(255,255,255,.9);
    font-size: 12px; font-weight: 600;
    letter-spacing: .1em; text-transform: uppercase;
    padding: 5px 14px; border-radius: 20px;
    margin-bottom: 16px;
    border: 1px solid rgba(255,255,255,.2);
}
.td-heading {
    font-size: clamp(30px, 5vw, 52px);
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 14px;
    letter-spacing: -.025em;
    line-height: 1.15;
}
.td-subheading {
    color: rgba(255,255,255,.78);
    font-size: 16px;
    font-weight: 400;
    margin: 0;
    line-height: 1.7;
}

/* ============================================================
   MAIN CONTAINER
   ============================================================ */
.td-main {
    max-width: 1120px;
    margin: 0 auto;
    padding: 40px 24px 72px;
    width: 100%;
}

/* ============================================================
   TAG FILTER BAR
   ============================================================ */
.td-filter-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}
.td-tag-filter {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1.5px solid var(--td-border);
    background: var(--td-white);
    color: var(--td-muted);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--td-font);
    cursor: pointer;
    transition: all .18s;
}
.td-tag-filter:hover {
    border-color: var(--td-primary);
    color: var(--td-primary);
    background: var(--td-primary-light);
}
.td-tag-filter.active {
    background: var(--td-primary);
    border-color: var(--td-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(26,86,219,.25);
}

/* ============================================================
   COUNT
   ============================================================ */
.td-count {
    color: var(--td-muted);
    font-size: 14px;
    margin-bottom: 22px;
    font-weight: 500;
}

/* ============================================================
   JOB GRID
   ============================================================ */
.td-jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 22px;
}

/* ============================================================
   JOB CARD
   ============================================================ */
.td-job-card {
    background: var(--td-white);
    border-radius: var(--td-radius);
    box-shadow: var(--td-shadow);
    border: 1px solid var(--td-border);
    transition: transform .22s, box-shadow .22s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.td-job-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--td-shadow-lg);
}

/* Ảnh thumbnail trên card */
.td-card-thumb-link { display: block; }
.td-card-thumb {
    width: 100%; height: 170px;
    background-size: cover;
    background-position: center;
    background-color: var(--td-primary-light);
    flex-shrink: 0;
    transition: transform .3s;
}
.td-job-card:hover .td-card-thumb { transform: scale(1.03); }
.td-card-thumb-link { overflow: hidden; display: block; }

.td-card-thumb-placeholder {
    display: flex; align-items: center; justify-content: center;
    font-size: 36px; background: linear-gradient(135deg, #e8effe, #dbeafe);
}

/* Card body */
.td-job-card-inner { padding: 18px 22px 22px; display: flex; flex-direction: column; flex: 1; }

/* Tags trong card */
.td-card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }

/* Tag chip */
.td-tag {
    display: inline-block;
    background: var(--td-primary-light);
    color: var(--td-primary);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.td-job-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.td-job-title { font-size: 17px; font-weight: 700; color: var(--td-text); line-height: 1.35; margin: 0; }
.td-job-title a { color: inherit; text-decoration: none; }
.td-job-title a:hover { color: var(--td-primary); }

.td-badge-urgent {
    background: #fff7ed; color: var(--td-accent); font-size: 11px; font-weight: 700;
    padding: 3px 8px; border-radius: 20px; white-space: nowrap;
    border: 1px solid #fdba74; flex-shrink: 0;
}

.td-job-meta { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.td-job-meta li { font-size: 13px; color: var(--td-muted); display: flex; align-items: center; gap: 7px; }
.td-job-meta strong { color: var(--td-text); }
.td-icon { font-size: 13px; flex-shrink: 0; }

.td-job-excerpt { font-size: 13.5px; color: var(--td-muted); margin-bottom: 18px; flex: 1; line-height: 1.65; }

.td-btn-detail {
    display: block; background: var(--td-primary); color: white;
    padding: 11px 20px; border-radius: var(--td-radius-sm);
    text-decoration: none; font-size: 14px; font-weight: 600; text-align: center;
    transition: background .18s, transform .1s; margin-top: auto;
}
.td-btn-detail:hover { background: var(--td-primary-dark); color: white; text-decoration: none; transform: translateY(-1px); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.td-empty { text-align: center; padding: 80px 24px; }
.td-empty-icon { font-size: 56px; margin-bottom: 14px; }
.td-empty p { color: var(--td-muted); line-height: 1.8; margin-bottom: 22px; }
.td-btn-back {
    display: inline-block; padding: 10px 24px; border-radius: var(--td-radius-sm);
    background: var(--td-primary-light); color: var(--td-primary); font-weight: 600;
    text-decoration: none; font-size: 14px; transition: background .18s;
}
.td-btn-back:hover { background: #d1dcfb; color: var(--td-primary); }

/* ============================================================
   BREADCRUMB / NÚT QUAY LẠI
   ============================================================ */
.td-breadcrumb { margin-bottom: 28px; }
.td-back-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--td-white);
    color: var(--td-primary);
    font-size: 13.5px; font-weight: 600;
    text-decoration: none;
    padding: 8px 16px 8px 12px;
    border-radius: 50px;
    border: 1.5px solid var(--td-primary-light);
    box-shadow: 0 1px 4px rgba(26,86,219,.1);
    transition: all .18s;
}
.td-back-btn svg { flex-shrink: 0; stroke: currentColor; }
.td-back-btn:hover {
    background: var(--td-primary);
    color: white;
    border-color: var(--td-primary);
    box-shadow: 0 3px 12px rgba(26,86,219,.25);
    text-decoration: none;
    transform: translateX(-2px);
}
.td-back-btn:hover svg { stroke: white; }

/* ============================================================
   DETAIL LAYOUT
   ============================================================ */
.td-detail-wrap {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 28px;
    align-items: start;
}

/* Thumbnail detail */
.td-detail-thumb {
    border-radius: var(--td-radius);
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: var(--td-shadow);
    line-height: 0;
}
.td-detail-thumb img {
    width: 100%; height: auto; max-height: 340px;
    object-fit: cover; display: block;
}

/* Info card */
.td-detail-card {
    background: var(--td-white); border-radius: var(--td-radius);
    padding: 28px; border: 1px solid var(--td-border); box-shadow: var(--td-shadow);
    margin-bottom: 20px;
}
.td-detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.td-detail-title {
    font-size: clamp(22px, 3.5vw, 32px); font-weight: 700;
    margin: 0 0 20px; line-height: 1.2; color: var(--td-text);
}
.td-detail-meta { display: flex; flex-direction: column; }
.td-meta-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0; border-bottom: 1px solid var(--td-border); font-size: 14px; gap: 12px;
}
.td-meta-item:last-child { border-bottom: none; }
.td-meta-label { color: var(--td-muted); font-weight: 500; flex-shrink: 0; }
.td-meta-item > span:last-child { font-weight: 500; text-align: right; }
.td-salary { color: var(--td-primary) !important; font-weight: 700 !important; font-size: 15px; }

/* Mô tả */
.td-detail-desc {
    background: var(--td-white); border-radius: var(--td-radius);
    padding: 28px; border: 1px solid var(--td-border); box-shadow: var(--td-shadow);
}
.td-detail-desc h3 {
    font-size: 17px; font-weight: 700; margin: 0 0 16px;
    padding-bottom: 12px; border-bottom: 3px solid var(--td-primary-light); color: var(--td-text);
}
.td-desc-content { color: var(--td-muted); line-height: 1.85; font-size: 15px; }
.td-desc-content p { margin: 0 0 12px; }
.td-desc-content ul, .td-desc-content ol { padding-left: 20px; margin-bottom: 12px; }
.td-desc-content li { margin-bottom: 6px; }
.td-desc-content h2, .td-desc-content h3, .td-desc-content h4 { color: var(--td-text); margin: 20px 0 10px; }
.td-desc-content strong { color: var(--td-text); }

/* ============================================================
   APPLY SIDEBAR – STICKY (JS-driven)
   ============================================================ */
.td-detail-right {
    /* CSS sticky làm nền, JS sẽ tinh chỉnh max-height khi form dài */
    position: sticky;
    top: 80px; /* fallback, JS override */
    align-self: start;
    /* Scroll nội dung khi form dài hơn viewport */
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--td-border) transparent;
}
.td-detail-right::-webkit-scrollbar { width: 3px; }
.td-detail-right::-webkit-scrollbar-thumb { background: var(--td-border); border-radius: 2px; }

.td-apply-box {
    background: var(--td-white); border-radius: var(--td-radius);
    padding: 24px; border: 1px solid var(--td-border); box-shadow: var(--td-shadow);
}
.td-apply-box h3 { font-size: 18px; font-weight: 700; margin: 0 0 4px; color: var(--td-primary); }
.td-apply-pos { font-size: 13px; color: var(--td-muted); margin: 0 0 18px; }
.td-apply-pos strong { color: var(--td-text); }

/* ============================================================
   FORM
   ============================================================ */
.td-form-group { margin-bottom: 14px; }
.td-form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--td-text); }
.td-req { color: var(--td-error); }
.td-optional { color: var(--td-muted); font-weight: 400; font-size: 12px; }

.td-form-group input[type="text"],
.td-form-group input[type="tel"],
.td-form-group input[type="email"] {
    width: 100%; padding: 10px 13px;
    border: 1.5px solid var(--td-border); border-radius: var(--td-radius-sm);
    font-size: 14px; font-family: var(--td-font); color: var(--td-text);
    transition: border-color .18s, box-shadow .18s;
    outline: none; background: var(--td-bg); box-sizing: border-box;
}
.td-form-group input:focus {
    border-color: var(--td-primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,.1);
    background: white;
}

.td-file-label {
    display: flex; align-items: center; gap: 8px; padding: 10px 13px;
    border: 1.5px dashed var(--td-border); border-radius: var(--td-radius-sm);
    cursor: pointer; transition: border-color .18s, background .18s; background: var(--td-bg);
}
.td-file-label:hover { border-color: var(--td-primary); background: var(--td-primary-light); }
.td-file-label input[type="file"] { display: none; }
.td-file-icon { font-size: 16px; }
.td-file-text { font-size: 13px; color: var(--td-muted); flex: 1; }
.td-file-text.has-file { color: var(--td-primary); font-weight: 500; }
.td-form-group small { display: block; font-size: 11px; color: var(--td-muted); margin-top: 4px; }

/* ============================================================
   MESSAGES
   ============================================================ */
.td-msg { padding: 10px 14px; border-radius: var(--td-radius-sm); font-size: 13px; margin-bottom: 14px; font-weight: 500; }
.td-msg.success { background: #f0fdf4; color: var(--td-success); border: 1px solid #86efac; }
.td-msg.error   { background: #fef2f2; color: var(--td-error);   border: 1px solid #fca5a5; }

/* ============================================================
   SUBMIT BUTTON
   ============================================================ */
.td-btn-submit {
    width: 100%; background: var(--td-primary); color: white;
    border: none; border-radius: var(--td-radius-sm); padding: 13px 20px;
    font-size: 14px; font-weight: 700; font-family: var(--td-font);
    cursor: pointer; transition: background .18s, transform .1s;
    letter-spacing: .01em;
}
.td-btn-submit:hover { background: var(--td-primary-dark); }
.td-btn-submit:active { transform: scale(.99); }
.td-btn-submit:disabled { background: #94a3b8; cursor: not-allowed; }

/* ============================================================
   SUCCESS STATE
   ============================================================ */
.td-success-state { text-align: center; padding: 32px 16px; }
.td-success-state .td-check { font-size: 54px; margin-bottom: 12px; animation: td-pop .4s cubic-bezier(.34,1.56,.64,1); display: block; }
.td-success-state h4 { font-size: 17px; font-weight: 700; color: var(--td-success); margin: 0 0 8px; }
.td-success-state p { font-size: 13px; color: var(--td-muted); margin: 0; }
@keyframes td-pop { 0% { transform: scale(0); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
    .td-detail-wrap { grid-template-columns: 1fr; }
    .td-detail-right {
        position: static !important;
        max-height: none !important;
        overflow-y: visible !important;
        /* Form ứng tuyển xuất hiện trước nội dung trên mobile */
        order: -1;
    }
}
@media (max-width: 640px) {
    .td-jobs-grid { grid-template-columns: 1fr; }
    .td-hero { padding: 40px 16px 50px; }
    .td-main { padding: 24px 16px 48px; }
    .td-detail-card, .td-detail-desc, .td-apply-box { padding: 20px; }
}
