/* Welcome Portal Stylesheet - Enhanced with Vibrant Colors & Animations */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700;800&family=Cairo:wght@300;400;600;700;800&display=swap');

/* ========== Fluid Gradient Background ========== */
body.welcome-portal-body {
    background: linear-gradient(-45deg, #f0f4ff, #e8f0fe, #dce8f8, #eef3fc, #f5f0ff);
    background-size: 400% 400%;
    animation: fluidGradient 18s ease infinite;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    color: #2d3138;
    overflow-x: hidden;
    position: relative;
}

body.welcome-portal-body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(63,169,245,0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body.welcome-portal-body::after {
    content: '';
    position: fixed;
    bottom: -30%;
    left: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(12,92,168,0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

@keyframes fluidGradient {
    0% { background-position: 0% 50%; }
    25% { background-position: 100% 0%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
    100% { background-position: 0% 50%; }
}

/* RTL support */
[dir="rtl"] body.welcome-portal-body,
[dir="rtl"] .welcome-portal-body {
    font-family: 'Cairo', sans-serif;
}

/* ========== Floating Language Switcher ========== */
.language-selector-container {
    position: absolute;
    top: 30px;
    right: 40px;
    z-index: 1000;
    animation: slideDownLang 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(-20px);
}

[dir="rtl"] .language-selector-container {
    right: auto;
    left: 40px;
}

@keyframes slideDownLang {
    to { opacity: 1; transform: translateY(0); }
}

.lang-toggle-btn {
    display: inline-flex;
    direction: ltr !important;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(12, 92, 168, 0.12);
    border-radius: 30px;
    padding: 4px;
    box-shadow: 0 4px 20px rgba(12, 92, 168, 0.06);
    cursor: pointer;
    position: relative;
    user-select: none;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.lang-toggle-btn:hover {
    box-shadow: 0 6px 25px rgba(12, 92, 168, 0.12);
    border-color: rgba(12, 92, 168, 0.25);
}

.lang-toggle-btn span {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #7f8c8d;
    transition: color 0.3s ease;
    border-radius: 22px;
    z-index: 2;
    position: relative;
}

.lang-toggle-btn .lang-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    height: calc(100% - 8px);
    width: calc(50% - 4px);
    background: linear-gradient(135deg, #0c5ca8, #3fa9f5);
    border-radius: 22px;
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    box-shadow: 0 2px 10px rgba(12, 92, 168, 0.3);
}

.lang-toggle-btn.lang-en span.btn-en { color: #ffffff; }
.lang-toggle-btn.lang-ar span.btn-ar { color: #ffffff; }
.lang-toggle-btn.lang-ar .lang-indicator {
    transform: translateX(100%);
}

/* ========== Hero Section ========== */
.welcome-hero {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 90px 20px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.welcome-hero.fade-out-hero {
    opacity: 0;
    transform: translateY(-40px);
}

.welcome-badge {
    background: linear-gradient(135deg, rgba(12,92,168,0.08), rgba(63,169,245,0.08));
    color: #0c5ca8;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 25px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    display: inline-block;
    border: 1px solid rgba(12, 92, 168, 0.1);
    opacity: 0;
    animation: fadeSlideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

.welcome-title-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
    opacity: 0;
    animation: fadeSlideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}

.welcome-title-wrap img.logo-img {
    height: 70px;
    width: auto;
    filter: drop-shadow(0 4px 15px rgba(12,92,168,0.15));
}

.welcome-subtitle {
    font-size: 19px;
    color: #2c3e50;
    max-width: 550px;
    margin: 0 auto 50px;
    line-height: 1.7;
    font-weight: 500;
    text-shadow: 0 2px 15px rgba(255,255,255,0.8);
    opacity: 0;
    animation: fadeSlideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(25px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== Category Grid ========== */
.categories-container {
    max-width: 1100px;
    margin: 0 auto 80px;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 28px;
    justify-content: center;
    transition: opacity 0.5s ease;
}

.categories-grid.fade-out-siblings .category-card:not(.clicked) {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
    pointer-events: none;
}

/* ========== Glassmorphism Card Style ========== */
.category-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 22px;
    padding: 38px 30px;
    text-decoration: none !important;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: cardEntrance 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.category-card:nth-child(1) { animation-delay: 0.3s; }
.category-card:nth-child(2) { animation-delay: 0.4s; }
.category-card:nth-child(3) { animation-delay: 0.5s; }
.category-card:nth-child(4) { animation-delay: 0.6s; }
.category-card:nth-child(5) { animation-delay: 0.7s; }
.category-card:nth-child(6) { animation-delay: 0.8s; }

@keyframes cardEntrance {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Gradient Top accent line */
.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* Unique hover accent colors per card */
.category-card:nth-child(1)::before { background: linear-gradient(90deg, #0c5ca8, #3fa9f5); }
.category-card:nth-child(2)::before { background: linear-gradient(90deg, #00b4d8, #48cae4); }
.category-card:nth-child(3)::before { background: linear-gradient(90deg, #6c63ff, #a78bfa); }
.category-card:nth-child(4)::before { background: linear-gradient(90deg, #10b981, #34d399); }
.category-card:nth-child(5)::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.category-card:nth-child(6)::before { background: linear-gradient(90deg, #ec4899, #f43f5e); }

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 24px 48px rgba(12, 92, 168, 0.08);
    border-color: rgba(12, 92, 168, 0.15);
}

.category-card:hover::before { opacity: 1; }

/* Unique hover glow shadows */
.category-card:nth-child(1):hover { box-shadow: 0 20px 50px rgba(12, 92, 168, 0.12); }
.category-card:nth-child(2):hover { box-shadow: 0 20px 50px rgba(0, 180, 216, 0.12); }
.category-card:nth-child(3):hover { box-shadow: 0 20px 50px rgba(108, 99, 255, 0.12); }
.category-card:nth-child(4):hover { box-shadow: 0 20px 50px rgba(16, 185, 129, 0.12); }
.category-card:nth-child(5):hover { box-shadow: 0 20px 50px rgba(245, 158, 11, 0.12); }
.category-card:nth-child(6):hover { box-shadow: 0 20px 50px rgba(236, 72, 153, 0.12); }

/* Clicked state for exit animation */
.category-card.clicked {
    transform: scale(1.05);
    z-index: 100;
    box-shadow: 0 30px 60px rgba(12, 92, 168, 0.18);
    border-color: rgba(12, 92, 168, 0.3);
}

[dir="rtl"] .category-card { align-items: flex-start; text-align: right; }

/* ========== Card Icon ========== */
.card-icon-box {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    font-size: 24px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Unique icon colors per card */
.category-card:nth-child(1) .card-icon-box { background: rgba(12,92,168,0.08); color: #0c5ca8; }
.category-card:nth-child(2) .card-icon-box { background: rgba(0,180,216,0.08); color: #00b4d8; }
.category-card:nth-child(3) .card-icon-box { background: rgba(108,99,255,0.08); color: #6c63ff; }
.category-card:nth-child(4) .card-icon-box { background: rgba(16,185,129,0.08); color: #10b981; }
.category-card:nth-child(5) .card-icon-box { background: rgba(245,158,11,0.08); color: #f59e0b; }
.category-card:nth-child(6) .card-icon-box { background: rgba(236,72,153,0.08); color: #ec4899; }

.category-card:nth-child(1):hover .card-icon-box { background: #0c5ca8; color: #fff; transform: scale(1.1) rotate(-5deg); }
.category-card:nth-child(2):hover .card-icon-box { background: #00b4d8; color: #fff; transform: scale(1.1) rotate(-5deg); }
.category-card:nth-child(3):hover .card-icon-box { background: #6c63ff; color: #fff; transform: scale(1.1) rotate(-5deg); }
.category-card:nth-child(4):hover .card-icon-box { background: #10b981; color: #fff; transform: scale(1.1) rotate(-5deg); }
.category-card:nth-child(5):hover .card-icon-box { background: #f59e0b; color: #fff; transform: scale(1.1) rotate(-5deg); }
.category-card:nth-child(6):hover .card-icon-box { background: #ec4899; color: #fff; transform: scale(1.1) rotate(-5deg); }

/* ========== Card Typography ========== */
.card-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a2332;
    margin: 0 0 10px 0;
    transition: color 0.3s ease;
}

.category-card:nth-child(1):hover .card-title { color: #0c5ca8; }
.category-card:nth-child(2):hover .card-title { color: #00b4d8; }
.category-card:nth-child(3):hover .card-title { color: #6c63ff; }
.category-card:nth-child(4):hover .card-title { color: #10b981; }
.category-card:nth-child(5):hover .card-title { color: #f59e0b; }
.category-card:nth-child(6):hover .card-title { color: #ec4899; }

.card-desc {
    font-size: 15px;
    color: #7f8c8d;
    line-height: 1.6;
    margin: 0 0 25px 0;
    font-weight: 400;
}

/* ========== Card Action Arrow ========== */
.card-action {
    margin-top: auto;
    font-size: 14px;
    font-weight: 700;
    color: #0c5ca8;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.3s ease, color 0.3s ease;
}

.card-action i { transition: transform 0.3s ease; }

.category-card:hover .card-action { gap: 12px; }
.category-card:hover .card-action i { transform: translateX(4px); }
[dir="rtl"] .category-card:hover .card-action i { transform: translateX(-4px); }

/* ========== Fade animation for translation ========== */
.fade-out {
    opacity: 0 !important;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.fade-in {
    opacity: 1 !important;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ========== Portal Footer ========== */
.portal-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 40px 20px;
    border-top: 1px solid rgba(12, 92, 168, 0.05);
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(5px);
}

.portal-footer p {
    font-size: 13px;
    color: #95a5a6;
    margin: 0;
}

.portal-footer a {
    color: #0c5ca8;
    text-decoration: none;
    font-weight: 500;
}

.portal-footer a:hover { color: #3fa9f5; }

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .welcome-hero { padding: 80px 20px 20px; }
    .welcome-title-wrap img.logo-img { height: 50px; }
    .welcome-subtitle { font-size: 16px; }
    .categories-grid { grid-template-columns: 1fr; gap: 20px; }
    .language-selector-container { top: 15px; right: 15px; }
    [dir="rtl"] .language-selector-container { right: auto; left: 15px; }
}

/* ========== Portal Background Slider ========== */
.portal-slider {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}
.portal-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}
.portal-slide.active {
    opacity: 1;
}
.portal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.45); /* Reduced transparency so images are clearer */
    z-index: 1;
    pointer-events: none;
}

/* Offset for modern header */
.welcome-hero {
    padding-top: 130px !important;
}

/* Product Showcase Slider */
.product-showcase-wrapper { 
  width: 100%; 
  overflow: hidden; 
  background: rgba(255, 255, 255, 0.9); 
  padding: 30px 0; 
  position: relative; 
  z-index: 10; 
  margin-top: -60px; /* pull up over the hero */
  box-shadow: 0 -10px 20px rgba(0,0,0,0.1); 
  backdrop-filter: blur(10px); 
}
.product-showcase-track { 
  display: flex; 
  width: 100%; 
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.product-showcase-track::-webkit-scrollbar {
  display: none;
}
.product-slide { 
  width: 200px; 
  height: 150px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  padding: 10px; 
  flex-shrink: 0; 
}
.product-slide img { 
  max-width: 100%; 
  max-height: 100%; 
  object-fit: contain; 
  border-radius: 10px; 
  background: #fff; 
  padding: 5px; 
  box-shadow: 0 4px 10px rgba(0,0,0,0.08); 
  transition: transform 0.3s, box-shadow 0.3s; 
  cursor: pointer;
}
.product-slide img:hover { 
  transform: scale(1.15); 
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
@keyframes scroll-products { 
  0% { transform: translateX(0); } 
  100% { transform: translateX(calc(-200px * 8)); } 
}

.product-slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.product-slider-btn i {
  color: #0c5ca8;
  font-size: 18px;
  transition: transform 0.3s ease;
}
.product-slider-btn:hover {
  background: #0c5ca8;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 15px rgba(12, 92, 168, 0.4);
}
.product-slider-btn:hover i {
  color: white;
}
.product-slider-btn:active {
  transform: translateY(-50%) scale(0.95);
}

/* Comprehensive Mobile Responsiveness */
@media (max-width: 768px) {
  .welcome-hero { 
    padding-top: 100px !important; 
    padding-bottom: 20px; 
  }
  .welcome-title-wrap img.logo-img { height: 50px; }
  .welcome-subtitle { font-size: 16px; margin-bottom: 30px; }
  
  /* Fix Language selector positioning */
  .language-selector-container { top: 15px; right: 15px; transform: scale(0.9); }
  [dir="rtl"] .language-selector-container { right: auto; left: 15px; }
  
  /* Fix Product slider for mobile */
  .product-showcase-wrapper {
    margin-top: -30px;
    padding: 20px 0;
  }
  .product-slide {
    width: 140px;
    height: 110px;
    padding: 5px;
  }
  .product-slide img {
    border-radius: 6px;
  }
  /* Hide the manual buttons on mobile, native swipe is better and doesn't block the view */
  .product-slider-btn {
    display: none !important;
  }

  /* Fix Categories Grid */
  .categories-container {
    padding: 0 15px;
    margin-bottom: 50px;
  }
  .categories-grid { 
    grid-template-columns: 1fr; 
    gap: 15px; 
  }
  .category-card {
    padding: 25px 20px;
    border-radius: 16px;
  }
  .card-icon-box {
    width: 50px;
    height: 50px;
    font-size: 20px;
    margin-bottom: 15px;
  }
  .card-title {
    font-size: 19px;
    margin-bottom: 8px;
  }
  .card-desc {
    font-size: 14px;
    margin-bottom: 15px;
  }
  
  /* Fix floating socials */
  .floating-socials {
    transform: scale(0.85);
    transform-origin: right center;
  }
  [dir="rtl"] .floating-socials {
    transform-origin: left center;
  }
}

