/* ==========================================================================
   MARKETPLACE - LIGHT ENTERPRISE FLAT UI (RACKSPACE INSPIRED)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Very light clean background */
  --bg-deep: #f8fafc;
  /* Pure white cards */
  --bg-card: #ffffff;
  /* Light borders for flat look */
  --glass-border: #e2e8f0;
  /* Strong primary brand color (Rackspace/Enterprise Blue) */
  --brand-primary: #0284c7;
  --brand-hover: #0369a1;
  /* High contrast dark text */
  --text-main: #0f172a;
  /* Readable muted text */
  --text-muted: #475569;
  
  --font-arabic: 'Tajawal', sans-serif;
  --font-en: 'Inter', sans-serif;
  
  /* Standard flat drop shadow for depth on hover */
  --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: var(--font-arabic);
  background-color: var(--bg-deep);
  color: var(--text-main);
  direction: rtl; /* Full Arabic */
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Crisp Clean Background with subtle top glow */
body::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 800px;
  background: radial-gradient(circle at 50% -20%, rgba(2, 132, 199, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

a { text-decoration: none; color: inherit; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ==========================================
   HEADER (Top Bar)
   ========================================== */
header {
  background: #ffffff;
  border-bottom: 1px solid var(--glass-border);
  position: relative;
  z-index: 1000;
}
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
}
.brand-logo {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.brand-logo .ar {
  font-family: var(--font-arabic);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--brand-primary);
}
.nav-actions { display: flex; gap: 15px; align-items: center; }
.btn-explore {
  border: 1px solid var(--brand-primary);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: var(--font-arabic);
  font-weight: 700;
  background: var(--brand-primary);
  transition: all 0.3s ease;
}
.btn-explore:hover { 
  background: var(--brand-hover); 
  border-color: var(--brand-hover); 
  transform: translateY(-2px); 
  box-shadow: 0 6px 12px -2px rgba(2, 132, 199, 0.3); 
}
.top-nav-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 700;
}
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 8px;
  background: #f1f5f9;
  display: flex; justify-content: center; align-items: center;
  color: var(--text-muted);
  font-size: 1rem;
  border: 1px solid var(--glass-border);
  transition: all 0.3s ease;
}
.icon-btn:hover { 
  background: #ffffff; 
  color: var(--brand-primary); 
  border-color: var(--brand-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

/* ==========================================
   SECOND NAVIGATION BAR
   ========================================== */
.sub-nav-wrapper {
  background: #ffffff;
  border-bottom: 1px solid var(--glass-border);
}
.sub-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}
.nav-menu {
  display: flex;
  gap: 30px;
  list-style: none;
  height: 100%;
}
.nav-menu li { height: 100%; display: flex; align-items: center;}
.nav-menu a {
  font-family: var(--font-arabic);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  height: 100%;
  display: flex;
  align-items: center;
  position: relative;
  transition: color 0.3s ease;
}
.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--brand-primary);
  border-radius: 3px 3px 0 0;
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: right;
}
.nav-menu a:hover { color: var(--brand-primary); }
.nav-menu a:hover::after { transform: scaleX(1); }

.nav-menu a.active {
  color: var(--brand-primary);
}
.nav-menu a.active::after {
  transform: scaleX(1);
}

.search-box {
  position: relative;
  width: 380px;
}
.search-box input {
  width: 100%;
  background: #f8fafc;
  border: 1px solid var(--glass-border);
  padding: 12px 45px 12px 16px;
  border-radius: 8px;
  color: var(--text-main);
  font-family: var(--font-arabic);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.search-box input:focus { 
  border-color: var(--brand-primary); 
  background: #fff;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}
.search-box input::placeholder { color: #94a3b8; }
.search-box i {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1rem;
}

/* ==========================================
   HERO / PAGE TITLE
   ========================================== */
.page-title {
  text-align: center;
  font-size: 3rem;
  font-family: var(--font-arabic);
  font-weight: 900;
  margin: 60px 0 50px;
  color: var(--text-main);
  letter-spacing: -1px;
}

/* ==========================================
   MARKETPLACE HERO (SWIPER AREA)
   ========================================== */
.swiper-container {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding: 40px 0 60px;
  overflow: hidden;
}
.swiper-wrapper {
  transition-timing-function: linear;
}
.swiper-container:hover .swiper-wrapper {
  transition-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
}

.swiper-slide {
  display: flex;
  justify-content: center;
  pointer-events: auto !important;
  z-index: 1;
  transition: z-index 0.4s ease;
}

.swiper-slide-active { z-index: 10; }
.swiper-slide:hover { z-index: 100; }

.v-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-top: 4px solid var(--brand-primary);

  border-radius: 16px;
  padding: 40px 20px 30px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 320px;
  box-sizing: border-box;
  margin: 0 auto;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.4s ease, box-shadow 0.4s ease;
  transform: scale(0.9);
  opacity: 0.8;
  box-shadow: var(--shadow-sm);
}

.swiper-container:not(:has(.swiper-slide:hover)) .swiper-slide-active .v-card,
.swiper-slide:hover .v-card {
  transform: scale(1.12) translateY(-10px);
  opacity: 1;
  border-color: var(--brand-primary);
  box-shadow: 0 25px 35px -5px rgba(2, 132, 199, 0.15), 0 10px 15px -5px rgba(2, 132, 199, 0.1); /* Subtle brand shadow */
  z-index: 10;
}

.img-ring {
  position: relative;
  width: 130px; height: 130px;
  border-radius: 50%;
  margin-bottom: 20px;
  padding: 5px;
  background: transparent;
  border: 2px solid #e2e8f0;
  transition: all 0.4s ease;
}

.swiper-container:not(:has(.swiper-slide:hover)) .swiper-slide-active .img-ring,
.swiper-slide:hover .img-ring {
  border-color: var(--brand-primary);
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(2, 132, 199, 0.2);
}

.img-ring img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #f1f5f9;
}

.t-name-ar { font-family: var(--font-arabic); font-size: 1.4rem; font-weight: 800; margin-bottom: 6px; color: var(--text-main); transition: all 0.4s ease; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;}
.t-subject-ar { font-size: 0.95rem; font-family: var(--font-arabic); color: var(--brand-primary); font-weight: 700; margin-bottom: 12px; transition: all 0.4s ease; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;}

.swiper-container:not(:has(.swiper-slide:hover)) .swiper-slide-active .t-name-ar,
.swiper-slide:hover .t-name-ar { font-size: 1.6rem; color: var(--brand-primary);}

.swiper-container:not(:has(.swiper-slide:hover)) .swiper-slide-active .t-subject-ar,
.swiper-slide:hover .t-subject-ar { font-size: 1.05rem; }

.t-rating {
  font-size: 0.95rem;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 20px;
  font-weight: 600;
}
.t-rating span.star { color: #f59e0b; font-size: 1.1rem;}
.t-rating span.divider { color: #cbd5e1; }

.t-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 25px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn-cyan {
  width: 100%;
  background: #f1f5f9;
  color: var(--brand-primary);
  font-weight: 700;
  font-size: 1.05rem;
  font-family: var(--font-arabic);
  border: 1px solid var(--glass-border);
  padding: 14px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: auto;
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.swiper-container:not(.has-hovered-slide) .swiper-slide-active .btn-cyan,
.v-card:hover .btn-cyan {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
  box-shadow: 0 8px 15px -5px rgba(2, 132, 199, 0.4);
  transform: translateY(-2px);
}

.swiper-container:not(.has-hovered-slide) .swiper-slide-active .btn-cyan:hover,
.v-card:hover .btn-cyan:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  box-shadow: 0 10px 20px -5px rgba(2, 132, 199, 0.5);
}

/* ==========================================
   BOTTOM 2 CARDS (HORIZONTAL)
   ========================================== */
.bottom-cards {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 50px;
}

.h-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-top: 4px solid var(--brand-primary);
  border-radius: 16px;
  padding: 30px;
  display: flex;
  gap: 25px;
  align-items: center;
  width: 100%;
  max-width: 500px;
  box-sizing: border-box;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.h-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.h-card .img-ring {
  width: 120px; height: 120px; margin-bottom: 0; flex-shrink: 0;
}

.h-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start; 
}

.h-info .t-name-ar { font-size: 1.6rem; margin-bottom: 4px; color: var(--text-main);}
.h-info .t-subject-ar { font-size: 1.05rem; margin-bottom: 12px; color: var(--brand-primary); font-weight: 700; font-family: var(--font-arabic);}
.h-info .t-rating { justify-content: flex-start; margin-bottom: 15px; }
.h-info .t-desc { font-size: 0.95rem; -webkit-line-clamp: 2; margin-bottom: 25px;}

.h-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 15px;
}
.social-icons { display: flex; gap: 10px; }
.s-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--glass-border);
  display: flex; justify-content: center; align-items: center;
  color: var(--text-muted); cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}
.s-icon:hover, .s-icon.active { background: var(--brand-primary); color: #ffffff; border-color: var(--brand-primary); }

.h-card .btn-cyan { width: auto; flex: 1; }

/* ==========================================
   PAGINATION
   ========================================== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 80px;
}
.page-item {
  width: 40px; height: 40px;
  display: flex; justify-content: center; align-items: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.page-item.active {
  background: var(--brand-primary);
  color: #fff;
}
.page-item:hover:not(.active) { background: #f1f5f9; border-color: var(--glass-border); color: var(--text-main);}

/* ==========================================
   EXPANSION SECTIONS (Enterprise RTL)
   ========================================== */
.enterprise-sections {
  direction: rtl;
  font-family: var(--font-arabic);
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  font-family: var(--font-arabic);
  font-weight: 900;
  margin: 100px 0 50px;
  color: var(--text-main);
  letter-spacing: -1px;
}

/* 1. FILTERS (Flat Light Premium) */
.section-filters {
  margin: 30px auto 80px;
  max-width: 1000px;
}
.filters-container {
  display: flex;
  gap: 15px;
  background: #ffffff;
  border: 1px solid var(--glass-border);
  padding: 15px;
  border-radius: 12px;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.filter-group {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  background: #f8fafc;
  border-radius: 8px;
  padding: 14px 20px;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}
.filter-group:hover { background: #f1f5f9; border-color: #cbd5e1; }
.filter-group i { color: var(--brand-primary); margin-left: 15px; font-size: 1.1rem; }
.filter-group select {
  background: transparent; border: none; color: var(--text-main);
  width: 100%; outline: none; font-family: var(--font-arabic); font-size: 1rem; cursor: pointer; appearance: none; font-weight: 600;
}
.btn-search-filter { 
  padding: 14px 30px; border-radius: 8px; font-weight: 700; width: auto; font-family: var(--font-arabic); font-size: 1.05rem;
  background: var(--text-main); color: #fff; border: none; cursor: pointer; transition: 0.2s ease;
}
.btn-search-filter:hover { background: #334155; }

/* 2. CATEGORIES (Bento Grid) */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 200px;
  gap: 20px;
  margin-bottom: 120px;
}
.bento-card {
  background: #ffffff;
  border: 1px solid var(--glass-border);
  border-top: 4px solid var(--brand-primary);
  border-radius: 20px;
  padding: 30px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.bento-large { grid-column: span 2; grid-row: span 2; }
.bento-wide { grid-column: span 2; }
.bento-card:hover { 
  border-color: #cbd5e1; 
  transform: translateY(-4px); 
  box-shadow: var(--shadow-hover);
}
.bento-icon {
  position: absolute; top: 30px; left: 30px; /* Switched to left for RTL */
  font-size: 2.5rem; color: #cbd5e1;
  transition: all 0.3s ease;
}
.bento-card:hover .bento-icon { color: var(--brand-primary); transform: scale(1.1); }
.bento-content h3 { font-size: 1.5rem; margin-bottom: 8px; font-weight: 800; color: var(--text-main);}
.bento-large .bento-content h3 { font-size: 2.2rem; }
.bento-content p { font-size: 1rem; color: var(--text-muted); line-height: 1.6; font-weight: 500;}

/* 3. HOW IT WORKS (Enterprise Timeline) */
.section-how { margin-bottom: 120px; }
.timeline-container {
  display: flex; flex-direction: column; gap: 50px; max-width: 800px; margin: 0 auto;
  position: relative;
}
.timeline-container::before {
  content: ''; position: absolute; top: 0; bottom: 0; right: 40px; width: 2px;
  background: #e2e8f0;
}
.timeline-step { display: flex; align-items: flex-start; gap: 30px; position: relative; z-index: 1;}
.step-number {
  width: 80px; height: 80px; flex-shrink: 0;
  background: #ffffff; border: 2px solid #e2e8f0; border-radius: 50%;
  display: flex; justify-content: center; align-items: center;
  font-size: 1.8rem; font-weight: 900; color: #94a3b8;
  font-family: var(--font-en);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}
.timeline-step:hover .step-number { color: var(--brand-primary); border-color: var(--brand-primary); background: #f0f9ff;}
.step-content { padding-top: 15px; }
.step-content h3 { font-size: 1.6rem; margin-bottom: 12px; color: var(--text-main); font-weight: 800;}
.step-content p { font-size: 1.1rem; color: var(--text-muted); line-height: 1.7; }

/* 4. TESTIMONIALS (Masonry Flat) */
.section-testimonials { margin-bottom: 120px; }
.masonry-testimonials {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 30px;
}
.testi-glass-card {
  background: #ffffff; border: 1px solid var(--glass-border);
  padding: 40px; border-radius: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.testi-glass-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover);}
.testi-glass-card.highlight {
  background: #f8fafc;
  border-color: #cbd5e1;
  grid-column: span 2;
}
.testi-stars { color: #f59e0b; font-size: 1.2rem; margin-bottom: 20px; letter-spacing: 2px;}
.testi-text { font-size: 1.15rem; line-height: 1.8; color: var(--text-main); margin-bottom: 30px; font-weight: 600;}
.testi-author { display: flex; flex-direction: column; border-right: 3px solid var(--brand-primary); padding-right: 15px;}
.author-name { font-size: 1.1rem; font-weight: 800; color: var(--text-main); margin-bottom: 4px;}
.author-title { font-size: 0.95rem; color: var(--text-muted); font-weight: 500;}

/* 5. CTA BANNER (Enterprise Grade) */
.section-cta { margin-bottom: 0; padding-bottom: 100px;}
.enterprise-cta-banner {
  background: var(--brand-primary);
  border-radius: 24px;
  padding: 80px 40px; text-align: center; position: relative;
  box-shadow: var(--shadow-hover);
  overflow: hidden;
}
.enterprise-cta-banner::before {
  content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 50%);
  pointer-events: none;
}
.cta-content { max-width: 700px; margin: 0 auto; position: relative; z-index: 1;}
.enterprise-cta-banner h2 { font-size: 2.8rem; margin-bottom: 20px; font-weight: 900; letter-spacing: -1px; color: #fff;}
.enterprise-cta-banner p { font-size: 1.2rem; color: #e0f2fe; line-height: 1.8; margin-bottom: 40px; font-weight: 500;}
.btn-large { 
  padding: 16px 45px; font-size: 1.15rem; border-radius: 12px; font-weight: 800;
  background: #ffffff; color: var(--brand-primary); border: none; cursor: pointer;
  transition: all 0.2s ease;
}
.btn-large:hover { background: #f1f5f9; transform: scale(1.05); }

/* 6. PREMIUM FOOTER (Enterprise Grid) */
.enterprise-footer {
  background: #0f172a; /* Deep slate footer for contrast */
  padding: 80px 0 0; font-family: var(--font-arabic);
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 60px; margin-bottom: 60px; }
.footer-brand-col .brand-logo .ar { color: #fff; }
.footer-desc { color: #94a3b8; font-size: 1.05rem; line-height: 1.8; margin: 25px 0; max-width: 400px;}
.social-links { display: flex; gap: 15px; }
.social-links a {
  width: 44px; height: 44px; border-radius: 8px; background: rgba(255,255,255,0.05);
  display: flex; justify-content: center; align-items: center; color: #fff;
  transition: all 0.3s ease;
}
.social-links a:hover { background: var(--brand-primary); transform: translateY(-3px); }
.footer-nav-col h4 { font-size: 1.2rem; margin-bottom: 30px; color: #fff; font-weight: 800;}
.footer-nav-col ul { list-style: none; }
.footer-nav-col ul li { margin-bottom: 18px; }
.footer-nav-col ul a { color: #94a3b8; transition: color 0.3s ease; font-size: 1rem; font-weight: 500;}
.footer-nav-col ul a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.05); padding: 30px 0; text-align: center; color: #64748b; font-size: 0.95rem;}

/* ==========================================
   RESPONSIVE DESIGN (Media Queries)
   ========================================== */
@media (max-width: 1024px) {
  /* Hero Section */
  .bottom-cards { flex-direction: column; align-items: center; }
  .h-card { width: 100%; max-width: 600px; }
  
  /* Expansion Sections */
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
  .testi-glass-card.highlight { grid-column: span 1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand-col { grid-column: span 2; }
}

@media (max-width: 768px) {
  /* Hero Section */
  .top-nav { flex-direction: column; gap: 20px; text-align: center;}
  .sub-nav { flex-direction: column; height: auto; padding: 20px 0; gap: 20px; }
  .nav-menu { flex-wrap: wrap; justify-content: center; gap: 15px; height: auto; }
  .nav-menu li { height: auto; }
  .nav-menu a { padding: 5px 0; }
  .search-box { width: 100%; }
  .h-card { flex-direction: column; text-align: center; }
  .h-info { align-items: center; text-align: center; }
  .h-info .t-desc { text-align: center; }
  .h-actions { flex-direction: column; gap: 15px; }
  .h-card .btn-cyan { width: 100%; }
  .page-title { flex-direction: column; font-size: 2rem; }

  /* Expansion Sections */
  .filters-container { flex-direction: column; }
  .filter-group { width: 100%; }
  .btn-search-filter { width: 100%; }
  
  .bento-grid { grid-template-columns: 1fr; }
  .bento-large, .bento-wide { grid-column: span 1; grid-row: span 1; }
  
  .timeline-container::before { right: 30px; }
  .timeline-step { gap: 20px; }
  .step-number { width: 60px; height: 60px; font-size: 1.4rem; }
  
  .enterprise-cta-banner h2 { font-size: 2rem; }
  
  .footer-grid { grid-template-columns: 1fr; gap: 40px;}
  .footer-brand-col { grid-column: span 1; text-align: center;}
  .footer-desc { margin: 25px auto; }
  .social-links { justify-content: center; }
  .footer-nav-col { text-align: center; }
}
