/* ===== WP Tuyển Dụng - Frontend Styles ===== */

:root {
    --wptd-primary: #1a6fc4;
    --wptd-primary-dark: #1458a0;
    --wptd-success: #27ae60;
    --wptd-danger: #e74c3c;
    --wptd-warning: #f39c12;
    --wptd-gray: #6c757d;
    --wptd-light: #f8f9fa;
    --wptd-border: #dee2e6;
    --wptd-radius: 10px;
    --wptd-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.wptd-wrapper { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }

/* Filter Bar */
.wptd-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 16px;
    background: var(--wptd-light);
    border-radius: var(--wptd-radius);
    margin-bottom: 20px;
    border: 1px solid var(--wptd-border);
}
.wptd-filter-label { font-weight: 600; font-size: 14px; color: #333; white-space: nowrap; }
.wptd-filter-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.wptd-filter-btn {
    padding: 6px 14px;
    border: 2px solid var(--wptd-border);
    background: #fff;
    color: #555;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}
.wptd-filter-btn:hover { border-color: var(--wptd-primary); color: var(--wptd-primary); }
.wptd-filter-btn.active {
    background: var(--wptd-primary);
    border-color: var(--wptd-primary);
    color: #fff;
}

/* Layout: 2 columns */
.wptd-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 768px) {
    .wptd-layout { grid-template-columns: 1fr; }
    .wptd-job-detail { position: static !important; }
}

/* Job List */
.wptd-job-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 680px;
    overflow-y: auto;
    padding-right: 4px;
}
.wptd-job-list::-webkit-scrollbar { width: 4px; }
.wptd-job-list::-webkit-scrollbar-thumb { background: var(--wptd-border); border-radius: 4px; }

.wptd-job-item {
    padding: 14px 16px;
    border: 2px solid var(--wptd-border);
    border-radius: var(--wptd-radius);
    cursor: pointer;
    background: #fff;
    transition: all 0.2s ease;
    position: relative;
}
.wptd-job-item:hover { border-color: var(--wptd-primary); box-shadow: var(--wptd-shadow); }
.wptd-job-item.selected {
    border-color: var(--wptd-primary);
    background: #f0f6ff;
    box-shadow: var(--wptd-shadow);
}
.wptd-job-item.expired { opacity: 0.65; background: #fafafa; }
.wptd-job-item.expired .wptd-job-title { color: #888; }

.wptd-job-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.wptd-job-title {
    font-weight: 600;
    font-size: 15px;
    color: #222;
    line-height: 1.3;
    flex: 1;
}
.wptd-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    white-space: nowrap;
}
.wptd-badge.active { background: #e8f5e9; color: var(--wptd-success); }
.wptd-badge.expired { background: #fce4e4; color: var(--wptd-danger); }

.wptd-job-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.wptd-meta-item {
    font-size: 12px;
    color: #555;
    background: var(--wptd-light);
    padding: 2px 8px;
    border-radius: 4px;
}
.wptd-exp-date { font-size: 12px; color: var(--wptd-warning); font-weight: 500; }

/* Job Detail Panel */
.wptd-job-detail {
    border: 1px solid var(--wptd-border);
    border-radius: var(--wptd-radius);
    background: #fff;
    min-height: 400px;
    position: sticky;
    top: 20px;
    overflow: hidden;
}
.wptd-detail-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #aaa;
    text-align: center;
}
.wptd-placeholder-icon { font-size: 48px; margin-bottom: 12px; }

/* Detail Content */
.wptd-detail-content { padding: 24px; }
.wptd-detail-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--wptd-border);
    background: linear-gradient(135deg, #f0f6ff 0%, #fff 100%);
}
.wptd-detail-title { font-size: 22px; font-weight: 700; color: #1a1a1a; margin: 0 0 12px; }
.wptd-detail-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.wptd-detail-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}
.wptd-detail-badge.active-badge { background: #e8f5e9; color: var(--wptd-success); border: 1px solid #c8e6c9; }
.wptd-detail-badge.expired-badge { background: #fce4e4; color: var(--wptd-danger); border: 1px solid #ffcdd2; }
.wptd-detail-badge.type-badge { background: #e3f2fd; color: #1565c0; border: 1px solid #bbdefb; }
.wptd-detail-badge.store-badge { background: #fff3e0; color: #e65100; border: 1px solid #ffe0b2; }

/* Info Grid */
.wptd-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--wptd-border);
    background: var(--wptd-light);
}
.wptd-info-item {}
.wptd-info-label { font-size: 11px; font-weight: 600; color: #999; text-transform: uppercase; letter-spacing: 0.5px; }
.wptd-info-value { font-size: 14px; color: #333; font-weight: 500; margin-top: 2px; }
.wptd-info-value a { color: var(--wptd-primary); text-decoration: none; }
.wptd-info-value a:hover { text-decoration: underline; }

/* Job description */
.wptd-job-description { padding: 20px 24px; font-size: 15px; line-height: 1.7; color: #333; }
.wptd-job-description h2,
.wptd-job-description h3 { color: var(--wptd-primary); }

/* Apply button */
.wptd-apply-section {
    padding: 16px 24px;
    border-top: 1px solid var(--wptd-border);
    background: var(--wptd-light);
}
.wptd-apply-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--wptd-primary);
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    transition: background 0.2s ease, transform 0.1s ease;
}
.wptd-apply-btn:hover { background: var(--wptd-primary-dark); transform: translateY(-1px); }
.wptd-apply-btn:disabled, .wptd-apply-btn.disabled {
    background: #aaa;
    cursor: not-allowed;
    transform: none;
}
.wptd-expired-notice {
    color: var(--wptd-danger);
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Loading spinner */
.wptd-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
}
.wptd-spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--wptd-border);
    border-top-color: var(--wptd-primary);
    border-radius: 50%;
    animation: wptd-spin 0.8s linear infinite;
}
@keyframes wptd-spin { to { transform: rotate(360deg); } }

/* Modal */
.wptd-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: wptd-fade-in 0.2s ease;
}
@keyframes wptd-fade-in { from { opacity: 0; } to { opacity: 1; } }

.wptd-modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: wptd-slide-up 0.25s ease;
}
@keyframes wptd-slide-up { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.wptd-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--wptd-border);
}
.wptd-modal-header h3 { margin: 0; font-size: 18px; color: #222; }
.wptd-modal-close {
    background: none; border: none; font-size: 24px; cursor: pointer; color: #888;
    line-height: 1; padding: 0; width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center; border-radius: 50%;
}
.wptd-modal-close:hover { background: #f0f0f0; color: #333; }
.wptd-modal-body { padding: 24px; }

.wptd-applying-for { margin: 0 0 20px; color: #555; font-size: 14px; }
.wptd-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .wptd-form-row { grid-template-columns: 1fr; } }

.wptd-form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.wptd-form-group label { font-weight: 600; font-size: 13px; color: #444; }
.wptd-form-group .required { color: var(--wptd-danger); }
.wptd-form-group input,
.wptd-form-group textarea {
    padding: 10px 12px;
    border: 1.5px solid var(--wptd-border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    outline: none;
    font-family: inherit;
}
.wptd-form-group input:focus,
.wptd-form-group textarea:focus { border-color: var(--wptd-primary); }
.wptd-form-group textarea { resize: vertical; min-height: 90px; }

/* File upload */
.wptd-file-upload { }
.wptd-file-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 2px dashed var(--wptd-border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    background: var(--wptd-light);
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.wptd-file-label:hover { border-color: var(--wptd-primary); color: var(--wptd-primary); }
.wptd-file-label.has-file { border-color: var(--wptd-success); color: var(--wptd-success); background: #f0fff4; }
.file-note { font-size: 11px; color: #999; }

.wptd-submit-btn {
    width: 100%;
    padding: 13px;
    background: var(--wptd-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 4px;
}
.wptd-submit-btn:hover { background: var(--wptd-primary-dark); }
.wptd-submit-btn:disabled { background: #aaa; cursor: not-allowed; }

.wptd-success-msg {
    background: #e8f5e9; border: 1px solid #c8e6c9; color: var(--wptd-success);
    padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-weight: 500;
}
.wptd-error-msg {
    background: #fce4e4; border: 1px solid #ffcdd2; color: var(--wptd-danger);
    padding: 12px 16px; border-radius: 8px; margin-bottom: 16px;
}
.wptd-empty { text-align: center; padding: 40px 20px; color: #aaa; font-size: 15px; }
