/* Palette lock: black / white / blue */
.kima-pillars-feature {
  --kima-blue: #0061ff;
  --kima-cyan: #00d4ff;
  --kima-black: #0b1220;
  --kima-white: #ffffff;
  --kima-gold: #D1B59C;
  background: 
    linear-gradient(135deg, rgba(15, 39, 71, 0.85) 0%, rgba(26, 58, 92, 0.85) 50%, rgba(15, 39, 71, 0.85) 100%),
    url('../images/bg/pillars-section-bg.png') center center / cover;
  position: relative;
  overflow: hidden;
}

/* Abstract Pillar Silhouettes Background */
.kima-pillars-feature::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(to bottom, transparent 0%, transparent 20%, rgba(255,255,255,0.03) 20%, rgba(255,255,255,0.03) 80%, transparent 80%),
    repeating-linear-gradient(90deg, rgba(0, 97, 255, 0.04) 0px, transparent 2px, transparent 100px);
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;
}

.kima-pillars-feature .container {
  position: relative;
  z-index: 1;
}

.kima-pillars-feature .feature-item {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  
  /* Prevent flash on load */
  opacity: 0;
  
  /* Simplified Pillar Effect */
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  
  /* Beveled Edges */
  clip-path: polygon(
    8px 0, calc(100% - 8px) 0,
    100% 8px, 100% calc(100% - 8px),
    calc(100% - 8px) 100%, 8px 100%,
    0 calc(100% - 8px), 0 8px
  );
  
  /* Animated Gradient Border */
  border: 2px solid transparent;
  background-clip: padding-box;
  
  /* Simplified Transform for Performance */
  transform: translateY(0);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
  
  /* Enhanced Shadow for Depth */
  box-shadow: 
    0 14px 34px rgba(0, 0, 0, 0.25),
    0 4px 12px rgba(0, 97, 255, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Animated Gradient Border Effect */
.kima-pillars-feature .feature-item::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(
    135deg,
    var(--kima-blue) 0%,
    var(--kima-cyan) 50%,
    var(--kima-gold) 100%
  );
  background-size: 200% 200%;
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.5s ease;
  clip-path: polygon(
    8px 0, calc(100% - 8px) 0,
    100% 8px, 100% calc(100% - 8px),
    calc(100% - 8px) 100%, 8px 100%,
    0 calc(100% - 8px), 0 8px
  );
  animation: borderShift 4s linear infinite;
  animation-play-state: paused;
}

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

/* Large Number Badge */
.kima-pillars-feature .feature-item::after {
  content: attr(data-pillar-number);
  position: absolute;
  top: -10px;
  right: 20px;
  font-size: 120px;
  font-weight: 900;
  line-height: 1;
  color: rgba(0, 97, 255, 0.08);
  z-index: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* RTL positioning for pillar numbers */
[dir="rtl"] .kima-pillars-feature .feature-item::after {
  right: auto;
  left: 20px;
}

/* Hover State - Simplified */
.kima-pillars-feature .feature-item:hover {
  transform: translateY(-12px);
  box-shadow: 
    0 24px 60px rgba(0, 0, 0, 0.35),
    0 8px 24px rgba(0, 97, 255, 0.4),
    0 0 40px rgba(0, 212, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

.kima-pillars-feature .feature-item:hover::before {
  opacity: 1;
  animation-play-state: running;
}

.kima-pillars-feature .feature-item:hover::after {
  color: rgba(0, 97, 255, 0.15);
  transform: scale(1.05) translateY(-5px);
}

/* Staggered Construction Animation - Optimized */
@keyframes pillarConstruct {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.kima-pillars-feature .feature-item.pillar-animate {
  animation: pillarConstruct 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.kima-pillars-feature .feature-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  padding: 2rem;
}

.kima-pillars-feature .feature-content .desc {
  flex: 1;
}

.kima-pillars-feature .feature-content .title {
  color: var(--kima-black);
  font-weight: 700;
  margin-bottom: 1rem;
  transition: color 0.3s ease;
}

.kima-pillars-feature .feature-item:hover .feature-content .title {
  color: var(--kima-blue);
}

.kima-pillars-feature .feature-content .desc p {
  color: rgba(11, 18, 32, 0.75);
  line-height: 1.6;
}

.kima-pillars-feature .kima-pillar-cta {
  margin-top: auto;
  padding-top: 1.25rem;
}

.kima-pillars-feature .feature-item.style-4 .feature-icon {
  display: none !important;
}

/* Enhanced Icon */
.kima-pillars-feature .kima-card-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 97, 255, 0.15), rgba(0, 212, 255, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  flex-shrink: 0;
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 97, 255, 0.2);
}

.kima-pillars-feature .kima-card-icon::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--kima-cyan), var(--kima-blue));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.kima-pillars-feature .feature-item:hover .kima-card-icon {
  transform: scale(1.1);
  box-shadow: 0 8px 24px rgba(0, 97, 255, 0.4), 0 0 30px rgba(0, 212, 255, 0.3);
}

.kima-pillars-feature .feature-item:hover .kima-card-icon::before {
  opacity: 1;
}

.kima-pillars-feature .kima-card-icon i {
  font-size: 2rem;
  color: var(--kima-blue);
  line-height: 1;
  display: inline-block;
  transition: all 0.4s ease;
}

.kima-pillars-feature .feature-item:hover .kima-card-icon i {
  color: var(--kima-cyan);
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
}

/* Section heading styles */
.kima-pillars-feature .sec-heading .sec-title {
  color: #ffffff;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.kima-pillars-feature .sec-heading .desc p {
  color: rgba(255, 255, 255, 0.9);
}

/* CTA Button Enhancement */
.kima-pillars-feature .blog-btn-2 {
  transition: all 0.3s ease;
}

.kima-pillars-feature .feature-item:hover .blog-btn-2 {
  color: var(--kima-blue);
}

.kima-pillars-feature .feature-item:hover .blog-btn-2 .btn-icon {
  transform: translateX(5px);
}

/* Responsive Adjustments */
@media (max-width: 991px) {
  .kima-pillars-feature .feature-item::after {
    font-size: 80px;
    top: -5px;
    right: 15px;
  }
  
  [dir="rtl"] .kima-pillars-feature .feature-item::after {
    right: auto;
    left: 15px;
  }
}

@media (max-width: 575px) {
  .kima-pillars-feature .feature-item {
    margin-bottom: 1.5rem;
  }
  
  .kima-pillars-feature .feature-item::after {
    font-size: 60px;
    top: 0;
    right: 10px;
  }
  
  [dir="rtl"] .kima-pillars-feature .feature-item::after {
    right: auto;
    left: 10px;
  }
}

.kima-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  overflow-y: auto;
}

.kima-modal-overlay.is-open {
  display: flex;
}

.kima-modal {
  background: #fff;
  border-radius: 12px;
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.kima-modal-header {
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kima-modal-header h3 {
  margin: 0;
  font-size: 1.35rem;
  color: #1A1A1A;
}

.kima-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  padding: 0 0.25rem;
  line-height: 1;
}

.kima-modal-close:hover {
  color: #1A1A1A;
}

.kima-modal-body {
  padding: 1.75rem;
  color: #444;
  line-height: 1.7;
}

.kima-modal-body h4 {
  color: #1A1A1A;
  margin: 1rem 0 0.5rem;
  font-size: 1rem;
}

.kima-modal-body ul {
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
}

.kima-modal-body p {
  margin: 0 0 0.75rem;
}
