/* =====================================================
   MedSina — Enhanced Features Section
   Scroll-reveal + hover animations + visual polish
   ===================================================== */

/* ---------- Keyframes ---------- */
@keyframes ms-dot-pulse {
  0%,100%{box-shadow:0 0 0 0 rgba(37,99,235,.35)}
  50%{box-shadow:0 0 0 7px rgba(37,99,235,0)}
}
@keyframes ms-shimmer-sweep {
  0%{left:-80%}
  100%{left:160%}
}
@keyframes ms-gradient-shift {
  0%{background-position:0% 50%}
  50%{background-position:100% 50%}
  100%{background-position:0% 50%}
}
@keyframes ms-blob-drift {
  0%,100%{transform:translate(0,0) scale(1)}
  33%{transform:translate(20px,-15px) scale(1.05)}
  66%{transform:translate(-10px,10px) scale(.97)}
}

/* ---------- Section background & blobs ---------- */
.features {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #f8fafc 0%, #f0f9ff 50%, #f0fdfa 100%);
  padding: 110px 0;
}

.features::before,
.features::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(70px);
  animation: ms-blob-drift 12s ease-in-out infinite;
}
.features::before {
  width: 520px; height: 520px;
  top: -160px; left: -120px;
  background: radial-gradient(circle, rgba(37,99,235,.09) 0%, transparent 70%);
  animation-duration: 14s;
}
.features::after {
  width: 400px; height: 400px;
  bottom: -100px; right: -80px;
  background: radial-gradient(circle, rgba(13,148,136,.09) 0%, transparent 70%);
  animation-duration: 10s;
  animation-delay: -5s;
}

/* ---------- Section label ---------- */
.features .section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdfa 100%);
  border: 1px solid rgba(37,99,235,.18);
  border-radius: 100px;
  padding: 6px 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #2563eb;
  margin-bottom: 20px;
}
.features .section-label::before {
  content: '';
  width: 7px; height: 7px;
  background: linear-gradient(135deg, #2563eb, #0d9488);
  border-radius: 50%;
  display: inline-block;
  animation: ms-dot-pulse 2.2s ease-in-out infinite;
}

/* ---------- Section title & subtitle ---------- */
.features .section-title {
  line-height: 1.18;
  margin-bottom: 14px;
}
.features .section-subtitle {
  max-width: 520px;
  margin-bottom: 52px;
  color: #64748b;
  font-size: 16px;
  line-height: 1.7;
}

/* ---------- Grid ---------- */
.features-grid {
  position: relative;
  z-index: 1;
  gap: 22px;
}

/* ---------- Cards base ---------- */
.feature-card {
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226,232,240,.9);
  border-radius: 22px;
  padding: 38px;
  transition: transform .35s cubic-bezier(.25,.46,.45,.94),
              box-shadow .35s cubic-bezier(.25,.46,.45,.94),
              border-color .35s ease;
  will-change: transform, box-shadow;
}

/* Sheen sweep on hover */
.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: -80%;
  width: 50%; height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,.55) 50%,
    transparent 100%
  );
  pointer-events: none;
  transition: none;
}
.feature-card:hover::before {
  animation: ms-shimmer-sweep .6s ease forwards;
}

/* Top accent bar for main cards */
.feature-main::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2563eb 0%, #06b6d4 50%, #0d9488 100%);
  background-size: 200% 100%;
  border-radius: 22px 22px 0 0;
  opacity: 0;
  transition: opacity .3s ease;
}
.feature-main:hover::after {
  opacity: 1;
  animation: ms-gradient-shift 3s ease infinite;
}

/* Hover lift */
.feature-card:hover {
  transform: translateY(-8px) scale(1.015);
  box-shadow:
    0 28px 72px rgba(15,23,42,.13),
    0 6px 20px rgba(37,99,235,.08),
    inset 0 1px 0 rgba(255,255,255,.8);
  border-color: rgba(37,99,235,.18);
}

/* ---------- Icon wraps ---------- */
.feature-icon-wrap {
  border-radius: 18px;
  width: 66px; height: 66px;
  margin-bottom: 26px;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), box-shadow .3s ease;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.feature-card:hover .feature-icon-wrap {
  transform: scale(1.12) rotate(-4deg);
}

/* Refined icon colours */
.icon-blue   { background: linear-gradient(140deg,#eff6ff,#dbeafe); color:#2563eb; box-shadow: 0 4px 14px rgba(37,99,235,.15); }
.icon-teal   { background: linear-gradient(140deg,#f0fdfa,#ccfbf1); color:#0d9488; box-shadow: 0 4px 14px rgba(13,148,136,.15); }
.icon-purple { background: linear-gradient(140deg,#f5f3ff,#ede9fe); color:#7c3aed; box-shadow: 0 4px 14px rgba(124,58,237,.15); }
.icon-orange { background: linear-gradient(140deg,#fff7ed,#ffedd5); color:#ea580c; box-shadow: 0 4px 14px rgba(234,88,12,.15); }
.icon-green  { background: linear-gradient(140deg,#f0fdf4,#dcfce7); color:#16a34a; box-shadow: 0 4px 14px rgba(22,163,74,.15); }

.feature-card:hover .icon-blue   { box-shadow: 0 8px 24px rgba(37,99,235,.3); }
.feature-card:hover .icon-teal   { box-shadow: 0 8px 24px rgba(13,148,136,.3); }
.feature-card:hover .icon-purple { box-shadow: 0 8px 24px rgba(124,58,237,.3); }
.feature-card:hover .icon-orange { box-shadow: 0 8px 24px rgba(234,88,12,.3); }
.feature-card:hover .icon-green  { box-shadow: 0 8px 24px rgba(22,163,74,.3); }

/* ---------- Feature card title ---------- */
.feature-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #0f172a;
  transition: color .2s;
}
.feature-card:hover h3 { color: #1e40af; }

/* ---------- Feature list ---------- */
.feature-list { margin-top: 4px; }
.feature-list li {
  color: #475569;
  font-size: 14px;
  padding: 5px 0;
  gap: 10px;
  transition: color .2s, transform .2s;
  cursor: default;
}
.feature-list li:hover {
  color: #0f172a;
  transform: translateX(5px);
}
.feature-list li::before {
  content: '';
  width: 7px; height: 7px;
  background: linear-gradient(135deg, #2563eb, #0d9488);
  border-radius: 50%;
  flex-shrink: 0;
  transition: transform .2s, box-shadow .2s;
}
.feature-list li:hover::before {
  transform: scale(1.4);
  box-shadow: 0 0 8px rgba(37,99,235,.5);
}

/* ---------- Scroll-reveal classes ---------- */
.ms-hidden {
  opacity: 0;
  transform: translateY(28px);
}
.ms-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
  transition: opacity .65s cubic-bezier(.4,0,.2,1),
              transform .65s cubic-bezier(.4,0,.2,1);
}
.ms-hidden-left {
  opacity: 0;
  transform: translateX(-20px);
}
.ms-visible-left {
  opacity: 1 !important;
  transform: translateX(0) !important;
  transition: opacity .55s cubic-bezier(.4,0,.2,1),
              transform .55s cubic-bezier(.4,0,.2,1);
}

/* Delay helpers */
.ms-d1  { transition-delay: .05s !important; }
.ms-d2  { transition-delay: .12s !important; }
.ms-d3  { transition-delay: .19s !important; }
.ms-d4  { transition-delay: .26s !important; }
.ms-d5  { transition-delay: .33s !important; }
.ms-d6  { transition-delay: .40s !important; }
.ms-d7  { transition-delay: .47s !important; }

