
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --font-en: 'Outfit', sans-serif;
  --font-ar: 'Cairo', sans-serif;
  
  /* Modern HSL Color Palette */
  --primary: hsl(230, 85%, 55%); /* Vibrant Blue */
  --primary-hover: hsl(230, 85%, 45%);
  --primary-light: hsl(230, 100%, 96%);
  --primary-glow: hsla(230, 85%, 55%, 0.4);
  
  --secondary: hsl(240, 15%, 12%); /* Dark Slate */
  --secondary-light: hsl(240, 10%, 20%);
  
  --accent: hsl(40, 95%, 55%); /* Golden Amber */
  --accent-light: hsl(40, 100%, 96%);
  
  --bg-site: hsl(220, 30%, 98%);
  --bg-card: hsla(0, 0%, 100%, 0.85); /* Glassmorphism base */
  --border: hsla(220, 20%, 85%, 0.5);
  
  --text-dark: hsl(240, 20%, 10%);
  --text-main: hsl(220, 15%, 40%);
  --text-muted: hsl(220, 15%, 55%);
  --text-white: hsl(0, 0%, 100%);
  
  /* Elevating Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 16px -4px rgba(0, 0, 0, 0.06), 0 4px 8px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 30px -10px rgba(0, 0, 0, 0.1), 0 10px 15px -5px rgba(0, 0, 0, 0.05);
  --shadow-glow-active: 0 0 25px var(--primary-glow);
  
  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-blur: blur(16px);
  
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 36px;
  
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-slow: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
  font-family: var(--font-en);
  background: var(--bg-site);
  background-image: 
    radial-gradient(circle at 15% 50%, hsla(230, 85%, 55%, 0.05), transparent 25%),
    radial-gradient(circle at 85% 30%, hsla(40, 95%, 55%, 0.05), transparent 25%);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.rtl { font-family: var(--font-ar); direction: rtl; }
a { color: inherit; text-decoration: none; transition: var(--transition); }
button, input, select, textarea { font-family: inherit; font-size: 1rem; transition: var(--transition); outline: none; }
button { cursor: pointer; }

/* Focus */
*:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Layout */
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; }
main { flex: 1; }

/* Header - Glassmorphism */
.site-header {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: 80px;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.header-inner { display: flex; justify-content: space-between; align-items: center; width: 100%; }

.logo {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.03em;
}

.logo i { color: var(--primary); filter: drop-shadow(0 2px 8px var(--primary-glow)); }
.logo span { color: var(--primary); }

.nav-links { display: flex; align-items: center; gap: 32px; list-style: none; }
.nav-link {
  font-weight: 600;
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  position: relative;
}
.nav-link:hover, .nav-link.active { color: var(--primary); }
.nav-link.active::after {
  content: ''; position: absolute; bottom: 0; left: 12px; right: 12px; height: 3px;
  background: var(--primary); border-radius: 50px;
}

.lang-switch {
  background: var(--primary-light);
  color: var(--primary);
  padding: 10px 20px;
  border-radius: var(--radius-xl);
  font-weight: 700;
  border: 1px solid transparent;
  display: flex; align-items: center; gap: 8px;
}
.lang-switch:hover {
  background: var(--primary);
  color: var(--text-white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 4px 15px var(--primary-glow);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--secondary) 0%, hsl(230, 30%, 15%) 100%);
  color: var(--text-white);
  padding: 120px 0 140px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: 
    radial-gradient(circle at 80% 20%, hsla(230, 85%, 55%, 0.25), transparent 40%),
    radial-gradient(circle at 20% 80%, hsla(40, 95%, 55%, 0.15), transparent 40%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -50px; left: -5%; right: -5%;
  height: 100px;
  background: var(--bg-site);
  transform: rotate(-2deg);
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
  line-height: 1.1;
  position: relative;
  z-index: 10;
  background: linear-gradient(to right, #ffffff, var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: hsla(0,0%,100%,0.8);
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
  font-weight: 400;
}

/* Search Box */
.search-container {
  margin-top: -60px;
  position: relative;
  z-index: 20;
  margin-bottom: 60px;
}

.search-box {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: var(--radius-xl);
  display: flex;
  gap: 12px;
  box-shadow: var(--shadow-lg);
}

.search-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: hsla(220, 20%, 96%, 0.5);
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
}
.search-field:focus-within { border-color: var(--primary); background: #fff; }
.search-field i { color: var(--primary); font-size: 1.2rem; }
.search-field input { border: none; background: transparent; width: 100%; padding: 16px 0; font-size: 1.1rem; color: var(--text-dark); }
.search-field input::placeholder { color: var(--text-muted); }

.btn-search {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0 40px;
  border-radius: var(--radius-lg);
  font-weight: 700;
  font-size: 1.1rem;
}
.btn-search:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 8px 20px var(--primary-glow); }

/* Categories Grid */
.categories-sec { margin-bottom: 80px; }
.section-title {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px;
}
.section-title span {
  font-size: 2rem; font-weight: 800; color: var(--text-dark); letter-spacing: -0.02em;
}

.categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 30px 24px;
  border-radius: var(--radius-lg);
  text-align: center;
  transition: var(--transition);
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  box-shadow: var(--shadow-sm);
}
.category-card:hover, .category-card.active {
  transform: translateY(-6px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md), 0 10px 20px var(--primary-glow);
}
.category-icon { font-size: 3rem; transition: var(--transition); }
.category-card:hover .category-icon { transform: scale(1.15) rotate(5deg); }
.category-name { font-weight: 700; color: var(--text-dark); font-size: 1.1rem; }
.category-card.active .category-name { color: var(--primary); }

/* Main Layout */
.main-layout { display: grid; grid-template-columns: 280px 1fr; gap: 40px; margin-bottom: 100px; align-items: start; }

/* Sidebar Filters */
.filters-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: sticky;
  top: 100px;
  box-shadow: var(--shadow-sm);
}

.filter-title { font-weight: 800; color: var(--text-dark); font-size: 1.25rem; margin-bottom: 24px; }
.filter-group { margin-bottom: 24px; }
.filter-group .filter-title { font-size: 1rem; margin-bottom: 16px; color: var(--text-main); }
.filter-options { display: flex; flex-direction: column; gap: 12px; }

.checkbox-label {
  display: flex; align-items: center; gap: 12px; cursor: pointer; color: var(--text-main); font-weight: 500;
}
.checkbox-label input { accent-color: var(--primary); width: 18px; height: 18px; }
.checkbox-label:hover { color: var(--primary); }

/* Job Cards */
.jobs-list { display: flex; flex-direction: column; gap: 20px; }

.job-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  gap: 24px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.job-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md), 0 10px 25px rgba(0,0,0,0.03);
}

.job-card.featured {
  border-color: var(--accent);
  background: linear-gradient(to right, var(--bg-card), hsla(40, 100%, 98%, 0.8));
}
.job-card.featured::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent);
}

.company-logo-wrapper {
  width: 70px; height: 70px;
  background: var(--bg-site);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; border: 1px solid var(--border); overflow: hidden;
  font-size: 1.8rem;
}
.company-logo-wrapper img { width: 100%; height: 100%; object-fit: contain; }

.job-details-brief { flex: 1; min-width: 0; }

.job-title-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.job-card-title { font-size: 1.3rem; font-weight: 800; color: var(--text-dark); letter-spacing: -0.01em; }
.job-card-title:hover { color: var(--primary); }

.company-name { color: var(--text-muted); font-size: 1rem; margin-bottom: 16px; font-weight: 500; }

.job-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.tag { padding: 6px 12px; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.tag-feat { background: var(--accent-light); color: var(--accent); border: 1px solid hsla(40, 95%, 55%, 0.2); }
.tag-type { background: var(--primary-light); color: var(--primary); }
.tag-loc { background: hsla(160, 60%, 95%, 1); color: hsl(160, 60%, 30%); }
.tag-lang { background: hsla(280, 60%, 95%, 1); color: hsl(280, 60%, 40%); }

.job-meta-row { display: flex; justify-content: space-between; align-items: center; margin-top: auto; border-top: 1px solid var(--border); padding-top: 16px; }
.job-meta-items { display: flex; gap: 20px; color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }
.job-meta-items span { display: flex; align-items: center; gap: 6px; }

.btn-apply-now {
  background: var(--bg-site); color: var(--text-dark); border: 1px solid var(--border);
  padding: 8px 24px; border-radius: var(--radius-xl); font-weight: 700; font-size: 0.95rem;
}
.btn-apply-now:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.btn-fav { background: transparent; border: none; color: var(--text-muted); font-size: 1.3rem; cursor: pointer; transition: var(--transition); }
.btn-fav:hover { color: #f43f5e; transform: scale(1.1); }
.btn-fav.active { color: #f43f5e; }

/* Job Details Page */
.job-detail-layout { display: grid; grid-template-columns: 1fr 340px; gap: 40px; margin-bottom: 80px; align-items: start; }
.detail-main { background: var(--bg-card); border-radius: var(--radius-xl); padding: 40px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.detail-title { font-size: 2.25rem; font-weight: 900; color: var(--text-dark); margin-bottom: 20px; line-height: 1.2; letter-spacing: -0.02em; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 24px; margin-bottom: 40px; color: var(--text-muted); font-size: 1rem; font-weight: 500; }
.detail-meta span { display: flex; align-items: center; gap: 8px; }
.detail-meta i { color: var(--primary); }

.detail-body { font-size: 1.1rem; line-height: 1.8; color: var(--text-dark); }
.detail-body h3 { font-size: 1.4rem; font-weight: 800; color: var(--text-dark); margin-top: 30px; margin-bottom: 16px; }
.detail-body p { margin-bottom: 16px; }
.detail-body ul { margin-left: 24px; margin-bottom: 24px; }
.rtl .detail-body ul { margin-left: 0; margin-right: 24px; }
.detail-body li { margin-bottom: 8px; }

.detail-sidebar { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 100px; }
.sidebar-box { background: var(--bg-card); border-radius: var(--radius-xl); padding: 32px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }

.sidebar-company-logo { width: 100px; height: 100px; margin: 0 auto 20px; border-radius: var(--radius-lg); background: var(--bg-site); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; font-weight: 800; color: var(--primary); border: 1px solid var(--border); overflow: hidden; }
.sidebar-company-logo img { width: 100%; height: 100%; object-fit: contain; }
.sidebar-company-name { font-size: 1.4rem; font-weight: 800; color: var(--text-dark); margin-bottom: 12px; }
.sidebar-company-desc { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 20px; line-height: 1.6; }

.btn-sidebar-apply { display: block; width: 100%; text-align: center; background: var(--primary); color: #fff; padding: 14px; border-radius: var(--radius-lg); font-weight: 700; font-size: 1.1rem; margin-top: 10px; transition: var(--transition); border: none; }
.btn-sidebar-apply:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 10px 20px var(--primary-glow); }

.share-widget-title { font-weight: 700; margin-bottom: 16px; color: var(--text-dark); }
.share-buttons { display: flex; gap: 12px; }
.btn-share { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.2rem; transition: var(--transition); }
.btn-share:hover { transform: translateY(-3px) scale(1.05); }
.share-wa { background: #25D366; box-shadow: 0 4px 10px rgba(37,211,102,0.3); }
.share-tg { background: #0088cc; box-shadow: 0 4px 10px rgba(0,136,204,0.3); }
.share-tw { background: #1DA1F2; box-shadow: 0 4px 10px rgba(29,161,242,0.3); }
.share-link { background: var(--text-muted); box-shadow: 0 4px 10px rgba(0,0,0,0.1); cursor: pointer; }

/* Footer */
.site-footer { background: var(--secondary); color: hsla(0,0%,100%,0.7); padding: 80px 0 30px; margin-top: auto; }
.footer-inner { display: flex; justify-content: space-between; gap: 60px; flex-wrap: wrap; margin-bottom: 60px; }
.footer-info { max-width: 400px; }
.footer-info .logo { color: #fff; margin-bottom: 20px; }
.footer-info .logo i, .footer-info .logo span { color: var(--primary-light); }
.footer-links-group { display: flex; gap: 80px; flex-wrap: wrap; }
.footer-links { list-style: none; }
.footer-title { font-weight: 700; color: #fff; font-size: 1.1rem; margin-bottom: 24px; }
.footer-links li { margin-bottom: 12px; }
.footer-links a:hover { color: var(--primary-light); padding-left: 5px; }
.rtl .footer-links a:hover { padding-left: 0; padding-right: 5px; }
.footer-bottom { border-top: 1px solid hsla(0,0%,100%,0.1); padding-top: 30px; text-align: center; font-size: 0.9rem; }

/* Responsive */
@media (max-width: 992px) {
  .main-layout { grid-template-columns: 1fr; }
  .filters-sidebar { position: static; margin-bottom: 30px; }
  .job-detail-layout { grid-template-columns: 1fr; }
  .detail-sidebar { position: static; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero-title { font-size: 2.2rem; }
  .search-box { flex-direction: column; }
  .btn-search { width: 100%; padding: 16px; }
  .job-card { flex-direction: column; align-items: flex-start; gap: 16px; }
  .company-logo-wrapper { width: 60px; height: 60px; }
  .job-meta-row { flex-direction: column; align-items: flex-start; gap: 16px; width: 100%; }
  .btn-apply-now { width: 100%; text-align: center; }
}
