/* ========================================
   TalentFlow Public Styles
   Modal Job Search UI
   ======================================== */
:root {
    --tf-primary: #e8546c;
    --tf-primary-light: #fce4ec;
    --tf-primary-hover: #d63e56;
    --tf-primary-dark: #c62842;
    --tf-success: #10b981;
    --tf-line: #00B900;
    --tf-text: #374151;
    --tf-text-light: #6b7280;
    --tf-border: #e5e7eb;
    --tf-bg: #f9fafb;
    --tf-bg-warm: #fff5f7;
    --tf-radius: 12px;
    --tf-shadow: 0 4px 20px rgba(0,0,0,0.08);
    --tf-shadow-lg: 0 12px 40px rgba(0,0,0,0.15);
}

/* ========================================
   Search Bar
   ======================================== */
.tf-search-wrap {
    max-width: 780px;
    margin: 0 auto 24px;
}
.tf-search-bar-modal {
    background: #fff;
    border-radius: var(--tf-radius);
    box-shadow: var(--tf-shadow);
    overflow: hidden;
    border: 2px solid var(--tf-border);
    transition: border-color .2s;
}
.tf-search-bar-modal:hover,
.tf-search-bar-modal:focus-within {
    border-color: var(--tf-primary);
}
.tf-search-categories {
    display: flex;
    border-bottom: 1px solid var(--tf-border);
}
.tf-search-cat-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--tf-text);
    transition: background .2s, color .2s;
    position: relative;
    border-right: 1px solid var(--tf-border);
}
.tf-search-cat-btn:last-child { border-right: none; }
.tf-search-cat-btn:hover {
    background: var(--tf-bg-warm);
    color: var(--tf-primary);
}
.tf-search-cat-btn .tf-cat-icon { display: flex; align-items: center; }
.tf-search-cat-btn .tf-cat-icon svg { color: var(--tf-primary); }
.tf-search-cat-btn .tf-cat-arrow {
    font-size: 10px;
    color: var(--tf-text-light);
    margin-left: 2px;
}
.tf-cat-selected-badge {
    position: absolute;
    top: 6px;
    right: 10px;
    background: var(--tf-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 10px;
    padding: 0 5px;
}

.tf-search-keyword-wrap {
    display: flex;
    align-items: center;
    padding: 4px;
}
.tf-keyword-input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    font-size: 15px;
    outline: none;
    background: transparent;
}
.tf-search-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--tf-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background .2s, transform .1s;
    flex-shrink: 0;
}
.tf-search-submit-btn:hover {
    background: var(--tf-primary-hover);
    transform: scale(1.05);
}

.tf-search-total-bar {
    text-align: center;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--tf-text-light);
}
.tf-search-total-bar strong {
    color: var(--tf-primary);
    font-size: 20px;
}

/* ========================================
   Modal Overlay
   ======================================== */
.tf-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    overflow-y: auto;
    animation: tfFadeIn .2s ease;
}
@keyframes tfFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes tfSlideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.tf-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 780px;
    max-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    box-shadow: var(--tf-shadow-lg);
    animation: tfSlideUp .25s ease;
    overflow: hidden;
}

/* Modal Header Tabs */
.tf-modal-header {
    display: flex;
    background: var(--tf-primary);
    position: relative;
    flex-shrink: 0;
}
.tf-modal-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 12px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.75);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}
.tf-modal-tab:hover { color: #fff; background: rgba(255,255,255,0.1); }
.tf-modal-tab.active {
    color: var(--tf-primary);
    background: #fff;
    border-radius: 12px 12px 0 0;
}
.tf-modal-tab .tf-tab-icon { display: flex; align-items: center; }
.tf-modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-size: 18px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    z-index: 2;
}
.tf-modal-close:hover { background: rgba(255,255,255,0.35); }

/* Modal Body */
.tf-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 300px;
}
.tf-tab-content { display: none; }
.tf-tab-content.active { display: block; }

.tf-modal-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--tf-primary);
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--tf-primary-light);
}
.tf-modal-section-title svg { color: var(--tf-primary); }

/* Filter Grid (Occupation) */
.tf-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.tf-filter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 2px solid var(--tf-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all .2s;
    font-size: 14px;
}
.tf-filter-item:hover {
    border-color: var(--tf-primary);
    background: var(--tf-bg-warm);
}
.tf-filter-item.selected {
    border-color: var(--tf-primary);
    background: var(--tf-primary-light);
}
.tf-filter-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--tf-primary);
    cursor: pointer;
    flex-shrink: 0;
}
.tf-filter-item .tf-filter-label { flex: 1; color: var(--tf-text); }
.tf-filter-item .tf-filter-count {
    font-size: 12px;
    color: var(--tf-text-light);
    background: var(--tf-bg);
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

/* Location Layout */
.tf-location-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 0;
    border: 1px solid var(--tf-border);
    border-radius: 8px;
    overflow: hidden;
    min-height: 300px;
}
.tf-location-prefs {
    border-right: 1px solid var(--tf-border);
    overflow-y: auto;
    max-height: 380px;
    background: var(--tf-bg);
}
.tf-location-pref-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--tf-border);
    transition: all .15s;
    color: var(--tf-text);
}
.tf-location-pref-item:hover,
.tf-location-pref-item.active {
    background: var(--tf-primary);
    color: #fff;
}
.tf-location-pref-item .tf-pref-count {
    font-size: 12px;
    opacity: 0.7;
}
.tf-location-pref-item .tf-pref-arrow { font-size: 10px; }

.tf-location-cities {
    padding: 16px;
    overflow-y: auto;
    max-height: 380px;
}
.tf-location-cities-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--tf-primary);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tf-location-cities .tf-filter-grid {
    grid-template-columns: repeat(2, 1fr);
}

.tf-hint {
    color: var(--tf-text-light);
    font-size: 14px;
    text-align: center;
    padding: 60px 16px;
}

/* Conditions Layout */
.tf-conditions-layout {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 0;
    border: 1px solid var(--tf-border);
    border-radius: 8px;
    overflow: hidden;
    min-height: 280px;
}
.tf-conditions-categories {
    border-right: 1px solid var(--tf-border);
    background: var(--tf-bg);
    display: flex;
    flex-direction: column;
}
.tf-cond-cat-btn {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 500;
    background: none;
    border: none;
    border-bottom: 1px solid var(--tf-border);
    cursor: pointer;
    color: var(--tf-text);
    transition: all .15s;
    text-align: left;
}
.tf-cond-cat-btn:hover { background: #fff; }
.tf-cond-cat-btn.active {
    background: var(--tf-primary);
    color: #fff;
    font-weight: 700;
}
.tf-cond-cat-btn::after {
    content: '→';
    margin-left: auto;
    font-size: 12px;
}

.tf-conditions-options {
    padding: 16px;
    overflow-y: auto;
    max-height: 320px;
}

/* Modal Footer */
.tf-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-top: 1px solid var(--tf-border);
    background: var(--tf-bg);
    flex-shrink: 0;
}
.tf-clear-all-btn {
    background: none;
    border: none;
    color: var(--tf-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
    text-decoration: underline;
}
.tf-clear-all-btn:hover { color: var(--tf-primary-dark); }

.tf-modal-search-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    background: var(--tf-primary);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 4px 12px rgba(232,84,108,0.3);
}
.tf-modal-search-btn:hover {
    background: var(--tf-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(232,84,108,0.4);
}

/* Mobile Bottom Tabs */
.tf-modal-bottom-tabs {
    display: none;
    border-top: 1px solid var(--tf-border);
    background: #fff;
    flex-shrink: 0;
}
.tf-modal-btab {
    flex: 1;
    padding: 10px 8px;
    background: none;
    border: none;
    border-top: 3px solid transparent;
    font-size: 12px;
    color: var(--tf-text-light);
    cursor: pointer;
    font-weight: 600;
    transition: all .2s;
}
.tf-modal-btab.active {
    color: var(--tf-primary);
    border-top-color: var(--tf-primary);
}

/* ========================================
   Selected Filters Tags
   ======================================== */
.tf-selected-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 780px;
    margin: 0 auto 20px;
    padding: 0 4px;
}
.tf-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--tf-primary-light);
    color: var(--tf-primary-dark);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}
.tf-filter-tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--tf-primary);
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    line-height: 1;
    border: none;
}
.tf-filter-tag-remove:hover { background: var(--tf-primary-dark); }

/* ========================================
   Loading Spinner
   ======================================== */
.tf-loading-spinner {
    display: flex;
    justify-content: center;
    padding: 40px;
}
.tf-loading-spinner::after {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid var(--tf-border);
    border-top-color: var(--tf-primary);
    border-radius: 50%;
    animation: tfSpin .6s linear infinite;
}
@keyframes tfSpin { to { transform: rotate(360deg); } }

/* ========================================
   Job Grid & Cards
   ======================================== */
.tf-result-count {
    color: var(--tf-text-light);
    font-size: 14px;
    margin-bottom: 16px;
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
}
.tf-result-count strong { color: var(--tf-primary); font-size: 18px; }

.tf-job-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}
.tf-job-card {
    background: #fff;
    border-radius: var(--tf-radius);
    padding: 24px;
    border: 1px solid var(--tf-border);
    transition: box-shadow .2s, transform .2s;
}
.tf-job-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.tf-job-card-header { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.tf-job-type {
    display: inline-block; padding: 4px 12px; border-radius: 20px;
    font-size: 12px; font-weight: 600;
}
.tf-type-full_time { background: #dbeafe; color: #1e40af; }
.tf-type-part_time { background: #d1fae5; color: #065f46; }
.tf-type-contract { background: #fef3c7; color: #92400e; }
.tf-type-temporary { background: #ede9fe; color: #5b21b6; }
.tf-type-intern { background: #fce7f3; color: #9d174d; }
.tf-type-outsource { background: #e0e7ff; color: #3730a3; }
.tf-badge-remote { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; background: #ecfdf5; color: #047857; }

.tf-job-title { margin: 0 0 12px; font-size: 17px; line-height: 1.4; }
.tf-job-title a { color: var(--tf-text); text-decoration: none; }
.tf-job-title a:hover { color: var(--tf-primary); }
.tf-job-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.tf-meta-item { font-size: 13px; color: var(--tf-text-light); }
.tf-job-excerpt { font-size: 14px; color: var(--tf-text-light); line-height: 1.6; margin-bottom: 16px; }
.tf-job-card-footer { display: flex; gap: 8px; }

/* Buttons */
.tf-btn {
    display: inline-block; padding: 10px 20px; border-radius: 8px; font-size: 14px;
    font-weight: 600; text-decoration: none; text-align: center; cursor: pointer;
    border: none; transition: all .2s; line-height: 1.4;
}
.tf-btn-primary { background: var(--tf-primary); color: #fff !important; }
.tf-btn-primary:hover { background: var(--tf-primary-hover); }
.tf-btn-outline { background: transparent; border: 2px solid var(--tf-border); color: var(--tf-text) !important; }
.tf-btn-outline:hover { border-color: var(--tf-primary); color: var(--tf-primary) !important; }
.tf-btn-line { background: var(--tf-line); color: #fff !important; }
.tf-btn-large { padding: 14px 40px; font-size: 16px; width: 100%; }

/* No Results */
.tf-no-results { text-align: center; padding: 60px 20px; color: var(--tf-text-light); }

/* Pagination */
.tf-pagination { display: flex; justify-content: center; gap: 4px; margin-top: 30px; }
.tf-page-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 8px; text-decoration: none;
    color: var(--tf-text); border: 1px solid var(--tf-border); font-size: 14px;
    cursor: pointer; background: #fff; transition: all .2s;
}
.tf-page-btn.active, .tf-page-btn:hover {
    background: var(--tf-primary); color: #fff; border-color: var(--tf-primary);
}

/* Form */
.tf-apply-form-wrap { max-width: 680px; margin: 0 auto; }
.tf-apply-form-wrap h2 { font-size: 22px; margin-bottom: 24px; }
.tf-form { background: #fff; padding: 32px; border-radius: var(--tf-radius); border: 1px solid var(--tf-border); }
.tf-form-group { margin-bottom: 20px; }
.tf-form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--tf-text); }
.tf-form-group .required { color: #ef4444; }
.tf-form-group input, .tf-form-group select, .tf-form-group textarea {
    width: 100%; padding: 10px 14px; border: 2px solid var(--tf-border); border-radius: 8px;
    font-size: 15px; transition: border-color .2s; box-sizing: border-box;
}
.tf-form-group input:focus, .tf-form-group select:focus, .tf-form-group textarea:focus { border-color: var(--tf-primary); outline: none; }
.tf-form-row { display: flex; gap: 16px; }
.tf-form-row-2 > .tf-form-group { flex: 1; }
.tf-checkbox-label { display: flex !important; align-items: center; gap: 8px; font-weight: 400 !important; }
.tf-checkbox-label input { width: auto !important; }
.tf-form-actions { margin-top: 24px; }

.tf-success-msg { background: #ecfdf5; border: 2px solid #a7f3d0; border-radius: var(--tf-radius); padding: 32px; text-align: center; margin-bottom: 24px; }
.tf-success-msg h3 { color: #065f46; margin-top: 0; }
.tf-line-cta { background: #fff; border-radius: 8px; padding: 20px; margin-top: 20px; border: 2px solid var(--tf-line); }
.tf-line-cta p { margin: 0 0 12px; font-weight: 600; }
.tf-card { background: #fff; border-radius: var(--tf-radius); padding: 24px; border: 1px solid var(--tf-border); }
.tf-mypage-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.tf-mypage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.tf-badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; background: var(--tf-bg); }

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .tf-modal-overlay { padding: 0; align-items: flex-end; }
    .tf-modal {
        border-radius: 16px 16px 0 0;
        max-height: 92vh;
    }
    .tf-modal-header { flex-wrap: nowrap; overflow-x: auto; }
    .tf-modal-tab { font-size: 12px; padding: 12px 8px; min-width: 0; }
    .tf-modal-close { top: 6px; right: 4px; width: 30px; height: 30px; font-size: 15px; }
    .tf-modal-body { padding: 16px; }
    .tf-filter-grid { grid-template-columns: 1fr; }
    .tf-location-layout { grid-template-columns: 1fr; }
    .tf-location-prefs { max-height: 160px; border-right: none; border-bottom: 1px solid var(--tf-border); }
    .tf-location-cities .tf-filter-grid { grid-template-columns: 1fr; }
    .tf-conditions-layout { grid-template-columns: 1fr; }
    .tf-conditions-categories {
        flex-direction: row;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid var(--tf-border);
    }
    .tf-cond-cat-btn {
        white-space: nowrap;
        border-bottom: none;
        border-right: 1px solid var(--tf-border);
        padding: 10px 14px;
        font-size: 13px;
    }
    .tf-cond-cat-btn::after { display: none; }
    .tf-modal-bottom-tabs { display: flex; }
    .tf-modal-footer { padding: 12px 16px; }
    .tf-modal-search-btn { padding: 10px 20px; font-size: 14px; }
    
    .tf-search-categories { flex-wrap: nowrap; }
    .tf-search-cat-btn { font-size: 13px; padding: 12px 8px; }
    .tf-search-cat-btn .tf-cat-arrow { display: none; }
    
    .tf-job-grid { grid-template-columns: 1fr; }
    .tf-form-row { flex-direction: column; gap: 0; }
    .tf-form { padding: 20px; }
}

@media (max-width: 480px) {
    .tf-search-cat-btn { font-size: 12px; padding: 10px 6px; gap: 4px; }
    .tf-search-cat-btn .tf-cat-icon svg { width: 14px; height: 14px; }
}
