/* Custom Design System - Click Jobly (وظيفتك بنقرة) */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: rgba(37, 99, 235, 0.1);
    --secondary: #10b981;
    --secondary-hover: #059669;
    --accent: #f59e0b;
    --background: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    --gradient-glow: 0 10px 25px -5px rgba(37, 99, 235, 0.4);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --radius: 16px;
    --radius-sm: 10px;
}

/* Base resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Outfit', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
html {
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header / Navigation */
header {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
    list-style: none;
}

.nav-link {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 15px;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: var(--gradient-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -5px rgba(37, 99, 235, 0.5);
}

.btn-secondary {
    background-color: var(--primary-light);
    color: var(--primary);
}

.btn-secondary:hover {
    background-color: rgba(37, 99, 235, 0.15);
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

/* Hero Section */
.hero {
    background: var(--gradient);
    color: white;
    padding: 100px 0 120px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: var(--background);
    clip-path: ellipse(60% 60px at 50% 60px);
}

.hero h1 {
    font-size: 42px;
    font-weight: 900;
    margin-bottom: 16px;
    line-height: 1.3;
}

.hero p {
    font-size: 18px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 40px;
}

/* Search Box Component */
.search-box {
    background: white;
    padding: 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 900px;
    margin: -60px auto 0;
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 12px;
    align-items: center;
}

.input-field {
    position: relative;
}

.input-field input, .input-field select {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    color: var(--text-main);
    background-color: var(--background);
    outline: none;
    appearance: none;
    transition: all 0.2s ease;
}

.input-field select {
    padding-left: 16px;
    padding-right: 40px;
}

.input-field input:focus, .input-field select:focus {
    border-color: var(--primary);
    background-color: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.input-field i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
}

/* Jobs Listings grid */
.jobs-section {
    padding: 60px 0;
}

.section-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.country-group {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    border: 1px solid var(--border);
}

.country-header {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.job-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px dashed var(--border);
    transition: all 0.2s ease;
}

.job-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.job-card:first-child {
    padding-top: 0;
}

.job-info h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.job-meta {
    display: flex;
    gap: 16px;
    list-style: none;
    font-size: 13px;
    color: var(--text-muted);
}

.job-meta li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.job-action {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ago-badge {
    background-color: var(--primary-light);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}
.ago-badge:empty {
    display: none;
}

/* Detail page style */
.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    padding: 40px 0;
}

.detail-card {
    background: white;
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.detail-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.detail-title {
    font-size: 26px;
    font-weight: 900;
    margin-bottom: 12px;
}

.detail-body {
    font-size: 16px;
    color: #334155;
    line-height: 1.8;
}

.detail-body p {
    margin-bottom: 16px;
}

.detail-body h2 {
    font-size: 20px;
    font-weight: 800;
    margin: 24px 0 16px;
}

.detail-body ul {
    margin-bottom: 20px;
    padding-left: 20px;
}

.detail-body li {
    margin-bottom: 8px;
}

.sidebar-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    position: sticky;
    top: 100px;
}

/* Dashboard structures */
.dashboard-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
    padding: 40px 0;
}

.dashboard-sidebar {
    background: white;
    border-radius: var(--radius);
    padding: 24px 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    height: fit-content;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 8px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    color: var(--text-muted);
    font-size: 15px;
}

.menu-link:hover, .menu-link.active {
    background-color: var(--primary-light);
    color: var(--primary);
}

.dashboard-content {
    background: white;
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    background-color: var(--background);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    background-color: white;
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Alert styles */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.12);
    color: var(--secondary-hover);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Footer style */
footer {
    background-color: #0f172a;
    color: #94a3b8;
    padding: 60px 0 30px;
    margin-top: 100px;
    font-size: 14px;
    border-top: 1px solid #1e293b;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: white;
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #1e293b;
}

.mobile-menu-toggle {
    display: none;
}

/* Responsive queries */
@media(max-width: 991px) {
    .search-box {
        grid-template-columns: 1fr;
        margin-top: -30px;
    }
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media(max-width: 768px) {
    /* Navbar Mobile view */
    .navbar {
        height: 70px;
        position: relative;
    }
    
    .mobile-menu-toggle {
        display: block !important;
        background: none;
        border: none;
        color: var(--text-main);
        font-size: 22px;
        cursor: pointer;
        padding: 8px;
        transition: color 0.2s;
    }
    
    .mobile-menu-toggle:hover {
        color: var(--primary);
    }
    
    .nav-links {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 70px;
        bottom: 0;
        width: 280px;
        height: calc(100vh - 70px) !important;
        background: #ffffff !important;
        background-color: #ffffff !important;
        border: none;
        border-radius: 0;
        box-shadow: 0 4px 24px rgba(0,0,0,0.18) !important;
        padding: 40px 20px 20px;
        gap: 12px;
        align-items: stretch;
        z-index: 99999 !important;
        transition: transform 0.3s ease;
        opacity: 0;
        visibility: hidden;
        overflow-y: auto !important;
    }
    
    [dir="rtl"] .nav-links {
        right: 0;
        transform: translateX(100%);
        border-left: 1px solid var(--border);
    }

    [dir="ltr"] .nav-links {
        left: 0;
        transform: translateX(-100%);
        border-right: 1px solid var(--border);
    }
    
    .nav-links.active {
        transform: translateX(0) !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .nav-links li {
        width: 100%;
        text-align: center;
    }
    
    .nav-links .nav-link {
        display: block;
        padding: 8px 0;
        border-bottom: 1px solid var(--border);
    }
    
    .nav-links li:last-child .nav-link,
    .nav-links li:has(.btn) .nav-link {
        border-bottom: none;
    }
    
    .nav-links .btn {
        width: 100%;
        justify-content: center;
        margin-top: 4px;
    }
    
    /* Hero section */
    .hero {
        padding: 60px 0 80px;
    }
    .hero h1 {
        font-size: 28px;
    }
    .hero p {
        font-size: 14px;
        margin-bottom: 24px;
    }
    
    /* Search box spacing */
    .search-box {
        margin-top: -40px;
        padding: 16px;
        gap: 8px;
    }
    
    /* Job list adjustments */
    .jobs-section {
        padding: 40px 0;
    }
    
    .country-group {
        padding: 16px;
    }
    
    .job-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px 0;
    }
    
    .job-action {
        width: 100%;
        justify-content: space-between;
        margin-top: 4px;
    }
    
    .job-meta {
        flex-wrap: wrap;
        gap: 8px 12px;
    }
    
    /* Detail page adjustments */
    .detail-card {
        padding: 20px;
    }
    
    .detail-title {
        font-size: 22px;
    }
    
    /* Dashboard content adjustments */
    .dashboard-content {
        padding: 20px 16px;
    }
    
    .dashboard-grid {
        gap: 20px;
        padding: 20px 0;
    }
    
    .sidebar-card {
        position: static;
    }

    /* Dashboard Sidebar Mobile tab-bar view */
    .dashboard-sidebar {
        padding: 12px !important;
        margin-bottom: 10px !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        background: var(--card-bg);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
    }
    
    .dashboard-sidebar > div {
        display: none !important; /* Hide user avatar, name, and version badge on mobile */
    }
    
    .sidebar-menu {
        display: flex !important;
        flex-direction: row !important;
        gap: 8px !important;
        padding: 4px 0 !important;
        margin: 0 !important;
        list-style: none !important;
    }
    
    .sidebar-menu li {
        margin-bottom: 0 !important;
        flex-shrink: 0 !important;
    }
    
    .menu-link {
        padding: 8px 14px !important;
        font-size: 13px !important;
        white-space: nowrap !important;
        border-radius: var(--radius-sm);
        display: inline-flex !important;
        align-items: center;
        gap: 6px !important;
    }
}

/* Responsive Jobs List & Filters Layout */
.jobs-layout-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

.sidebar-filter-form {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    position: sticky;
    top: 100px;
}

@media(max-width: 991px) {
    .jobs-layout-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sidebar-filter-form {
        position: static !important;
        margin-bottom: 20px;
    }
}

/* Responsive Form Grids */
.grid-2-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.grid-2-cols-asym {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}
.grid-3-cols {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}
.grid-4-cols {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

@media(max-width: 768px) {
    .grid-2-cols, .grid-2-cols-asym, .grid-3-cols, .grid-4-cols {
        grid-template-columns: 1fr !important;
    }
}
