/* =========================================================
   /jobynew/assets/style.css
   Complete Stylesheet for Joby.ps Portal
   ========================================================= */

/* --- 1. Import Google Fonts (Poppins for EN, Zain for AR) --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&family=Zain:wght@300;400;700;800&display=swap');

/* --- 2. Joby.ps Brand Color Palette --- */
:root {
    /* Core Brand Colors */
    --primary-color: #233d7b; /* Signature Blue */
    --primary-hover: #005a87; /* Darker Blue */
    
    /* NEW: Brand Accent Colors */
    --accent-color: #f5cd60;  /* Joby Gold/Yellow */
    --accent-hover: #e0b94c;  /* Slightly darker gold for hover states */
    --accent-text: #5a450e;   /* Dark brown/gold for reading text on top of the accent color */

    /* Neutrals */
    --text-main: #333333;
    --text-muted: #888888;
    --bg-body: #f5f5f5;
    --bg-container: #ffffff;
    --border-light: #eaeaea;
    
    /* Form & Alert Colors (Adjusted to suit the brand) */
    --success-bg: #e6f9ed;
    --success-border: #2ecc71;
    --success-text: #1b7a42;
    
    --error-bg: #fdf2f2;
    --error-border: #e74c3c;
    --error-text: #962a1e;
}

/* --- 3. Global Resets & Typography --- */
body { 
    /* Default to English Font */
    font-family: 'Poppins', Zain; 
    margin: 0; 
    padding: 0; 
    background-color: var(--bg-body); 
    color: var(--text-main);
}

/* Automatically swap to Zain when Arabic is selected */
html[dir="rtl"] body {
    font-family: 'Zain', Poppins;
}

/* --- 4. Header & Navigation Styling --- */
.site-header { 
    background-color: var(--bg-container);
    border-bottom: 3px solid var(--primary-color);
    padding: 15px 30px; 
    display: flex; 
    flex-direction: row-reverse; 
    justify-content: space-between; 
    align-items: center; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: relative; 
    
    /* NEW: Perfectly align with main container */
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
    border-radius: 0 0 8px 8px; /* Smooth bottom corners */
	z-index: 9999;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    max-height: 45px; 
    width: auto;
}

/* Grouped actions container (Nav + Language) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 25px; /* Clean spacing between nav and button */
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 15px; /* Clean spacing between links */
}

/* Hide the hamburger button on Desktop securely */
.menu-toggle { 
    display: none; 
    background: transparent !important; 
    border: none !important; 
    font-size: 26px; 
    color: var(--primary-color); 
    cursor: pointer; 
    padding: 5px;
    outline: none;
}

.main-nav a { 
    color: var(--text-main); 
    text-decoration: none; 
    font-weight: 600;
    transition: color 0.3s ease;
    white-space: nowrap; /* Prevents text from breaking onto two lines */
	font-size:small;
}

.main-nav a:hover { 
    color: var(--primary-color); 
}

/* Icon spacing inside navigation links */
.main-nav a i { margin-right: 6px; }
html[dir="rtl"] .main-nav a i { margin-right: 0; margin-left: 6px; }

/* Language Switcher Button */
.lang-btn { 
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 8px 20px; 
    border-radius: 25px; 
    font-size: 14px; 
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Zain', sans-serif;
}

.lang-btn:hover {
    background-color: var(--primary-hover);
}

/* When site switches to Arabic (RTL), the button says "English". We force Poppins. */
html[dir="rtl"] .lang-btn {
    font-family: 'Poppins', sans-serif;
}

/* --- 5. Main Content Container --- */
.container { 
    max-width: 1200px; 
    margin: 30px auto; 
    padding: 30px; 
    background: var(--bg-container); 
    box-shadow: 0 0 15px rgba(0,0,0,0.05); 
    border-radius: 8px;
    min-height: 50vh;
    
    /* NEW: Forces the box to stay exactly 1200px wide */
    box-sizing: border-box;
}

/* --- 6. Footer Styling --- */
.site-footer { 
    padding: 50px; 
    background: var(--bg-container); 
    color: var(--text-muted); 
    border-top: 1px solid var(--border-light);
    font-size: 14px;
    
    /* NEW: Perfectly align with main container */
    max-width: 1200px;
    margin: 40px auto 20px auto; /* Adds a little breathing room at the very bottom */
    box-sizing: border-box;
    border-radius: 8px; /* Matches the container corners */
}

/* --- 7. Automatic RTL Support --- */
/* REMOVED the broken row-reverse. We only need text alignment now. */
html[dir="rtl"] body {
    text-align: right;
}

/* =========================================================
   8. Mobile Responsiveness (Triggering earlier at 991px)
   ========================================================= */
@media (max-width: 991px) {
    .site-header {
        display:none;
    }

    /* 1. Show Hamburger Menu Button */
    .menu-toggle { 
        display: block; 
    }

    /* 2. Hide actions, setup absolute positioning for dropdown */
    .header-actions {
        display: none; 
        position: absolute;
        top: 100%; 
        left: 0;
        right: 0;
        width: 100%;
        background-color: var(--bg-container);
        flex-direction: column;
        align-items: stretch; /* Stretch children to full width */
        padding: 0; /* Remove padding to let links touch edges */
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        border-top: 1px solid var(--border-light);
        z-index: 1000;
    }

    /* JavaScript will add this class to show the menu */
    .header-actions.show-menu {
        display: flex;
    }

    /* 3. Stack links vertically */
    .main-nav {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 0;
    }

    .main-nav a {
        display: block;
        width: 100%;
        padding: 15px 25px;
        border-bottom: 1px solid var(--border-light);
        box-sizing: border-box;
    }

    /* 4. Position the language button nicely inside the mobile menu */
    .lang-switcher {
        padding: 20px 25px;
        width: 100%;
        box-sizing: border-box;
        display: flex;
    }

    .lang-btn {
        justify-content: center;
        width: auto;
        display: inline-flex;
    }

    .container {
        margin: 15px;
        padding: 15px;
        min-height: auto;
    }
}

/* =========================================================
   8. Mobile Responsiveness (Smartphones & App WebViews)
   ========================================================= */
@media (max-width: 768px) {
	
	.jobs-page-layout {
        display: flex;
        flex-direction: column;
    }
    
    .jobs-main {
        order: 1; /* Main content comes first on mobile */
    }
    
    .jobs-sidebar {
        order: 2; /* Sidebar is pushed below the main content */
        margin-top: 25px; /* Add some spacing between main and sidebar */
    }
    .site-header {
        padding: 15px 20px;
    }

    /* Show Hamburger Menu Button */
    .menu-toggle { 
        display: block; 
    }

    /* Hide the navigation actions by default on mobile, prepare for dropdown */
    .header-actions {
        display: none; 
        position: absolute;
        top: 100%; /* Push right below the header */
        left: 0;
        width: 100%;
        background-color: var(--bg-container);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        border-top: 1px solid var(--border-light);
        z-index: 1000;
        box-sizing: border-box;
    }

    /* JavaScript will add this class to show the menu */
    .header-actions.show-menu {
        display: flex;
    }

    /* Stack links vertically on mobile */
    .main-nav {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }

    .main-nav a {
        display: block;
        margin: 0;
        padding: 10px 0;
        border-bottom: 1px solid var(--border-light);
    }

    .lang-switcher {
        margin-top: 15px;
        width: 100%;
        text-align: center;
    }

    .lang-switcher a {
        display: inline-block;
    }

    /* Shrink the main container margins for mobile screens */
    .container {
        margin: 15px;
        padding: 15px;
        min-height: auto;
    }
	
	.submenu-toggle {
		display:flex;
		flex-direction: column;
        align-items: center;
	}
}

/* =========================================================
   9. Forms & Authentication (Login/Register)
   ========================================================= */
.auth-box {
    max-width: 500px;
    margin: 40px auto;
    background: var(--bg-container);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    border-top: 4px solid var(--primary-color);
}

.auth-box h2 {
    margin-top: 0;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.auth-box p.subtitle {
    color: var(--text-muted);
    margin-bottom: 25px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 15px;
    box-sizing: border-box;
    font-family: inherit; /* Inherits Poppins or Zain automatically */
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(0, 115, 170, 0.2);
}

.btn-primary {
    width: 100%;
	box-sizing: border-box;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
	font-family: inherit; /* <--- ADD THIS LINE */
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

/* Accent Button (Gold) - Perfect for primary calls to action */
.btn-accent {
    width: 100%;
    background-color: var(--accent-color);
    color: var(--accent-text); /* Using the dark text so it's easy to read on gold */
    border: none;
    padding: 14px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(245, 205, 96, 0.2);
	font-family: inherit; /* <--- ADD THIS LINE */
}

.btn-accent:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px); /* Slight lift effect on hover */
    box-shadow: 0 6px 12px rgba(245, 205, 96, 0.3);
}

.auth-links {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 600;
}
.alert-error { 
    background-color: var(--error-bg); 
    color: var(--error-text); 
    border-left: 4px solid var(--error-border); 
}
.alert-success { 
    background-color: var(--success-bg); 
    color: var(--success-text); 
    border-left: 4px solid var(--success-border); 
}

/* =========================================================
   10. Employer Dashboard Layout
   ========================================================= */
.dashboard-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.dashboard-sidebar {
    width: 250px;
    background: var(--bg-container);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    flex-shrink: 0; /* Prevents sidebar from squishing */
}

.dashboard-sidebar a {
    display: block;
    padding: 12px 15px;
    margin-bottom: 8px;
    color: var(--text-main);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
	font-size: small;
}

.dashboard-sidebar a i {
    margin-right: 10px;
}
html[dir="rtl"] .dashboard-sidebar a i {
    margin-right: 0;
    margin-left: 10px;
}

.dashboard-sidebar a:hover,
.dashboard-sidebar a.active {
    background-color: var(--primary-color);
    color: white;
}

.dashboard-content {
    flex: 1; /* Takes up remaining space */
    background: var(--bg-container);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
	box-sizing: border-box;
    width: 100%;
}

.logo-preview {
    max-width: 150px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid var(--border-light);
    display: block;
}

/* =========================================================
   11. Complex Form Layout (Job Posting) 
   ========================================================= */
.job-form-main {
    width: 100%;
    max-width: 900px; /* Keeps the form from getting too stretched on huge monitors */
    margin: 0 auto;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-body);
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    transition: border-color 0.2s ease;
}

.checkbox-group:hover {
    border-color: var(--primary-color);
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
}

.checkbox-group label {
    margin: 0;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    user-select: none; /* Prevents text highlighting when clicking rapidly */
}

/* Mobile adjustments */
@media (max-width: 991px) {
    .dashboard-layout {
        flex-direction: column;
    }
    .dashboard-sidebar {
        width: 100%;
        box-sizing: border-box;
    }
}

/* =========================================================
   12. Premium Job Form Styling & AJAX Elements
   ========================================================= */
.form-section {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.form-section-title {
    font-size: 18px;
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid var(--bg-body);
    padding-bottom: 10px;
}

.skills-wrapper {
    position: relative;
    width: 100%;
    z-index: 9999; /* Elevates the ENTIRE wrapper above the selected skills below it */
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    max-height: 200px;
    overflow-y: auto;
    display: none;
    /* You can leave z-index here or remove it, the wrapper's z-index is doing the heavy lifting now! */
}

/* Let's also make sure the selected skills container isn't accidentally fighting back */
.selected-skills-container {
    position: relative;
    z-index: 1; /* Forces it to stay underneath the wrapper */
    margin-top: 10px;
}

.autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.autocomplete-item:hover {
    background: var(--bg-body);
    color: var(--primary-color);
}

.skill-badge {
    background: var(--primary-color);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    animation: fadeIn 0.3s ease;
}

.skill-badge .remove-skill {
    cursor: pointer;
    font-weight: bold;
    color: #f5cd60;
    transition: color 0.2s;
}

.skill-badge .remove-skill:hover {
    color: #ffffff;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 13. Terms & Conditions Box --- */
.terms-container {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    border-left: 4px solid var(--primary-color);
}

.terms-scroll-box {
    height: 150px;
    overflow-y: auto;
    background: var(--bg-body);
    border: 1px inset var(--border-light);
    padding: 15px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.terms-scroll-box h4 {
    margin-top: 0;
    color: var(--text-main);
}

/* =========================================================
   14. Arabic (RTL) Typography Adjustments
       (Zain renders larger than Poppins, so we reduce by 2px)
   ========================================================= */

/* Headings */
html[dir="rtl"] h1 { font-size: 24px; } /* Was 28px */
html[dir="rtl"] h2 { font-size: 13px; } /* Was 24px */
html[dir="ltr"] h2 { font-size: 13px; } /* Was 24px */
html[dir="rtl"] h3 { font-size: 16px; } /* Was 18px */
html[dir="rtl"] h4 { font-size: 11px; } /* Was 16px */

/* Form Elements (Default was 16px) */
html[dir="rtl"] .form-control,
html[dir="rtl"] label,
html[dir="rtl"] .checkbox-group label {
    font-size: 13px;
}

/* Specific UI Components */
html[dir="rtl"] .form-section-title { font-size: 13px; } /* Was 18px */
html[dir="rtl"] .btn-primary,
html[dir="rtl"] .btn-accent { font-size: 13px; } /* Was 16px */
html[dir="rtl"] .lang-btn { font-size: 12px; } /* Was 14px */
html[dir="rtl"] .terms-scroll-box { font-size: 11px; } /* Was 13px */
html[dir="rtl"] .skill-badge { font-size: 11px; } /* Was 13px */
html[dir="rtl"] .dashboard-sidebar a { font-size: 13px; } /* Was 16px */

/* =========================================================
   15. Dashboard Statistics & Data Tables
   ========================================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    border-top: 4px solid var(--primary-color);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card.accent { border-top-color: var(--accent-color); }
.stat-card.danger { border-top-color: var(--error-border); }

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-main);
    margin: 10px 0;
    font-family: 'Poppins', sans-serif; /* Keep numbers standard */
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Data Table Styling */
.table-responsive {
    overflow-x: auto;
    background: #fff;
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

html[dir="rtl"] .data-table { text-align: right; }

.data-table th, .data-table td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-light);
	font-size: small;
}

.data-table th {
    background-color: var(--bg-body);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
}

.data-table tbody tr:hover { background-color: #fcfcfc; }

.status-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.active { background-color: #e6f4ea; color: #1e8e3e; }
.status-badge.expired { background-color: #fce8e6; color: #d93025; }

/* =========================================================
   16. Logged-In Header & User Dropdown
   ========================================================= */
.user-menu-container {
    position: relative;
    display: inline-block;
}

.user-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: inherit;
    font-size: small;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0;
    transition: color 0.3s ease;
}

.user-menu-btn i.fa-user-circle {
    margin-right: 6px;
    color: var(--primary-color);
    font-size: 18px;
}

html[dir="rtl"] .user-menu-btn i.fa-user-circle {
    margin-right: 0;
    margin-left: 6px;
}

.user-menu-btn:hover {
    color: var(--primary-color);
}

.user-dropdown {
    position: absolute;
    top: 150%;
    left: 0; 
    background: #ffffff;
    min-width: 220px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 1px solid var(--border-light);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

/* Flip dropdown alignment for Arabic */
html[dir="rtl"] .user-dropdown {
    left: auto;
    right: 0;
}

/* Show dropdown on hover */
.user-menu-container:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown Links */
.user-dropdown a {
    display: block;
    padding: 12px 20px;
    color: var(--text-main);
    text-decoration: none;
    font-size: smaller;
    border-bottom: 1px solid var(--bg-body);
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.user-dropdown a:last-child {
    border-bottom: none;
}

.user-dropdown a:hover {
    background: var(--bg-body);
    color: var(--primary-color);
}

.user-dropdown a i {
    width: 24px;
    color: var(--text-muted);
    text-align: center;
}

.user-dropdown a:hover i {
    color: var(--primary-color);
}

/* Fix the gold Post Job button in the header */
.header-post-btn {
    padding: 8px 20px;
    font-size: 14px;
    border-radius: 20px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    width: auto; /* Overrides the 100% width from .btn-accent */
}

/* Mobile Adjustments for the Dropdown & Post Button */
@media (max-width: 991px) {
    /* 1. Protect the Post Job Button from standard mobile link styling */
    /* 1. Enhanced Mobile Post Job Button */
    .main-nav .header-post-btn {
        width: calc(100% - 40px) !important; /* Leaves a perfect 20px gap on each side */
        margin: 20px auto 15px auto !important; /* Centers the button beautifully */
        padding: 14px 20px !important; /* Taller height makes it an easier tap target */
        font-size: 16px !important; /* Slightly larger, bolder text for mobile */
        border-radius: 50px !important; /* Guarantees the smooth pill shape */
        box-shadow: 0 8px 20px rgba(245, 205, 96, 0.4) !important; /* Stronger, deeper glow */
        justify-content: center;
        border-bottom: none !important;
        box-sizing: border-box;
    }

    /* 2. Format the Dropdown to push items down instead of floating */
    .user-dropdown {
        position: static;
        box-shadow: none;
        border: none;
        border-top: 1px solid var(--border-light);
        border-bottom: 1px solid var(--border-light);
        border-radius: 0;
        padding: 0;
        margin-top: 15px;
        width: 100%;
        display: none; /* Hidden strictly until tapped */
    }
    
    html[dir="rtl"] .user-dropdown {
        border-left: none;
        border-right: none;
        padding: 0;
    }
    
    /* 3. Disable the desktop hover effect on mobile */
    .user-menu-container:hover .user-dropdown {
        display: none; 
        transform: none;
    }
    
    /* 4. JS will add this class when the user taps "My Account" */
    .user-dropdown.active-mobile {
        display: block;
    }
}

/* =========================================================
   ULTIMATE MOBILE MENU FIX (Overrides all conflicts)
   ========================================================= */
   
/* Ensure the header never hides elements dropping below it */
.site-header {
    overflow: visible !important;
    z-index: 99999 !important;
}

@media (max-width: 991px) {
    /* Using the ID (#) creates ultimate specificity that cannot be overridden */
    #header-actions.show-menu {
        display: flex !important;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        background-color: #ffffff !important;
        z-index: 99999 !important;
        border-top: 1px solid var(--border-light) !important;
        box-shadow: 0 10px 25px rgba(0,0,0,0.15) !important;
    }

    /* Force the User Dropdown to show when tapped */
    .user-menu-container .user-dropdown.active-mobile {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
    }
}

/* =========================================================
   17. TinyMCE Editor Arabic (RTL) UI Alignment
   ========================================================= */
/* Pushes the toolbar rows to the right side when the language is Arabic */
html[dir="rtl"] .tox .tox-toolbar {
    justify-content: flex-end !important;
}

/* Optional: Flips the internal borders of the button groups to look native */
html[dir="rtl"] .tox .tox-toolbar__group {
    border-right: none !important;
    border-left: 1px solid var(--border-light) !important;
}
html[dir="rtl"] .tox .tox-toolbar__group:last-child {
    border-left: none !important;
}

/* =========================================================
   18. Public Job Board (jobs.php) - Premium Layout
   ========================================================= */
.search-banner { background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%); padding: 40px; border-radius: 8px; margin-bottom: 30px; box-shadow: 0 10px 30px rgba(0, 115, 170, 0.15); }
.search-form { display: flex; gap: 15px; flex-wrap: wrap; }
.search-input { flex: 2; min-width: 250px; padding: 15px 20px; border-radius: 8px; border: none; font-family: inherit; }
.search-select { flex: 1; min-width: 180px; padding: 15px 20px; border-radius: 8px; border: none; font-family: inherit; background-color: #fff; appearance: auto; }

/* The Main Card Container */
.job-card {
    background: var(--bg-container);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    overflow: hidden; /* Ensures the grey footer stays inside the rounded corners */
}

.job-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    border-color: var(--accent-color);
}

/* Top Section: Logo + Content */
.job-card-body {
    display: flex;
    flex-direction: row;
}

/* Isolated Logo Column */
.job-card-logo-wrap {
    padding: 15px;
    border-inline-end: 1px solid var(--border-light); /* Flips side automatically in RTL/LTR */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    flex-shrink: 0;
}

.job-card-logo-img {
    width: 80px;
    height: 80px;
    border-radius: 50%; /* Perfect circle like the screenshot */
    object-fit: contain;
    border: 1px solid var(--border-light);
    padding: 5px;
}

/* Main Content Area */
.job-card-main {
    padding: 10px 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.job-meta-top {
    font-size: 13px;
    color: var(--text-muted);
}

.job-title-link {
    text-decoration: none;
    display: inline-block;
}

.job-card-title {
    font-size: 16px;
    color: var(--primary-color);
    margin: 0;
    font-weight: 400;
    transition: color 0.2s;
}

.job-title-link:hover .job-card-title { color: var(--accent-color);}

.job-card-company-text {
    color: var(--text-muted);
	font-size:small;
}

.filter-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
	font-size:small;
}
.filter-link:hover { text-decoration: underline; }

/* Colored Badges */
.job-tags-row {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.job-badge {
    padding: 6px 14px;
    border-radius: 6px; /* Slightly squared pill */
    font-size: 11px !important;
}
.job-badge.blue { background: #e8f0fe; color: #1a73e8; }
.job-badge.red { background: #fce8e6; color: #d93025; }
.job-badge.grey { background: var(--bg-body); color: var(--text-main); font-size:small}

/* The Grey Footer Bar */
.job-card-footer {
    background-color: #f8f9fa; /* Light grey footer */
    border-top: 1px solid var(--border-light);
    padding: 5px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.job-meta-bottom {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 12px;
    flex-wrap: wrap;
}

.meta-separator { color: var(--border-light); }

/* Apply Button */
.btn-apply-outline {
    background: #ffffff;
    color: var(--text-main);
    border: 1px solid var(--border-light);
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
	font-family: inherit;
}

.btn-apply-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* =========================================================
   Mobile Overrides for Job Cards (max-width: 768px)
   ========================================================= */
@media (max-width: 768px) {
    
    /* 1. Force the body to stay side-by-side (row) instead of stacking */
    .job-card-body {
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start !important;
        text-align: start !important;
        gap: 5px !important;
    }
	
	.dashboard-content {
    padding: 10px;
}
	
	.job-badge {
		font-size:10px !important;
		padding: 3px 7px;
	}

    /* 2. Shrink the logo slightly so it fits nicely next to the text */
    .job-card-logo-img {
        width: 60px !important;
        height: 60px !important;
        flex-shrink: 0 !important;
        margin: 0 !important; /* Removes the bottom margin from the old stacked layout */
		padding:3px;
    }

    /* 3. Ensure the text section takes up the rest of the space without overflowing */
    .job-card-main {
        flex: 1 !important;
        min-width: 0 !important; /* This stops long text from breaking the card */
        padding: 0 !important;
    }

    /* 4. Hide the "Apply Now" button specifically on mobile */
    .job-card-footer .btn-apply-outline {
        display: none !important;
    }

    /* 5. Keep the footer meta details aligned nicely */
    .job-card-footer {
        display: flex !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
        padding-top: 12px !important;
    }
}

/* =========================================================
   19. Sidebar & Two-Column Layout (jobs.php)
   ========================================================= */
.jobs-page-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.jobs-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.jobs-main {
    flex: 1;
    min-width: 0; /* Prevents long titles from breaking the flex container */
	width:100%;
}

/* Sidebar Category Widget */
.sidebar-widget {
    background: var(--bg-container);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.sidebar-widget h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 18px;
    border-bottom: 2px solid var(--bg-body);
    padding-bottom: 12px;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: 15px;
    border-bottom: 1px dashed var(--bg-body);
    padding-bottom: 10px;
}

.category-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.category-list a {
    display: flex;
    flex-direction: column;
    color: var(--text-main);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: color 0.2s;
}

.category-list a:hover {
    color: var(--primary-color);
}

.category-count {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: normal;
    margin-top: 4px;
}

/* Push sidebar to the top on mobile screens */
@media (max-width: 991px) {
    .jobs-page-layout { flex-direction: column; }
    .jobs-sidebar { width: 100%; }
}

/* Clickable links in the job card footer */
.footer-filter-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-filter-link:hover {
    color: var(--accent-color);
}

/* =========================================================
   20. Job Details Page (job_details.php)
   ========================================================= */
.job-details-header {
    display: flex;
    align-items: flex-start;
    gap: 25px;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.04);
    margin-bottom: 30px;
    border: 1px solid var(--border-light);
}

.job-details-logo-wrapper {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    padding: 10px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}



.job-details-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.job-details-info {
    flex: 1;
    min-width: 0; /* Critical: prevents text from pushing outside the box on mobile */
}

.job-details-title {
    margin: 0 0 12px 0;
    color: var(--primary-color);
    font-size: 16px !important;
    line-height: 1.3;
    font-weight: 600;
}

.job-details-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px; /* row-gap, column-gap */
    font-size: smaller;
    color: var(--text-muted);
    align-items: center;
}

.job-details-meta .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.job-details-meta .company-link {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.2s;
}

.job-details-meta .company-link:hover {
    color: var(--accent-color);
}

.job-details-meta .meta-item i {
    color: #a0aec0; /* Soft gray for icons */
}

@media (max-width: 768px) {
    .job-details-header {
        flex-direction: row; /* Keeps logo next to text instead of stacking */
        gap: 15px;
        padding: 20px;
    }

    .job-details-logo-wrapper {
        width: 65px;
        height: 65px;
        padding: 6px;
        border-radius: 8px;
    }

    .job-details-title {
        font-size: 16px !important;
        margin-bottom: 10px;
    }

    .job-details-meta {
        gap: 8px 15px;
        font-size: 14px;
    }
}

.job-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid var(--border-light);
}

.meta-box {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.meta-box-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

.meta-box-value {
    font-size: 12px;
    color: var(--text-main);
    font-weight: 700;
}

.job-description-content {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    line-height: 1.8;
}

/* Apply Section styling */
.apply-section {
    background: #fff;
    border: 1px solid var(--primary-color);
    border-top: 5px solid var(--primary-color);
    padding: 30px;
    border-radius: 8px;
    margin-top: 30px;
    text-align: center;
}

/* Enhanced Mobile Overrides for Job Details Page */
@media (max-width: 768px) {
    .job-details-logo {
        width: 80px;
        height: 80px;
    }

    



    /* 5. Reduce padding on the inner containers */
    .job-meta-grid {
        padding: 15px;
        gap: 15px;
        /* Keep items 2-by-2 on mobile instead of a massive single column */
        grid-template-columns: repeat(2, 1fr); 
    }
    
    .job-description-content {
        padding: 20px;
    }
    
    .apply-section {
        padding: 20px;
    }

    /* 6. Ensure Apply buttons don't break off the edge of the screen */
    .apply-section .btn-accent {
        width: 100% !important;
        padding: 15px 20px !important;
        font-size: 16px !important;
        box-sizing: border-box;
    }
}

/* Fix for ultra-small screens (e.g., iPhone SE) */
@media (max-width: 380px) {
    .job-meta-grid {
        grid-template-columns: 1fr; /* Snap to 1 column only if the phone is incredibly small */
    }
}

/* =========================================================
   ULTIMATE MOBILE SPACE SAVER (Maximizes Screen Width)
   ========================================================= */
@media (max-width: 768px) {
    /* 1. Flush the global container to the edges of the phone */
    .container {
        margin: 0 auto !important;
        padding: 10px !important;
        border-radius: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 2. Reduce the massive gap between the Sidebar and Main Jobs column */
    .jobs-page-layout {
        gap: 15px !important;
    }

    /* 4. Tighten the Search Banner */
    .search-banner {
        padding: 20px 15px !important;
        margin-bottom: 15px !important;
    }
    
    .search-form {
        gap: 10px !important;
    }

    /* 5. Maximize text width inside the Job Cards */
    .job-card {
        padding: 0 !important; /* Remove the outer card padding */
    }

    .job-card-logo-wrap {
        padding: 5px !important;
		align-self: stretch !important;
    }

    .job-card-main {
        padding: 12px !important; /* Give the text its own tight padding */
    }

    .job-card-footer {
        padding: 12px 15px !important;
    }
    
    /* 6. Fix for Job Details page grids */
    .job-meta-grid {
        padding: 15px !important;
        gap: 15px !important;
    }
    
    .job-description-content {
        padding: 15px !important;
    }
	
	.jobs-main {
		width:100%;
	}
}

/* =========================================================
   21. Public Company Profile (company.php)
   ========================================================= */
.company-profile-hero {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    margin-bottom: 30px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.company-cover-photo {
    height: 150px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    position: relative;
}

.company-profile-main {
    padding: 0 30px 30px 30px;
    position: relative;
}

.company-profile-logo-wrap {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    background: #fff;
    border: 4px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    margin-top: -60px; /* Pulls the logo up into the cover photo */
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
}

.company-profile-logo-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.company-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
}

.company-profile-name {
    font-size: 28px;
    color: var(--primary-color);
    margin: 0 0 10px 0;
}

.company-social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-circle {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--bg-body);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s;
}

.social-circle:hover {
    background: var(--primary-color);
    color: #fff;
}

.company-content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.company-about-box {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 30px;
    line-height: 1.8;
}

.company-sidebar-box {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (max-width: 991px) {
    .company-content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .company-profile-main { padding: 0 20px 20px 20px; text-align: center; }
    .company-profile-logo-wrap { margin: -60px auto 15px auto; }
    .company-header-flex { flex-direction: column; align-items: center; text-align: center; }
    .company-social-links { justify-content: center; }
}

/* =========================================================
   22. Homepage Layout (index.php)
   ========================================================= */
/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #005a88 100%);
    padding: 80px 20px;
    text-align: center;
    color: #fff;
    border-radius: 12px;
    margin-bottom: 50px;
    box-shadow: 0 10px 30px rgba(0, 115, 170, 0.2);
}

.hero-title {
    font-size: 42px;
    font-weight: 800;
    margin: 0 0 15px 0;
}

.hero-subtitle {
    font-size: 18px;
    opacity: 0.9;
    margin: 0 0 40px 0;
}

.hero-search-form {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    padding: 10px;
    border-radius: 12px;
    display: flex;
    gap: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.hero-search-input {
    flex: 2;
    border: none;
    padding: 15px 20px;
    outline: none;
    background: transparent;
    font-family: 'Poppins', sans-serif; /* Default to English font */
}

.hero-search-select {
    flex: 1;
    border: none;
    border-inline-start: 1px solid var(--border-light);
    padding: 15px 20px;
    outline: none;
    background: transparent;
    appearance: auto;
    font-family: 'Poppins', sans-serif; /* Default to English font */
}

.hero-search-btn {
    background: var(--accent-color);
    color: var(--accent-text);
    border: none;
    padding: 15px 35px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif; /* Default to English font */
}

[dir="rtl"] .hero-search-input,
[dir="rtl"] .hero-search-select,
[dir="rtl"] .hero-search-btn {
    font-family: 'Zain', sans-serif;
}

.hero-search-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

/* Section Headers */
.home-section-header {
    text-align: center;
    margin-bottom: 40px;
}

.home-section-title {
    font-size: 32px;
    color: var(--primary-color);
    margin: 0 0 10px 0;
}

.home-section-subtitle {
    font-size: 16px;
    color: var(--text-muted);
    margin: 0;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 60px;
}

.category-card {
    background: var(--bg-container);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    border-color: var(--primary-color);
}

.category-icon {
    width: 60px;
    height: 60px;
    background: #f0f7fb;
    color: var(--primary-color);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.category-card:hover .category-icon {
    background: var(--primary-color);
    color: #fff;
}

.category-name {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 5px 0;
    color: var(--text-main);
}

/* Call to Action Banner */
.employer-cta {
    background: #f8f9fa;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 50px 30px;
    text-align: center;
    margin: 60px 0;
}

/* Mobile Overrides for Home */
@media (max-width: 768px) {
    .hero-search-form { flex-direction: column; background: transparent; box-shadow: none; padding: 0; }
    .hero-search-input, .hero-search-select { background: #fff; border-radius: 8px; border: none; }
    .hero-title { font-size: 32px; }
    .hero-section { padding: 40px 15px; margin-bottom: 30px; }
    .home-section-title { font-size: 24px; }
}

/* Horizontal Company Slider (Slicing Card) */
.company-slider-container {
    margin-bottom: 40px;
    position: relative;
}

.company-slider {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 15px; /* Room for shadow */
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Hide scrollbar Firefox */
    -ms-overflow-style: none; /* Hide scrollbar IE/Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.company-slider::-webkit-scrollbar {
    display: none;
}

.company-slide-card {
    flex: 0 0 160px; /* Fixed width for each card */
    scroll-snap-align: start;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.company-slide-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    border-color: var(--primary-color);
}

.company-slide-logo {
    width: 65px;
    height: 65px;
    border-radius: 8px;
    object-fit: contain;
    margin-bottom: 12px;
    padding: 2px;
    border: 1px solid var(--border-light);
}

.company-slide-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 5px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.company-slide-count {
    font-size: 12px;
    color: var(--accent-color);
    font-weight: 600;
    background: rgba(245, 205, 96, 0.15);
    padding: 3px 10px;
    border-radius: 20px;
}

/* =========================================================
   23. Custom File Upload Dropzone (candidate_profile.php)
   ========================================================= */
.cv-upload-wrapper {
    margin-bottom: 20px;
}

.cv-upload-zone {
    position: relative;
    width: 100%;
    height: 160px;
    border: 2px dashed var(--border-light);
    border-radius: 8px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.cv-upload-zone:hover, 
.cv-upload-zone.dragover {
    border-color: var(--primary-color);
    background: #f0f7fb;
}

/* This completely hides the ugly default button while keeping it clickable */
.cv-upload-zone input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.cv-upload-icon {
    font-size: 36px;
    color: var(--primary-color);
    margin-bottom: 12px;
    transition: transform 0.3s ease;
}

.cv-upload-zone:hover .cv-upload-icon {
    transform: translateY(-5px);
}

.cv-upload-text {
    font-size: 16px;
    color: var(--text-main);
    font-weight: 600;
    margin: 0;
}

.cv-file-name-display {
    margin-top: 10px;
    font-size: 14px;
    color: var(--accent-color);
    font-weight: bold;
    display: none; /* Hidden until a file is selected */
    z-index: 11;
    position: relative;
}

/* Hide the floating reCAPTCHA badge */
.grecaptcha-badge { 
    visibility: hidden; 
}

.password-strength-meter {
    height: 6px;
    background-color: #e0e0e0;
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-text {
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* 1. Hide it by default */
    #external-alert-modal {
        display: none; 
    }
    
    /* 2. When active, make it flex and fade in the dark background */
    #external-alert-modal.is-active {
        display: flex;
        animation: fadeInBg 0.2s ease-out forwards;
    }
    
    /* 3. When active, make the inner box pop in with a smooth bounce */
    #external-alert-modal.is-active .modal-content-box {
        animation: popInBounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    }

    /* --- The Animation Keyframes --- */
    @keyframes fadeInBg {
        from { background: rgba(0,0,0,0); }
        to { background: rgba(0,0,0,0.5); }
    }
    
    @keyframes popInBounce {
        from { opacity: 0; transform: scale(0.85) translateY(30px); }
        to { opacity: 1; transform: scale(1) translateY(0); }
    }
	
/* Responsive Stats */
    .hero-stats-wrapper { display: flex; justify-content: center; gap: 40px; margin-top: 40px; flex-wrap: wrap; width: 100%; }
    .hero-stat-item { text-align: center; min-width: 120px; flex: 1 1 0; }
    .hero-stat-num { font-size: 24px !important; font-weight: 800; color: var(--accent-color); margin-bottom: 5px; line-height: 1.1; }
    .hero-stat-text { font-size: 15px; opacity: 0.9; color: #fff; font-weight: 600; }

    /* Responsive Tabs */
    .home-tabs { display: flex; gap: 15px; border-bottom: 2px solid var(--border-light); margin-bottom: 25px; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: 5px; }
    .home-tabs::-webkit-scrollbar { height: 4px; }
    .home-tabs::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
    .home-tab-btn { background: none; border: none; padding: 10px 15px; font-size: 14px; font-weight: 600; color: var(--text-muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all 0.3s; font-family: inherit; }
    .home-tab-btn:hover { color: var(--primary-color); }
    .home-tab-btn.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }
	.hero-stat-num span.stat-counter { font-size: inherit !important; }

    /* Mobile specific adjustments */
    @media (max-width: 768px) {
        .hero-stats-wrapper { gap: 0px; margin-top: 30px; }
        .hero-stat-num { font-size: 24px !important; }
        .hero-stat-text { font-size: 13px; }
        .home-tab-btn { font-size: 12px; padding: 8px 12px; }
		.home-tabs {gap:10px; overflow-x: hidden;}
    }
	
.social-btn-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 25px;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border-light, #e0e0e0);
    border-radius: 8px;
    background: #ffffff;
    color: #333333;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-social:hover {
    background: #f8f9fa;
    border-color: var(--primary-color, #0073aa);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
}

.btn-social i {
    font-size: 18px;
}

.social-auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin-bottom: 25px;
    color: var(--text-muted, #888);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.social-auth-divider::before,
.social-auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-light, #e0e0e0);
}

.social-auth-divider:not(:empty)::before {
    margin-inline-end: 15px; /* Use inline-end for RTL support! */
}

.social-auth-divider:not(:empty)::after {
    margin-inline-start: 15px; /* Use inline-start for RTL support! */
}