:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #eff6ff;
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-600: #475569;
    --slate-400: #94a3b8;
    --slate-100: #f1f5f9;
    --white: #ffffff;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 12px;
}

/* 1. Reset & Global */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    font-family: 'Inter', system-ui, -apple-system, sans-serif; 
    background: var(--slate-100); 
    color: var(--slate-900); 
    line-height: 1.6;
    overflow-x: hidden; 
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }

/* 2. Interactive Navigation */
.navbar { 
    background: var(--white); 
    padding: 1.25rem 0; 
    border-bottom: 1px solid #e2e8f0; 
    position: sticky; 
    top: 0; 
    z-index: 100; 
}
.navbar .container { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.5rem; font-weight: 800; color: var(--slate-900); text-decoration: none; }
.logo span { color: var(--primary); }

/* 3. Hero & Job List */
.hero { background: var(--white); padding: 4rem 0; border-bottom: 1px solid #e2e8f0; }
.hero h1 { font-size: 2.75rem; font-weight: 800; letter-spacing: -0.025em; }

.job-grid { padding: 3rem 0; display: grid; gap: 1.5rem; }
.job-card { 
    background: var(--white); 
    padding: 2rem; 
    border-radius: var(--radius); 
    border: 1px solid #e2e8f0; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    transition: all 0.3s ease; 
}
.job-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--primary); }

/* 4. MODAL STRUCTURAL CHANGES (RELEVANT UPDATES) */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    display: none; 
    justify-content: center;
    align-items: center;
    z-index: 1100;
}

.modal-content {
    background: white;
    width: 700px;
    max-width: 95vw;
    max-height: 90vh; /* Benchmark: Keeps modal from going off-screen */
    border-radius: 20px;
    display: flex;
    flex-direction: column; /* Relevant: Stack header, body, footer */
    position: relative;
    overflow: hidden;
}

.modal-header {
    padding: 1.5rem 2.5rem;
    border-bottom: 1px solid var(--slate-100);
    background: white;
    flex-shrink: 0;
}

.modal-body {
    padding: 2rem 2.5rem;
    overflow-y: auto; /* Relevant: Allows the form to scroll */
    flex: 1; /* Relevant: Takes up remaining space */
}

.modal-footer {
    padding: 1.25rem 2.5rem;
    border-top: 1px solid var(--slate-100);
    background: #f8fafc;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

/* 5. Form Styling */
.form-section-static {
    margin-bottom: 3rem;
}

.form-section-static h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group { margin-bottom: 1.25rem; }
.form-group label { 
    display: block; 
    margin-bottom: 0.5rem; 
    font-weight: 600; 
    font-size: 0.8rem; 
    text-transform: uppercase;
    color: var(--slate-600);
}

input, textarea { 
    width: 100%;
    padding: 0.75rem 1rem; 
    border: 1px solid #cbd5e1; 
    border-radius: 8px; 
    font-size: 1rem; 
}

/* Relevant: Added Grid for City/Country & Phone/CNIC */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.dynamic-row {
    background: var(--slate-100);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary);
    position: relative;
}

.remove-row {
    position: absolute;
    top: 10px; right: 10px;
    color: #ef4444;
    cursor: pointer;
}

/* 6. Buttons */
.btn-apply { 
    background: var(--slate-900); 
    color: white; 
    padding: 0.8rem 2rem; 
    border-radius: 8px; 
    border: none; 
    font-weight: 700; 
    cursor: pointer; 
}
.btn-apply:hover { background: var(--primary); }

.btn-secondary { 
    background: white; 
    color: var(--slate-600); 
    padding: 0.8rem 1.5rem; 
    border-radius: 8px; 
    border: 1px solid #cbd5e1; 
    font-weight: 600; 
    cursor: pointer; 
}

/* 7. File Upload */
.file-upload-wrapper {
    border: 2px dashed #cbd5e1;
    padding: 2rem;
    text-align: center;
    border-radius: 12px;
    background: var(--slate-100);
    position: relative;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* Custom Scrollbar for Modal Body */
.modal-body::-webkit-scrollbar {
    width: 6px;
}
.modal-body::-webkit-scrollbar-thumb {
    background: var(--slate-400);
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
    .job-card { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .modal-content { width: 100%; height: 100%; max-height: 100vh; border-radius: 0; }
}

.admin-container { padding: 2rem; background: #f8fafc; min-height: 100vh; }

.job-group { 
    background: white; 
    border-radius: 12px; 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); 
    margin-bottom: 2.5rem; 
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.job-header { 
    background: #1e293b; 
    color: white; 
    padding: 1.25rem 2rem; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.job-header h3 { margin: 0; font-size: 1.25rem; letter-spacing: 0.025em; }

.app-table { width: 100%; border-collapse: collapse; }
.app-table th { 
    background: #f1f5f9; 
    text-align: left; 
    padding: 1rem; 
    font-size: 0.8rem; 
    text-transform: uppercase; 
    color: #64748b; 
}

.app-table td { padding: 1.25rem 1rem; border-bottom: 1px solid #f1f5f9; vertical-align: top; }

.contact-cell span { display: block; font-size: 0.85rem; color: #475569; margin-bottom: 4px; }

.btn-download { 
    background: #eff6ff; 
    color: #2563eb; 
    padding: 6px 12px; 
    border-radius: 6px; 
    text-decoration: none; 
    font-weight: 600; 
    font-size: 0.85rem; 
}

.btn-download:hover { background: #2563eb; color: white; }

.btn-view-details {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}
/* ============================================================
   PROFESSIONAL RIGHT-SIDE DRAWER SYSTEM 
   ============================================================ */

/* 1. The Overlay (Blurred Background) */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9998; /* Just below drawer */
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* 2. The Drawer Panel */
.drawer {
    position: fixed !important;
    top: 0 !important;
    right: -550px !important; /* Start completely off-screen */
    width: 500px !important;
    max-width: 90vw;
    height: 100vh !important;
    background: var(--white) !important;
    z-index: 9999 !important;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
    display: block !important;
    left: auto !important; /* Critical: prevents centering */
    margin: 0 !important;
}

/* 3. The Slide-in Animation */
.drawer.active {
    transform: translateX(-550px) !important; /* Moves it from -550 to 0 relative to right edge */
}

/* Show overlay when drawer is active */
.drawer.active + .drawer-overlay {
    display: block;
    opacity: 1;
}

/* 4. The Close Button (X) */
.close-drawer {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--slate-100);
    color: var(--slate-600);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10001;
}

.close-drawer:hover {
    background: #ef4444; /* Corporate red on hover */
    color: white;
    transform: rotate(90deg);
}

/* 5. Drawer Content Area */
#drawerBody {
    padding: 3rem 2.5rem;
    overflow-y: auto;
    height: 100%;
}

/* ============================================================
   MULTINATIONAL FOOTER DESIGN
   ============================================================ */
.site-footer {
    background: var(--slate-900);
    color: var(--white);
    padding: 5rem 0 2rem;
    margin-top: 5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 3rem;
}

.footer-bottom {
    padding-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--slate-400);
}

/* 1. BACK BUTTON & TOP BAR */
.top-util-bar {
    background: var(--slate-100);
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.btn-back {
    background: none;
    border: none;
    color: var(--slate-600);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
}

.btn-back:hover { color: var(--primary); }

/* 2. PREMIUM FILTER BAR */
.filter-bar {
    display: flex;
    gap: 1rem;
    background: var(--white);
    padding: 0.75rem;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    max-width: 900px;
}

.search-wrapper { 
    flex: 2; 
    display: flex; 
    align-items: center; 
    padding-left: 1rem; 
}

.search-wrapper i { color: var(--slate-400); }

.search-wrapper input {
    border: none !important;
    background: transparent;
    padding: 0.75rem;
}

.select-wrapper {
    flex: 1;
    position: relative;
    border-left: 1px solid #e2e8f0;
}

#deptFilter {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: var(--white);
    font-weight: 600;
    color: var(--slate-800);
    cursor: pointer;
    appearance: none; /* Removes default arrow */
}

/* Custom Arrow for Select */
.select-wrapper::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--slate-400);
    pointer-events: none;
}

/* 3. CONTENT DECORATION */
.badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}
/* CUSTOM ROLLER (SCROLLBAR) FOR DRAWER */

/* 1. Define the width of the roller */
.drawer-content::-webkit-scrollbar {
    width: 6px;
}

/* 2. Style the track (the background of the roller) */
.drawer-content::-webkit-scrollbar-track {
    background: #f1f5f9; 
    border-radius: 10px;
}

/* 3. Style the handle (the part that moves) */
.drawer-content::-webkit-scrollbar-thumb {
    background: var(--slate-400); /* Professional grey */
    border-radius: 10px;
    transition: background 0.3s ease;
}

/* 4. Change color when hovering over the roller */
.drawer-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary); /* Turns blue when you interact with it */
}

/* Ensure the drawer content area is the one scrolling */
.drawer-content {
    height: 100%;
    overflow-y: auto; /* This enables the roller */
    padding-right: 15px; /* Adds space so text doesn't touch the roller */
    scrollbar-width: thin; /* For Firefox */
    scrollbar-color: var(--slate-400) #f1f5f9; /* For Firefox */
}

/* ============================================================
   MOBILE RESPONSIVENESS FIX (January 2026 Update)
   ============================================================ */

/* Desktop Defaults (Keep these outside media query) */
.benefits-grid, .footer-grid { display: grid; gap: 2rem; }
.benefits-grid { grid-template-columns: 1fr 1fr; }
.footer-grid { grid-template-columns: 2fr 1fr 1fr; }
.nav-flex { display: flex; justify-content: space-between; align-items: center; }

@media (max-width: 768px) {
    /* 1. Reset all grids to 1 column */
    .benefits-grid, 
    .footer-grid, 
    .form-grid { 
        grid-template-columns: 1fr !important; 
        gap: 2.5rem;
    }

    /* 2. Fix the Hero Text overlap */
    .hero h1 { font-size: 1.8rem !important; line-height: 1.3; }
    .hero p { font-size: 1rem !important; }

    /* 3. Navbar Fix: Stack logo and back button */
    .nav-flex { 
        flex-direction: row; 
        flex-wrap: nowrap; 
    }
    .nav-links { display: none; } /* Hides menu links to make room */

    /* 4. Footer: Center text for professional mobile look */
    .footer-grid { text-align: left; padding: 0 1rem; }
    
    /* 5. Benefits Image Placeholder: Make it full width */
    .benefits-grid div[style*="height: 350px"] {
        height: 200px !important;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .logo { font-size: 1.1rem; }
    .btn-back { font-size: 0.8rem; }
}
/* --- Logic for JS-generated elements --- */
.job-card-top-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.job-meta { color: var(--slate-600); font-size: 0.9rem; display: flex; gap: 15px; }
.card-actions { display: flex; gap: 10px; margin-top: 15px; }

/* --- GRID SYSTEM --- */
.form-grid, .form-grid-edu { 
    display: grid; 
    gap: 1rem; 
}
.form-grid { grid-template-columns: 1fr 1fr; }
.form-grid-edu { grid-template-columns: 2fr 1fr; }

/* --- MOBILE OVERRIDES --- */
@media (max-width: 768px) {
    /* Drawer Fix */
    .drawer { 
        width: 100% !important; 
        right: -100% !important; 
    }
    .drawer.active { transform: translateX(-100%) !important; }
    #drawerBody { padding: 2rem 1rem; }

    /* Form Grid Fix */
    .form-grid, .form-grid-edu { 
        grid-template-columns: 1fr !important; 
    }

    /* Card Fix */
    .job-card { flex-direction: column; }
    .card-actions { width: 100%; }
    .card-actions button { flex: 1; }

    /* Fix the overlapping footer/hero from your screenshot */
    .footer-grid, .benefits-grid {
        grid-template-columns: 1fr !important;
        text-align: left;
    }
    
    /* Ensure Modal/Drawer doesn't scroll the background */
    body.modal-open { overflow: hidden; }
}
/* FORCE MOBILE STACKING - CareerPulse Final Fix */
@media (max-width: 768px) {
    /* 1. Force all grids to 1 column regardless of inline styles */
    div[style*="display: grid"], 
    .benefits-grid, 
    .footer-grid, 
    .form-grid,
    .job-grid {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 2rem !important;
    }

    /* 2. Fix the Drawer (Details View) */
    .drawer {
        width: 100% !important;
        right: -100% !important;
    }
    .drawer.active {
        transform: translateX(-100%) !important;
    }
    .drawer-content {
        width: 100% !important;
        padding: 1rem !important;
    }

    /* 3. Fix Footer squashing seen in your screenshot */
    footer div[style*="grid-template-columns"] {
        display: flex !important;
        flex-direction: column !important;
        text-align: left !important;
    }

    /* 4. Fix Navbar & Back Button */
    .navbar .container {
        flex-direction: row !important;
        justify-content: space-between !important;
        padding: 0 1rem !important;
    }
    .nav-links {
        display: none !important; /* Hide links to make room for back button */
    }

    /* 5. Hero Section Fix */
    .hero h1 {
        font-size: 1.8rem !important;
        white-space: normal !important;
    }
}
@media (max-width: 768px) {
    .btn-back {
        position: static !important;
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
        background: #f1f5f9 !important; /* Give it a slight background so it looks like a button */
        border-radius: 6px !important;
    }
}
/* FINAL MOBILE COLLAPSE FIX */
@media (max-width: 768px) {
    /* Force every grid and flex container to stack vertically */
    .container, 
    .navbar-content, 
    .benefits-grid, 
    .footer-grid, 
    div[style*="display: grid"], 
    div[style*="display: flex"] {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: 1fr !important;
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        gap: 2rem !important;
    }

    /* Fix the Logo and Back Button specifically */
    .navbar .container {
        flex-direction: row !important; /* Keep logo and back button side-by-side */
        justify-content: space-between !important;
        align-items: center !important;
    }

    /* Prevent text from overlapping or squashing */
    h1, h2, h3 {
        word-wrap: break-word !important;
        font-size: 1.8rem !important;
        line-height: 1.2 !important;
    }

    /* Hide the Image Placeholder on mobile if it's causing width issues */
    div[style*="height: 350px"] {
        height: 200px !important;
        width: 100% !important;
    }

    /* Fix Footer Links stacking */
    footer ul {
        padding: 0 !important;
        margin-bottom: 2rem !important;
    }
}
@media (max-width: 768px) {
    /* Force the drawer to full width */
    .drawer {
        width: 100% !important;
        right: -100% !important; /* Start hidden off-screen to the right */
        transition: transform 0.3s ease-in-out;
    }

    /* When active, slide it in to cover the whole screen */
    .drawer.active {
        transform: translateX(-100%) !important;
    }

    .drawer-content {
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important; /* Remove rounded corners on mobile */
        padding: 60px 20px 20px 20px !important; /* Make room for the close button */
        overflow-y: auto !important; /* Ensure you can scroll the details */
    }

    /* Position the close button so it's easy to tap */
    .close-drawer {
        top: 15px !important;
        right: 15px !important;
        font-size: 2rem !important;
        z-index: 1001;
    }
    
    /* Ensure the backdrop covers everything */
    .drawer-overlay {
        z-index: 999 !important;
    }
}
/* Ensure these styles are inside your @media (max-width: 768px) block */
@media (max-width: 768px) {
    .drawer {
        width: 100% !important; /* Force full width */
        max-width: 100% !important; /* Remove any desktop limits */
        right: -100% !important; /* Start completely off-screen to the right */
        left: auto !important;
        top: 0 !important;
        height: 100vh !important;
        z-index: 9999 !important;
    }

    /* This is the class your JS triggers */
    .drawer.active {
        transform: translateX(-100%) !important; /* Slide the 100% width into view */
    }

    .drawer-content {
        width: 100% !important;
        height: 100% !important;
        padding: 80px 20px 40px !important; /* Extra top padding for the X button */
        border-radius: 0 !important;
        box-sizing: border-box !important;
    }

    /* Make sure the close button is visible and clickable */
    .close-drawer {
        position: fixed !important;
        top: 20px !important;
        right: 20px !important;
        background: #f1f5f9 !important;
        width: 40px !important;
        height: 40px !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
    }
}
/* --- THE CLOSE BUTTON (X) MASTER FIX --- */

/* 1. Default State: Hidden and non-interactable */
.close-drawer {
    position: absolute !important; /* Absolute relative to the drawer */
    top: 20px !important;
    right: 20px !important;
    z-index: 10001 !important;
    background: #f1f5f9 !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
    cursor: pointer;
    
    /* Crucial: Hide it by default */
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease !important;
}

/* 2. Active State: Only show when drawer is open */
.drawer.active .close-drawer {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* 3. Mobile Specific Positioning */
@media (max-width: 768px) {
    .close-drawer {
        top: 15px !important;
        right: 15px !important;
        position: fixed !important; /* Keep it pinned while scrolling the JD */
    }
}