/* ═══════════════════════════════════════════════════════════════════
   VACANSEE — Main Frontend Stylesheet
   Extracted from inline styles in header.php + job.php + index.php
   
   HOW TO USE:
   1. Add this line in header.php after the <style> closing tag:
      <link rel="stylesheet" href="<?= SITE_URL ?>/assets/css/main.css">
   2. Gradually remove inline styles from PHP files
   3. DO NOT remove the CSS variables from header.php — keep those inline
      because they use PHP values (primary_color, accent_color, etc.)
   ═══════════════════════════════════════════════════════════════════ */

/* ── TYPOGRAPHY UPGRADE ──────────────────────────────────────────── */
/* Replace Baloo 2 + Noto Sans with Inter for a modern, professional look.
   Add this import in header.php <head>:
   <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
   
   Then update CSS variables:
   --font-display: 'Inter', sans-serif;
   --font-body: 'Inter', sans-serif;
*/


/* ── JOB DETAIL PAGE — STICKY APPLY BAR ─────────────────────────── */
/* Shows a slim bar at the top when user scrolls past the hero on job.php */
* {
    box-sizing: border-box;
}
html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}
img,
table,
div {
    max-width: 100%;
}

.sticky-apply-bar {
    position: fixed;
    top: -60px;
    left: 0;
    right: 0;
    height: 56px;
    background: rgba(15, 23, 42, 0.97);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    transition: top 0.3s ease;
    box-shadow: 0 2px 16px rgba(0,0,0,0.15);
}

/* Public job detail/list responsive cleanup */
.container,
.main-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: auto;
    padding-left: 12px;
    padding-right: 12px;
}
.card,
.detail-section,
.sidebar-card,
.public-job-card {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    background: #fff;
}
.detail-section {
    margin-bottom: 20px;
    min-width: 0;
    overflow: hidden;
}
.rich-content.rte-display {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}
.special-instructions-section {
    overflow: visible;
}
.special-instructions-section .rte-display {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
}
.special-instructions-section .rte-display table {
    width: max-content;
    min-width: 100%;
    max-width: none;
}
.rich-content.rte-display table,
.rte-display table {
    width: max-content;
    min-width: 100%;
    max-width: none;
    table-layout: auto;
}
.rich-content.rte-display th,
.rich-content.rte-display td,
.rte-display table th,
.rte-display table td {
    min-width: 90px;
    word-break: normal;
    overflow-wrap: normal;
}
.rich-content.rte-display th,
.rte-display table th {
    white-space: nowrap;
}
.job-detail-grid,
.job-detail-grid > *,
.sidebar-card {
    min-width: 0;
    max-width: 100%;
}
.table-responsive,
.tbl-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table-responsive table,
.tbl-scroll table {
    width: 100%;
    border-collapse: collapse;
}
.table-responsive td,
.table-responsive th,
.tbl-scroll td,
.tbl-scroll th {
    white-space: nowrap;
    padding: 8px;
}
.detail-table {
    min-width: 520px;
}
.eligibility-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.eligibility-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fef9c3;
    border: 1px solid #fde047;
    color: #713f12;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    max-width: 100%;
    overflow-wrap: anywhere;
}
.eligibility-badge i {
    font-size: 11px;
    color: #ca8a04;
}
.eligibility-list {
    margin: 0 0 12px;
    padding-left: 20px;
    color: var(--text, #1e293b);
    line-height: 1.7;
}
.eligibility-note {
    margin: 8px 0 0;
    color: var(--text, #1e293b);
    line-height: 1.7;
}
.public-jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}
.public-job-card {
    border: 1px solid var(--border, #e2e8f0);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}
.public-job-card__badges,
.public-job-card__actions,
.public-job-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.public-job-card__title {
    font-family: var(--font-display, Inter, sans-serif);
    font-size: 16px;
    line-height: 1.35;
    margin: 8px 0 6px;
}
.public-job-card__title a {
    color: var(--secondary, #0f172a);
    text-decoration: none;
    overflow-wrap: anywhere;
}
.public-job-card__title a:hover {
    color: var(--primary, #1e40af);
}
.public-job-card__org {
    color: var(--text-muted, #64748b);
    font-size: 13px;
    margin: 0;
    overflow-wrap: anywhere;
}
.public-job-card__meta {
    flex-direction: column;
    color: var(--text, #1e293b);
    font-size: 13px;
}
.public-job-card__meta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.public-job-card__meta i {
    color: var(--primary, #1e40af);
    width: 14px;
}
.public-job-card__deadline {
    color: #dc2626;
    background: #fee2e2;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 700;
}
.public-job-card__deadline.is-today {
    background: #fef3c7;
    color: #92400e;
}
.public-job-card__deadline.is-closed {
    background: #f1f5f9;
    color: #64748b;
}
.public-job-card__actions {
    margin-top: auto;
}
.public-job-card__actions .btn {
    flex: 1;
    justify-content: center;
    min-width: 120px;
}
.hero,
.hero-section,
.job-header {
    width: 100%;
    overflow: hidden;
}
.hero h1,
.hero-section h1,
.job-header h1 {
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.job-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.job-actions button,
.job-actions .btn {
    flex: 1 1 auto;
    min-width: 0;
}

@media (min-width: 1024px) {
    .public-jobs-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 769px) and (max-width: 1023px) {
    .public-jobs-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    .container {
        width: 100%;
        padding-left: 12px;
        padding-right: 12px;
    }
    .detail-section,
    .sidebar-card,
    .public-job-card {
        padding: 14px;
        margin-bottom: 16px;
    }
    .ds-title {
        font-size: 16px;
    }
    .btn,
    .public-job-card__actions .btn,
    .jdh-actions .btn {
        width: 100%;
        justify-content: center;
    }
    .public-jobs-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .public-job-card__title {
        font-size: 15px;
    }
    .detail-table {
        font-size: 13px;
    }
    .table-responsive td,
    .table-responsive th,
    .tbl-scroll td,
    .tbl-scroll th {
        font-size: 13px;
        padding: 6px;
    }
}

/* Stable public ticker and footer link wrapping */
.ticker-wrapper {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    position: relative;
    border-radius: 8px;
}
.ticker-track {
    display: inline-block;
    white-space: nowrap;
    will-change: transform;
    min-width: auto;
    max-width: none;
}
.ticker-track span,
.ticker-track a {
    display: inline-block;
    margin-right: 40px;
}
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.footer-links li {
    width: 48%;
}
.footer-links a {
    width: 100%;
    display: inline-block;
}

@media (max-width: 768px) {
    .footer-links li {
        width: 48%;
    }
    .footer-links a {
        width: 100%;
        display: inline-block;
    }
}
.sticky-apply-bar.visible {
    top: 0;
}
.sticky-apply-bar .sticky-job-link {
    display: flex;
    align-items: center;
    min-width: 0;
    color: inherit;
    text-decoration: none;
    flex: 1 1 auto;
}
.sticky-apply-bar .sticky-job-link:hover .sticky-title {
    color: var(--accent, #f59e0b);
}
.sticky-apply-bar .sticky-title {
    color: white;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.sticky-apply-bar .sticky-meta {
    color: #94a3b8;
    font-size: 12px;
    margin-left: 12px;
}
.sticky-apply-bar .btn {
    flex-shrink: 0;
}

/* ── JOB DETAIL PAGE — TAB NAVIGATION ────────────────────────────── */
/* Optional: Organize job detail sections into tabs */
.job-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border, #e2e8f0);
    margin-bottom: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.job-tab {
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    border-bottom: 3px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}
.job-tab:hover {
    color: var(--primary, #4F46E5);
    background: var(--primary-light, #EEF2FF);
}
.job-tab.active {
    color: var(--primary, #4F46E5);
    border-bottom-color: var(--primary, #4F46E5);
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}


/* ── WHATSAPP SHARE BUTTON ───────────────────────────────────────── */
.whatsapp-share {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #25D366;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}
.whatsapp-share:hover {
    background: #1da851;
    color: white;
}
.whatsapp-share i {
    font-size: 18px;
}


/* ── FILTER PILLS (jobs.php) ─────────────────────────────────────── */
.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-light, #EEF2FF);
    color: var(--primary, #4F46E5);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--primary, #4F46E5);
}
.filter-pill .pill-remove {
    cursor: pointer;
    font-size: 14px;
    opacity: 0.7;
    transition: opacity 0.15s;
    text-decoration: none;
    color: inherit;
}
.filter-pill .pill-remove:hover {
    opacity: 1;
}


/* ── CLOSING SOON BADGE ──────────────────────────────────────────── */
.closing-soon-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #dc2626;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 700;
    animation: pulse-glow 2s infinite;
}
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.2); }
    50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}


/* ── DATE EXTENDED BADGE ─────────────────────────────────────────── */
.date-extended-badge {
    display: inline-block;
    background: #dcfce7;
    color: #16a34a;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 6px;
    vertical-align: middle;
}


/* ── JOB META DISPLAY SECTION (for dynamic fields on job.php) ──── */
.meta-fields-section {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.meta-field-item {
    display: flex;
    gap: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    align-items: flex-start;
}
.meta-field-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--primary-light, #EEF2FF);
    color: var(--primary, #4F46E5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.meta-field-label {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.meta-field-value {
    font-size: 13px;
    color: #1e293b;
    font-weight: 500;
    line-height: 1.5;
    margin-top: 2px;
}


/* ── PRINT STYLESHEET ────────────────────────────────────────────── */
@media print {
    .sticky-apply-bar,
    .whatsapp-share,
    .job-tabs,
    nav,
    footer,
    .sidebar,
    .scroll-top-btn,
    .telegram-cta,
    .subscribe-section {
        display: none !important;
    }
    
    .tab-content {
        display: block !important;
    }
    
    body {
        font-size: 12pt;
        color: black;
        background: white;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    .detail-section {
        break-inside: avoid;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666;
    }
}


/* ── RESPONSIVE FIXES ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sticky-apply-bar {
        padding: 0 12px;
    }
    .sticky-apply-bar .sticky-meta {
        display: none;
    }
    .meta-fields-section {
        grid-template-columns: 1fr;
    }
    .filter-pills {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }
}

/* Shared responsive logo system */
.logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    background: #fff;
    border-radius: 7px;
    padding: 2px 6px;
}
.logo {
    display: block;
    max-height: 50px;
    width: auto;
    height: auto;
    object-fit: contain;
}
.logo-wrapper img,
.logo img {
    max-width: 100%;
    height: auto;
}
.logo-long {
    display: block;
    max-width: 235px;
}
.logo-short {
    display: none;
}

@media (max-width: 768px) {
    .logo-wrapper {
        padding: 3px 5px;
    }
    .logo {
        max-height: 40px;
    }
    .logo-long {
        display: block;
        max-width: min(168px, 44vw);
    }
}

@media (max-width: 480px) {
    .logo {
        max-height: 36px;
    }
    .logo-long {
        max-width: min(150px, 52vw);
    }
}
