/* =========================================================
   🌐 YallaUni Stylesheet
   Author: Simo SEO
   Description: Global CSS for bilingual Bootstrap site
   Fonts (Google): Inter (LTR), IBM Plex Sans Arabic (RTL body),
                   Noto Kufi Arabic (RTL headings)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=Noto+Kufi+Arabic:wght@400;600;700&display=swap');

/* ------------------------------
   Root Variables
------------------------------ */
:root {
  --primary: #0047AB;
  --accent: #198754;
  --bg: #F8F9FA;
}

/* ------------------------------
   Base
------------------------------ */
html, body {
  background: var(--bg);
  margin: 0;
  padding: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* LTR */
body[dir="ltr"] {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 400;
  line-height: 1.6;
}

/* RTL */
body[dir="rtl"] {
  font-family: "IBM Plex Sans Arabic", "Noto Naskh Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  font-weight: 400;
  line-height: 1.8;
}

/* RTL Headings */
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3,
[dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6 {
  font-family: "Noto Kufi Arabic", "IBM Plex Sans Arabic", "Noto Naskh Arabic", Tahoma, Arial, sans-serif;
  font-weight: 700;
  line-height: 1.35;
}

.h2, h2 { font-size: 34px !important; }
.h3, h3 { font-size: 22px !important; }
p { font-size: 19px; }

[dir="rtl"] strong, [dir="rtl"] .fw-bold { font-weight: 700; }
[dir="rtl"] .fw-semibold { font-weight: 600; }

/* ------------------------------
   Navbar
------------------------------ */
.navbar {
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.navbar-brand span {
  color: var(--primary);
  font-weight: 700;
}
.nav-link.active {
  color: var(--primary) !important;
  font-weight: 600;
}
/* ------------------------------
   Hero
------------------------------ */
.hero {
  position: relative;
  background: url('../img/banner.jpg') center/cover no-repeat;
  color: #fff;
  padding: 5rem 0;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0.80;
  z-index: 1;
}
.hero > * { position: relative; z-index: 2; }

.hero .btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.hero .btn-accent:hover { filter: brightness(0.92); }

/* ------------------------------
   Feature Cards
------------------------------ */
.feature-card {
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: 0.75rem;
  padding: 2rem 1.5rem;
  transition: all 0.3s ease;
  text-align: center;
}
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.05);
}
.feature-card .bi {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

/* ------------------------------
   Enhanced CTA
------------------------------ */
.enhanced-cta {
  background: linear-gradient(90deg, #0047AB 0%, #0056C4 100%);
  color: #fff;
  border-radius: 1rem;
  box-shadow: 0 6px 24px rgba(0,0,0,0.15);
  transition: background 0.3s ease;
}
.enhanced-cta:hover {
  background: linear-gradient(90deg, #003E99 0%, #004FB8 100%);
}
.enhanced-cta .cta-title {
  font-size: 30px !important;
  line-height: 1.9;
}
.enhanced-cta .cta-text {
  font-size: 18px;
  opacity: 0.95;
}
.enhanced-cta .btn {
  background: #fff;
  color: #0047AB;
  font-weight: 600;
  border: none;
  transition: all 0.25s ease;
}
.enhanced-cta .btn:hover {
  transform: translateY(-3px);
  background: #f1f3f5;
  color: #003E99;
}
@media (max-width: 767px) {
  .enhanced-cta { text-align: center; padding: 2rem 1.25rem; }
  .enhanced-cta .cta-title { font-size: 1.3rem; }
  .enhanced-cta .cta-text { font-size: 0.95rem; }
}

/* ------------------------------
   Footer
------------------------------ */
.footer {
  background: #111827;
  color: #adb5bd;
  font-size: 0.9rem;
  padding: 2rem 0;
}
.footer a {
  color: #adb5bd;
  text-decoration: none;
}
.footer a:hover { color: #fff; }

/* ------------------------------
   Back to Top Button
------------------------------ */
#backToTop {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 999;
  display: none;
  background: var(--primary);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}
#backToTop:hover { background: var(--accent); }

/* ------------------------------
   RTL Tweaks
------------------------------ */

/* [dir="rtl"] .bi {
  transform: scaleX(-1);
} */

[dir="rtl"] .navbar-nav { margin-right: 0 !important; }
@media (max-width: 576px) {
  [dir="rtl"] .display-5 { font-size: 1.9rem; }
  [dir="rtl"] h1, [dir="rtl"] .h1 { font-size: 1.6rem; }
}

/* ------------------------------
   Contact Form
------------------------------ */
.contact-box {
  width: 50%;
  margin: 0 auto;
  background-color: #f3f4f6 !important;
  padding: 2rem !important;
  border: 2px solid #1e56c5 !important;
  border-radius: 0 !important;
}
@media (max-width: 768px) { .contact-box { width: 100%; } }

.contact-box input::placeholder,
.contact-box textarea::placeholder {
  color: #6c757d;
  opacity: 1;
}
.contact-box input,
.contact-box textarea {
  border: 1.5px solid #0047AB !important;
  border-radius: 0.5rem !important;
  background-color: #fff;
  transition: all 0.2s ease;
}
.contact-box input:focus,
.contact-box textarea:focus {
  border-color: #002e74 !important;
  box-shadow: 0 0 0 0.2rem rgba(0,71,171,0.15);
  outline: none;
}

/* Make Arabic form text start from right */
[dir="rtl"] .form-control { text-align: right; }

/* Submit Button */
.contact-box button[type="submit"] {
  background-color: #0047AB !important;
  color: #fff !important;
  border: none !important;
  border-radius: 0.5rem !important;
  padding: 0.75rem 1.5rem !important;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.25s ease-in-out;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.contact-box button[type="submit"]:hover {
  background-color: #003b8f !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,71,171,0.25);
}
.contact-box button[type="submit"]:focus {
  outline: none;
  box-shadow: 0 0 0 0.25rem rgba(0,71,171,0.35);
}
.contact-box button[type="submit"]:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0,71,171,0.2);
}

/* ------------------------------
   Alerts
------------------------------ */
.alert {
  direction: rtl;
  font-weight: 500;
  border-radius: 0.75rem;
}
.alert-success {
  background-color: #e8f4ec;
  color: #136b2e;
  border: 1px solid #a3d9b5;
}
.alert-danger {
  background-color: #fbeaea;
  color: #b30d0d;
  border: 1px solid #f3b6b6;
}

/* =========================================================
   🌟 PERFECT TESTIMONIAL CAROUSEL
   ========================================================= */

/* Desktop/tablet spacing */
#studentCarousel {
  position: relative;
  padding-inline: 4rem;   /* logical: works in RTL/LTR */
  overflow-x: hidden;     /* belt + suspenders */
}

/* Mobile: no overflow, no ghost width */
@media (max-width: 767px) {
  #studentCarousel {
    padding-inline: 1rem !important; /* not 4rem */
    margin: 0 !important;
    width: 100% !important;          /* ✅ instead of 100vw */
    max-width: 100% !important;
    box-sizing: border-box;
  }

  /* keep inner tight & centered */
  #studentCarousel .carousel-inner { padding: 0 !important; overflow-x: hidden; }
  #studentCarousel .carousel-item .row { margin: 0 !important; }
  #studentCarousel .carousel-item [class*="col-"] { max-width: 100% !important; }

  /* arrows inside bounds, no negative offsets */
  [dir="rtl"] #studentCarousel .carousel-control-prev { inset-inline-start: .25rem; inset-inline-end: auto; }
  [dir="rtl"] #studentCarousel .carousel-control-next { inset-inline-end: .25rem; inset-inline-start: auto; }
}

#studentCarousel .testimonial-card {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 1rem;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  padding: 1.5rem;
  text-align: right;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
#studentCarousel .testimonial-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.07);
}
#studentCarousel .testimonial-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid #0047AB;
  flex-shrink: 0;
}

/* Arrows */
#studentCarousel .carousel-control-prev,
#studentCarousel .carousel-control-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  background: rgba(0,71,171,0.07);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0.8;
  transition: all 0.3s ease;
  z-index: 10;
}
#studentCarousel .carousel-control-prev:hover,
#studentCarousel .carousel-control-next:hover {
  background: rgba(0,71,171,0.18);
  opacity: 1;
}
[dir="rtl"] #studentCarousel .carousel-control-prev {
  right: -2.8rem;
  left: auto;
}
[dir="rtl"] #studentCarousel .carousel-control-next {
  left: -2.8rem;
  right: auto;
}

/* Icons */
#studentCarousel .carousel-control-prev-icon,
#studentCarousel .carousel-control-next-icon {
  width: 1.3rem;
  height: 1.3rem;
  background-size: 100% 100%;
  filter: brightness(0) saturate(100%) invert(33%) sepia(94%) saturate(494%) hue-rotate(189deg) brightness(97%) contrast(97%);
}
[dir="rtl"] .carousel-control-prev-icon,
[dir="rtl"] .carousel-control-next-icon {
  transform: rotate(180deg);
}

/* Responsive: tighter arrows on mobile */
@media (max-width: 576px) {
  [dir="rtl"] #studentCarousel .carousel-control-prev { right: -1.5rem; }
  [dir="rtl"] #studentCarousel .carousel-control-next { left: -1.5rem; }
}

/* ✅ Responsive Testimonials */
#studentCarousel .testimonial-card {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 1rem;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
}
#studentCarousel .testimonial-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
}

/* ✅ Avatar */
.testimonial-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 2px solid #0047AB;
  flex-shrink: 0;
}

/* ✅ Fix spacing on mobile */
@media (max-width: 767px) {
  #studentCarousel .row > [class*='col-'] {
    flex: 0 0 100%;
    max-width: 100%;
  }
  #studentCarousel .testimonial-card {
    flex-direction: column;
    text-align: right;
    align-items: flex-start;
  }
  #studentCarousel .testimonial-avatar {
    margin-bottom: 0.75rem;
  }
}

/* ✅ Tighter layout on tablets */
@media (min-width: 768px) and (max-width: 991px) {
  #studentCarousel .testimonial-card {
    padding: 1.25rem;
  }
}

.logo {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
}

.site-logo {
  width: 150px;
  height: auto;
  max-height: 120px;
  transition: all 0.2s ease-in-out;
}

/* Medium screens (tablets) */
@media (max-width: 992px) {
  .site-logo {
    width: 130px;
    max-height: 100px;
  }
}

/* Small screens (phones) */
@media (max-width: 576px) {
  .site-logo {
    width: 110px;
    max-height: 90px;
  }
}


/* ✅ Make testimonial carousel wider and better spaced */
#studentCarousel .carousel-item .col-md-6 {
  flex: 0 0 90%;
  max-width: 90%;
  margin: 0 auto;
}

/* On medium screens and larger, restore normal width (two cards per slide) */
@media (min-width: 768px) {
  #studentCarousel .carousel-item .col-md-6 {
    flex: 0 0 45%;
    max-width: 45%;
  }
}

/* On very large screens, balance layout perfectly */
@media (min-width: 1200px) {
  #studentCarousel .carousel-item .col-md-6 {
    flex: 0 0 40%;
    max-width: 40%;
  }
}

/* ✅ Make testimonial cards truly full width on mobile */
@media (max-width: 767px) {
  #studentCarousel .carousel-inner {
    padding: 0 0.5rem; /* a bit of side spacing for safe area */
  }

  #studentCarousel .carousel-item .col-md-6 {
    flex: 0 0 98%;      /* use almost the entire width */
    max-width: 98%;
    margin: 0 auto;     /* center it nicely */
  }

  #studentCarousel .testimonial-card {
    width: 100%;
    max-width: 100%;
    border-radius: 1rem;
    padding: 1.75rem 1.25rem;
  }

  /* Slightly smaller avatar for proportional look */
  #studentCarousel .testimonial-avatar {
    width: 70px;
    height: 70px;
  }

  /* Adjust arrow positions to avoid touching card */
  [dir="rtl"] #studentCarousel .carousel-control-prev {
    right: 0.25rem;
  }

  [dir="rtl"] #studentCarousel .carousel-control-next {
    left: 0.25rem;
  }
}

/* =========================================================
   🧩 Ultimate Fix: Make Testimonials Truly Full Width on Mobile
   ========================================================= */
@media (max-width: 767px) {
  /* Remove Bootstrap's default horizontal padding from the section container */
  section .container-fluid {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Stretch carousel to full viewport width */
  #studentCarousel {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    width: 100vw;
    max-width: 100vw;
  }

  /* Ensure carousel inner doesn't clip */
  #studentCarousel .carousel-inner {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Force cards to take nearly full width */
  #studentCarousel .carousel-item .col-md-6 {
    flex: 0 0 100%;
    max-width: 100%;
    margin: 0 auto;
  }

  /* Make cards visually expansive */
  #studentCarousel .testimonial-card {
    width: 100%;
    border-radius: 1rem;
    padding: 1.8rem 1.25rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  }

  /* Arrow controls closer to edges */
  [dir="rtl"] #studentCarousel .carousel-control-prev {
    right: 0.4rem !important;
  }
  [dir="rtl"] #studentCarousel .carousel-control-next {
    left: 0.4rem !important;
  }
}

.social-btn {
  flex-direction: row-reverse; /* icon right, text left for Arabic */
  font-size: 15px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.social-btn i {
  font-size: 1.2em;
}

.social-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
