/* ================ TOKENS ================ */
:root {
  --primary: #00A4FF;
  --primary-dark: #00389B;
  --bg: #f7f7f7;
  --text: #1f2937;
  --white: #ffffff;
}

/* ================ FONTAWESOME ICON FIXES ================ */
/* Ensure FontAwesome icons display properly in RTL */
[dir="rtl"] .fas,
[dir="rtl"] .far,
[dir="rtl"] .fab,
[dir="rtl"] .fa {
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  display: inline-block !important;
  font-style: normal !important;
  font-variant: normal !important;
  text-rendering: auto !important;
  line-height: 1 !important;
}

/* Global FontAwesome icon fix for all pages */
.fas,
.far,
.fab,
.fa {
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  display: inline-block !important;
  font-style: normal !important;
  font-variant: normal !important;
  text-rendering: auto !important;
  line-height: 1 !important;
}

.container {
  width: min(1200px, 92%);
  margin: 0 auto;
}

/* ================ HERO ================ */
.hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 420px at var(--g1-x, 10%) var(--g1-y, 10%), rgba(0, 164, 255, 0.14), transparent 60%),
    radial-gradient(900px 420px at var(--g2-x, 90%) var(--g2-y, 20%), rgba(0, 56, 155, 0.14), transparent 60%),
    linear-gradient(180deg, rgba(0, 56, 155, 0.10), rgba(0, 164, 255, 0.10));
  padding: 40px 0;
  position: relative;
  overflow: hidden;
  animation: heroGradientShift 12s ease-in-out infinite alternate;
}

.hero::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(0, 164, 255, 0.25), rgba(0, 56, 155, 0.15));
  filter: blur(30px);
  left: -120px;
  bottom: -120px;
  animation: floatBlob 18s ease-in-out infinite;
}

@keyframes heroGradientShift {
  0% {
    --g1-x: 8%;
    --g1-y: 12%;
    --g2-x: 88%;
    --g2-y: 18%;
  }

  50% {
    --g1-x: 14%;
    --g1-y: 18%;
    --g2-x: 82%;
    --g2-y: 26%;
  }

  100% {
    --g1-x: 10%;
    --g1-y: 24%;
    --g2-x: 90%;
    --g2-y: 12%;
  }
}

@keyframes floatBlob {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 0.85;
  }

  50% {
    transform: translate(40px, -20px) scale(1.05);
    opacity: 1;
  }

  100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.85;
  }
}

.hero .container {
  text-align: center;
}

#hero-title {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.2;
  color: var(--primary-dark);
}

#hero-subtitle {
  margin-top: 12px;
  color: #334155;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.cta-button {
  display: inline-block;
  margin-top: 20px;
  background: var(--primary);
  color: var(--white);
  text-decoration: none;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(0, 164, 255, 0.28);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.cta-button:hover {
  transform: translateY(-1px);
  background: #0095e6;
  box-shadow: 0 8px 20px rgba(0, 164, 255, 0.35);
}

/* ================ ABOUT SECTION ================ */
.about-section {
  padding: 80px 0;
  background: var(--white);
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.about-text h2 {
  color: var(--primary-dark);
  font-size: clamp(24px, 3vw, 32px);
  margin-bottom: 20px;
  line-height: 1.3;
}

.about-text p {
  color: #334155;
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 30px;
}

.about-image {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.about-image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.about-image:hover img {
  transform: scale(1.05);
}

@media (max-width: 992px) {
  .about-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-image {
    order: -1;
  }

  .about-image img {
    height: 300px;
  }
}

@media (max-width: 576px) {
  .about-section {
    padding: 60px 0;
  }

  .about-content {
    gap: 30px;
  }

  .about-image img {
    height: 250px;
  }
}

/* ================ GALLERY SLIDER ================ */
.gallery-section {
  padding: 56px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 24px;
}

.section-title h2 {
  color: var(--primary-dark);
}

.section-title p {
  display: none;
}

.modern-slider {
  position: relative;
}

.slider-wrapper {
  overflow: hidden;
  border-radius: 16px;
}

.slider-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  transition: transform .6s ease;
}

/* RTL fixes for slider */
[dir="rtl"] .slider-track {
  direction: ltr;
  /* Force LTR for slider track to maintain proper positioning */
}

[dir="rtl"] .slider-track .slide {
  direction: rtl;
  /* Restore RTL for slide content */
}

.slide {
  position: relative;
  height: 650px;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* RTL fixes for slider images */
[dir="rtl"] .slide img {
  transform: none;
  /* Prevent any RTL transforms on images */
  direction: ltr;
  /* Force LTR for image display */
}

.slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.0), rgba(0, 0, 0, 0.45));
  color: var(--white);
  display: flex;
  align-items: end;
  padding: 20px;
}

.slider-control {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 44px;
  height: 64px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 0;
  display: grid;
  place-items: center;
  color: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  cursor: pointer;
}

.prev-btn {
  left: 14px;
}

.next-btn {
  right: 14px;
}

/* RTL fixes for slider controls */
[dir="rtl"] .prev-btn {
  left: auto;
  right: 14px;
}

[dir="rtl"] .next-btn {
  right: auto;
  left: 14px;
}

.slider-pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

/* RTL fixes for pagination */
[dir="rtl"] .slider-pagination {
  direction: ltr;
  /* Keep pagination dots in LTR order */
}

.slider-counter {
  position: absolute;
  bottom: 14px;
  right: 18px;
  color: var(--white);
  background: rgba(0, 0, 0, 0.35);
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
}

/* RTL fixes for slider counter */
[dir="rtl"] .slider-counter {
  right: auto;
  left: 18px;
}

/* ================ FEATURES/PRODUCTS ================ */
.features {
  padding: 56px 0;
  background: var(--bg);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--white);
  border: 1px solid #eef2f7;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  display: grid;
  grid-template-rows: 240px 1fr;
}

.feature-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.feature-content {
  padding: 16px;
}

.feature-content h3 {
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.feature-price {
  color: var(--primary-dark);
  font-weight: 800;
}

@media (max-width: 992px) {
  .features-grid {
    grid-template-columns: 1fr;
  }

  .feature-card {
    grid-template-columns: 1fr;
  }

  .slide {
    height: 280px;
  }
}

@media (max-width: 576px) {
  .hero {
    padding: 48px 0;
  }

  .features {
    padding: 40px 0;
  }

  .slide {
    height: 240px;
  }
}

/* ================ CUSTOM SCROLLBAR ================ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  border-radius: 4px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--primary-dark), #002a7a);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--primary) #f1f5f9;
}

/* ================ CUSTOM SELECTION COLORS ================ */
::selection {
  background: rgba(0, 164, 255, 0.2);
  color: var(--primary-dark);
}

::-moz-selection {
  background: rgba(0, 164, 255, 0.2);
  color: var(--primary-dark);
}

/* ================ ENHANCED BACK TO TOP BUTTON ================ */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(0, 164, 255, 0.4);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.8);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  font-size: 18px;
}

.back-to-top:hover {
  background: linear-gradient(135deg, var(--primary-dark), #002a7a);
  box-shadow: 0 12px 32px rgba(0, 164, 255, 0.5);
  transform: translateY(-2px) scale(1.05);
}

.back-to-top:active {
  transform: translateY(0) scale(0.95);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Pulse animation for attention */
.back-to-top.pulse {
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {

  0%,
  100% {
    box-shadow: 0 8px 24px rgba(0, 164, 255, 0.4);
  }

  50% {
    box-shadow: 0 8px 24px rgba(0, 164, 255, 0.6), 0 0 20px rgba(0, 164, 255, 0.3);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .back-to-top {
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .back-to-top {
    right: 12px;
    bottom: 12px;
    width: 40px;
    height: 40px;
    font-size: 14px;
  }
}