/* ============================================================ */
/*  HIGH STANDARD MEDICAL - Custom Styles                        */
/*  Premium Healthcare Technology Website                       */
/* ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --navy-dark: #031226;
  --navy-mid: #071B3B;
  --navy-light: #0A244D;
  --medical-blue: #118BC9;
  --medical-cyan: #1CCFD5;
  --white: #FFFFFF;
  --light-bg: #F7FAFC;
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.15);
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Base ---------- */
html {
  scroll-behavior: smooth;
}

body {
  background: var(--navy-dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--medical-cyan);
  color: var(--navy-dark);
}

/* ---------- Glassmorphism Utilities ---------- */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.2),
    0 1px 2px rgba(255, 255, 255, 0.05) inset;
}

.glass-card-light {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-card-floating {
  background: rgba(3, 18, 38, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(28, 207, 213, 0.2);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

/* ---------- Animated Background ---------- */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.bg-gradient-radial {
  background:
    radial-gradient(ellipse at 20% 20%, rgba(17, 139, 201, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(28, 207, 213, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(7, 27, 59, 0.5) 0%, transparent 70%);
  pointer-events: none;
}

.bg-blur-circle {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

.bg-blur-circle-1 {
  width: 600px;
  height: 600px;
  background: rgba(17, 139, 201, 0.06);
  top: -200px;
  left: -100px;
  animation: floatBlur 20s ease-in-out infinite;
}

.bg-blur-circle-2 {
  width: 500px;
  height: 500px;
  background: rgba(28, 207, 213, 0.05);
  bottom: -150px;
  right: -100px;
  animation: floatBlur 25s ease-in-out infinite reverse;
}

.bg-blur-circle-3 {
  width: 400px;
  height: 400px;
  background: rgba(17, 139, 201, 0.04);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: floatBlur 30s ease-in-out infinite;
}

@keyframes floatBlur {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -30px) scale(1.1); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(-30px, -20px) scale(1.05); }
}

/* DNA Lines */
.dna-lines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.03;
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 40px,
      var(--medical-cyan) 40px,
      var(--medical-cyan) 41px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 40px,
      var(--medical-cyan) 40px,
      var(--medical-cyan) 41px
    );
}

/* ---------- Navbar ---------- */
#navbar {
  transition: transform 0.5s var(--transition-smooth),
              opacity 0.5s var(--transition-smooth),
              box-shadow 0.5s var(--transition-smooth);
  will-change: transform;
}

#navbar.scrolled {
  background: rgba(7, 27, 59, 0.7);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.nav-link {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  transition: all 0.3s var(--transition-smooth);
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

/* Language Switch */
.lang-option {
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  user-select: none;
}

.lang-option.active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.12);
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--medical-blue), var(--medical-cyan));
  color: var(--white);
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: all 0.4s var(--transition-smooth);
  box-shadow:
    0 4px 20px rgba(17, 139, 201, 0.3),
    0 1px 3px rgba(255, 255, 255, 0.1) inset;
  white-space: nowrap;
  will-change: transform;
}

.btn-primary:hover {
  box-shadow:
    0 8px 32px rgba(17, 139, 201, 0.5),
    0 0 0 3px rgba(28, 207, 213, 0.2),
    0 1px 3px rgba(255, 255, 255, 0.15) inset;
  transform: translateY(-2px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: all 0.4s var(--transition-smooth);
  white-space: nowrap;
}

.btn-secondary:hover {
  border-color: var(--medical-cyan);
  color: var(--medical-cyan);
  background: rgba(28, 207, 213, 0.05);
  box-shadow: 0 0 20px rgba(28, 207, 213, 0.15);
}

/* Magnetic Button Effect */
.btn-magnetic {
  position: relative;
  overflow: hidden;
}

.btn-magnetic::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at center, rgba(255,255,255,0.2) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.btn-magnetic:hover::after {
  opacity: 1;
}

/* ---------- Hero ---------- */
.hero-content {
  will-change: transform, opacity;
}

.hero-visual {
  will-change: transform;
}

.hero-svg {
  will-change: transform;
  animation: subtleFloat 6s ease-in-out infinite;
}

.hero-lines {
  will-change: transform;
  animation: linePulse 3s ease-in-out infinite;
}

@keyframes subtleFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-15px) scale(1.02); }
}

@keyframes linePulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

/* Gradient Animation */
.animate-gradient {
  background-size: 200% 200%;
  animation: gradientShift 4s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Scroll Indicator */
.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.scroll-mouse {
  width: 26px;
  height: 40px;
  border-radius: 13px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.scroll-wheel {
  width: 4px;
  height: 8px;
  border-radius: 2px;
  background: var(--medical-cyan);
  animation: scrollWheel 2s ease-in-out infinite;
}

@keyframes scrollWheel {
  0% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(8px); opacity: 0.3; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ---------- Statistics Bar ---------- */
.stats-container {
  min-height: 140px;
  animation: statsPulse 4s ease-in-out infinite;
}

@keyframes statsPulse {
  0%, 100% { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2); }
  50% { box-shadow: 0 8px 48px rgba(17, 139, 201, 0.15); }
}

.stat-number {
  font-variant-numeric: tabular-nums;
}

.stat-item {
  position: relative;
}

.stat-item::after {
  content: '';
  position: absolute;
  right: 0;
  top: 10%;
  height: 80%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.15), transparent);
}

.stat-item:last-child::after {
  display: none;
}

/* ---------- Wave SVG ---------- */
.wave-svg {
  transform: translateY(-2px);
}

/* ---------- Commitment Section ---------- */
.commitment-card {
  text-align: center;
  padding: 32px 20px;
  border-radius: 24px;
  background: var(--white);
  border: 1px solid rgba(7, 27, 59, 0.06);
  transition: all 0.4s var(--transition-smooth);
  will-change: transform;
}

.commitment-card:hover {
  transform: translateY(-8px);
  box-shadow:
    0 24px 48px rgba(7, 27, 59, 0.08),
    0 4px 12px rgba(17, 139, 201, 0.06);
  border-color: rgba(17, 139, 201, 0.15);
}

.commitment-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: rgba(17, 139, 201, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  color: var(--medical-blue);
  transition: all 0.4s var(--transition-smooth);
}

.commitment-card:hover .commitment-icon {
  background: rgba(17, 139, 201, 0.12);
  color: var(--medical-cyan);
}

/* ---------- Solutions Section ---------- */
.solution-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 24px;
  padding: 36px 32px;
  transition: all 0.5s var(--transition-smooth);
  cursor: pointer;
  will-change: transform;
}

.solution-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(28, 207, 213, 0.2);
  transform: translateY(-6px);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(28, 207, 213, 0.1) inset;
}

.solution-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(17, 139, 201, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(28, 207, 213, 0.15);
  transition: all 0.4s var(--transition-smooth);
}

.solution-card:hover .solution-icon {
  background: rgba(17, 139, 201, 0.2);
  border-color: rgba(28, 207, 213, 0.3);
}

/* ---------- Projects Section ---------- */
.project-card {
  background: var(--white);
  border: 1px solid rgba(7, 27, 59, 0.06);
  border-radius: 24px;
  overflow: hidden;
  transition: all 0.5s var(--transition-smooth);
  will-change: transform;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(7, 27, 59, 0.1);
  border-color: rgba(17, 139, 201, 0.15);
}

.project-image {
  width: 100%;
  overflow: hidden;
}

.project-image svg {
  transition: transform 0.6s var(--transition-smooth);
}

.project-card:hover .project-image svg {
  transform: scale(1.05);
}

.project-info {
  padding: 24px 28px;
}

/* ---------- Partners Section ---------- */
.partner-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s var(--transition-smooth);
  cursor: pointer;
}

.partner-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(28, 207, 213, 0.15);
  transform: translateY(-4px);
}

.partner-logo {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: grayscale(0.6) brightness(0.9);
  transition: all 0.4s var(--transition-smooth);
}

.partner-logo img {
  max-height: 36px;
  width: auto;
}

.partner-card:hover .partner-logo {
  filter: grayscale(0) brightness(1.1);
}

/* ---------- News Section ---------- */
.news-card {
  background: var(--white);
  border: 1px solid rgba(7, 27, 59, 0.06);
  border-radius: 24px;
  overflow: hidden;
  transition: all 0.5s var(--transition-smooth);
  will-change: transform;
}

.news-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(7, 27, 59, 0.1);
  border-color: rgba(17, 139, 201, 0.15);
}

.news-image {
  width: 100%;
  overflow: hidden;
}

.news-image svg {
  transition: transform 0.6s var(--transition-smooth);
}

.news-card:hover .news-image svg {
  transform: scale(1.05);
}

.news-content {
  padding: 24px;
}

.news-content span {
  display: block;
  margin-bottom: 2px;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Contact Form ---------- */
.form-input {
  width: 100%;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  color: var(--white);
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.3s var(--transition-smooth);
  outline: none;
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.form-input:focus {
  border-color: var(--medical-cyan);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(28, 207, 213, 0.1);
}

.form-input option {
  background: var(--navy-light);
  color: var(--white);
}

/* ---------- Reveal Animations ---------- */
.reveal {
  opacity: 0;
  will-change: transform, opacity;
}

.reveal[data-reveal="up"] {
  transform: translateY(60px);
}

.reveal[data-reveal="left"] {
  transform: translateX(-60px);
}

.reveal[data-reveal="right"] {
  transform: translateX(60px);
}

.reveal.revealed {
  opacity: 1;
  transform: translate(0, 0);
  transition: opacity 0.8s var(--transition-smooth),
              transform 0.8s var(--transition-smooth);
}

/* ---------- Mobile Navigation ---------- */
.mobile-nav-link {
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  font-weight: 600;
  padding: 12px 16px;
  border-radius: 12px;
  transition: all 0.3s var(--transition-smooth);
  display: block;
}

.mobile-nav-link:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
}

/* ============================================================ */
/*  RTL SUPPORT (Arabic)                                          */
/* ============================================================ */

html[dir="rtl"] {
  direction: rtl;
}

/* Reveal animation directions */
html[dir="rtl"] .reveal[data-reveal="left"] {
  transform: translateX(60px);
}

html[dir="rtl"] .reveal[data-reveal="right"] {
  transform: translateX(-60px);
}

html[dir="rtl"] .reveal.revealed {
  transform: translate(0, 0);
}

/* Flex row reversal */
html[dir="rtl"] .hero-row,
html[dir="rtl"] .about-row {
  flex-direction: column;
}

@media (min-width: 1024px) {
  html[dir="rtl"] .hero-row,
  html[dir="rtl"] .about-row {
    flex-direction: row-reverse;
  }
}

/* Text alignment */
html[dir="rtl"] .hero-content {
  text-align: right;
}

html[dir="rtl"] .hero-content .inline-flex {
  justify-content: flex-start;
}

html[dir="rtl"] .hero-content p,
html[dir="rtl"] .contact-section p {
  text-align: right;
}

/* Navbar adjustments */
html[dir="rtl"] #nav-links {
  flex-direction: row-reverse;
}

/* Mobile drawer from left */
html[dir="rtl"] #mobile-panel {
  right: auto;
  left: 0;
  border-left: none;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateX(-100%);
}

/* Button icons */
html[dir="rtl"] .btn-primary i,
html[dir="rtl"] .btn-secondary i {
  margin-left: 0;
  margin-right: 8px;
}

html[dir="rtl"] .btn-primary .ml-2,
html[dir="rtl"] .btn-secondary .ml-1 {
  margin-left: 0;
  margin-right: 0.5rem;
}

/* Stat separator lines on left */
html[dir="rtl"] .stat-item::after {
  right: auto;
  left: 0;
}

/* Hero decorative lines - mirror */
html[dir="rtl"] .hero-lines {
  left: auto;
  right: -4rem;
  transform: translateY(-50%) scaleX(-1);
}

/* Hero floating card position */
html[dir="rtl"] .glass-card-floating {
  right: auto;
  left: 8rem;
}

@media (min-width: 1024px) {
  html[dir="rtl"] .glass-card-floating {
    right: auto;
    left: 1rem;
  }
}

/* Project/news cards text alignment */
html[dir="rtl"] .project-info,
html[dir="rtl"] .news-content {
  text-align: right;
}

/* Contact info */
html[dir="rtl"] .contact-info-text {
  text-align: right;
}

/* Form inputs */
html[dir="rtl"] .form-input {
  text-align: right;
}

html[dir="rtl"] .form-input::placeholder {
  text-align: right;
}

/* Select dropdown */
html[dir="rtl"] select.form-input {
  background-position: left 12px center;
}

/* Footer text alignment */
html[dir="rtl"] footer {
  text-align: right;
}

html[dir="rtl"] footer .flex.items-center {
  justify-content: flex-start;
}

/* Arabic font adjustments */
html[dir="rtl"] body {
  font-family: 'Cairo', sans-serif;
  letter-spacing: 0;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3 {
  letter-spacing: -0.02em;
  line-height: 1.4;
}

html[dir="rtl"] .tracking-tight {
  letter-spacing: -0.02em;
}

html[dir="rtl"] .tracking-widest {
  letter-spacing: 0;
}

html[dir="rtl"] .uppercase {
  letter-spacing: 0;
}

/* Fix nav links */
html[dir="rtl"] .nav-link {
  letter-spacing: 0;
}

/* Fix solution cards */
html[dir="rtl"] .solution-card {
  text-align: right;
}

html[dir="rtl"] .solution-card .inline-flex {
  justify-content: flex-start;
}

/* Fix partner cards */
html[dir="rtl"] .partner-logo text {
  font-family: 'Manrope', sans-serif;
}

/* Fix scroll indicator position */
@media (min-width: 1024px) {
  html[dir="rtl"] .scroll-indicator {
    align-items: flex-end;
  }
}

html[dir="rtl"] .scroll-indicator {
  align-items: flex-start;
}

/* Icon spacing in RTL context */
html[dir="rtl"] i[data-lucide] {
  margin-left: 0;
  margin-right: 0;
}

/* ============================================================ */
/*  RESPONSIVE                                                   */
/* ============================================================ */

/* Tablet: 768px - 1024px */
@media (max-width: 1024px) {
  h1 {
    font-size: 60px !important;
  }

  .stats-container {
    grid-template-columns: repeat(3, 1fr);
  }

  .stat-item:nth-child(3)::after {
    display: none;
  }

  .commitment-card {
    padding: 24px 16px;
  }
}

/* Mobile: < 768px */
@media (max-width: 768px) {
  #navbar {
    width: calc(100% - 32px);
    padding: 0 20px;
    top: 12px;
    height: 60px;
  }

  h1 {
    font-size: 40px !important;
    line-height: 1.1 !important;
  }

  h2 {
    font-size: 32px !important;
    line-height: 1.15 !important;
  }

  .hero-content {
    text-align: center;
    align-items: center;
  }

  .hero-content .inline-flex {
    justify-content: center;
  }

  .hero-lines {
    display: none;
  }

  .glass-card-floating {
    display: none;
  }

  #stats-bar {
    margin-top: -60px;
  }

  .stats-container {
    grid-template-columns: repeat(2, 1fr);
    padding: 24px 20px;
  }

  .stat-item:nth-child(2)::after,
  .stat-item:nth-child(4)::after {
    display: none;
  }

  .commitment-card {
    padding: 20px 12px;
  }

  .solution-card {
    padding: 24px 20px;
  }

  .project-info {
    padding: 18px 20px;
  }

  .news-content {
    padding: 18px 20px;
  }

  .partner-card {
    padding: 20px;
  }

  section {
    padding-top: 64px;
    padding-bottom: 64px;
  }
}

/* Small Mobile: < 480px */
@media (max-width: 480px) {
  h1 {
    font-size: 32px !important;
  }

  h2 {
    font-size: 28px !important;
  }

  .stats-container {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .stat-number {
    font-size: 24px;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    justify-content: center;
  }
}
