/* ==========================================
   Working Mechanism Subelement Styling
   Premium Futuristic Tech Theme
   ========================================== */

.working-mechanism-section {
  position: relative;
  background: #ffffff; /* Keep light theme with tech decorations */
  overflow: hidden;
  z-index: 1;
}

/* Background Grid Pattern */
.mechanism-bg-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(rgba(2, 45, 98, 0.03) 1px, transparent 1px),
    radial-gradient(rgba(2, 45, 98, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: 0 0, 20px 20px;
  pointer-events: none;
  z-index: -2;
}

/* Glowing Aura Orbs */
.mechanism-glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  opacity: 0.25;
  z-index: -1;
}

.glow-cyan {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.15) 0%, rgba(255, 255, 255, 0) 70%);
  right: -50px;
  top: 10%;
}

.glow-blue {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(2, 45, 98, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
  left: -100px;
  bottom: 10%;
}

/* Header line decorations */
.mech-deco-top,
.mech-deco-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 15px auto;
  max-width: 350px;
}

.mech-deco-top .line-left,
.mech-deco-top .line-right,
.mech-deco-bottom .line-left,
.mech-deco-bottom .line-right {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(2, 45, 98, 0) 0%, rgba(2, 45, 98, 0.15) 50%, rgba(2, 45, 98, 0) 100%);
}

.mech-deco-top .caret-down {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #00c6ff; /* Cyan tech color */
}

.mech-deco-bottom .diamond-node {
  width: 6px;
  height: 6px;
  background: #022d62;
  transform: rotate(45deg);
  border: 1px solid #00c6ff;
  box-shadow: 0 0 6px #00c6ff;
}

.mech-section-title {
  color: #022d62;
  font-weight: 800;
  font-size: 36px;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
  text-align: center;
}

.mech-section-desc {
  font-size: 15px;
  line-height: 1.6;
  color: #5a6e85;
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}

/* ── Card Deck Row ── */
.card-deck-row {
  margin-top: 50px;
}

/* ── Futuristic Card ── */
.mechanism-card {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 35px rgba(2, 45, 98, 0.04);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(2, 45, 98, 0.05);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.mechanism-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 45px rgba(0, 198, 255, 0.12);
  border-color: rgba(0, 198, 255, 0.2);
}

/* Image wrapper styling */
.mechanism-card-image {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.mechanism-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.mechanism-card:hover .mechanism-card-image img {
  transform: scale(1.06);
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(2, 45, 98, 0) 40%, rgba(2, 45, 98, 0.4) 100%);
}

/* Floating Icon Badge */
.mechanism-icon-badge {
  position: absolute;
  top: 190px; /* Overlaps bottom of image (220px) */
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 64px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(2, 45, 98, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border: 3px solid #ffffff;
  transition: all 0.3s ease;
  color: #022d62;
}

.mechanism-card:hover .mechanism-icon-badge {
  border-color: #00c6ff;
  box-shadow: 0 0 15px rgba(0, 198, 255, 0.4);
  color: #ef3139;
}

.mechanism-icon-badge svg {
  transition: all 0.3s ease;
}

.mechanism-card:hover .mechanism-icon-badge svg {
  transform: scale(1.1);
}

/* Card Content Details */
.mechanism-card-content {
  padding: 44px 28px 28px;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.mechanism-card-title {
  font-size: 19px;
  font-weight: 700;
  color: #022d62;
  margin-bottom: 8px;
  transition: color 0.3s ease;
}

.mechanism-card:hover .mechanism-card-title {
  color: #00c6ff;
}

.title-underline {
  width: 32px;
  height: 2px;
  background: #ef3139;
  margin: 10px auto 16px;
  transition: width 0.3s ease;
}

.mechanism-card:hover .title-underline {
  width: 48px;
  background: #00c6ff;
}

.mechanism-card-desc {
  font-size: 13.5px;
  color: #5a6e85;
  line-height: 1.6;
  margin: 0;
}

/* Decorative Dot Grids */
.card-dots-left,
.card-dots-right {
  position: absolute;
  width: 8px;
  height: 24px;
  background-image: radial-gradient(rgba(2, 45, 98, 0.25) 1.5px, transparent 1.5px);
  background-size: 4px 6px;
  top: 240px;
  opacity: 0.5;
  z-index: 5;
}

.card-dots-left {
  left: 12px;
}

.card-dots-right {
  right: 12px;
}

/* Top Glow Tab */
.border-glow-top {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #00c6ff, transparent);
  transition: width 0.4s ease;
}

.mechanism-card:hover .border-glow-top {
  width: 140px;
}

/* Bottom Glow Tab / Shape */
.border-glow-bottom {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: #00c6ff;
  border-radius: 4px 4px 0 0;
  transition: width 0.4s ease, box-shadow 0.4s ease;
}

.mechanism-card:hover .border-glow-bottom {
  width: 100px;
  box-shadow: 0 -2px 10px rgba(0, 198, 255, 0.8);
}

/* ── Mobile Layout Optimization ── */
@media (max-width: 991.98px) {
  .mech-section-title {
    font-size: 28px;
  }
  .mech-section-desc {
    font-size: 13.5px;
  }
  .mechanism-card-image {
    height: 180px;
  }
  .mechanism-icon-badge {
    top: 150px;
  }
}

@media (max-width: 575.98px) {
  .working-mechanism-section {
    padding: 40px 0;
  }
  .mech-section-title {
    font-size: 24px;
  }
  .mechanism-card-content {
    padding: 38px 18px 20px;
  }
}
