/* =======================
   ENHANCED CONNECTED ABOUT SECTION
   ======================= */

/* Enhanced counter area with background image - Compact design */
.counter_area {
  position: relative;
  z-index: 1;
  background: 
    linear-gradient(135deg, rgba(26, 35, 126, 0.9) 0%, rgba(67, 56, 202, 0.85) 25%, rgba(79, 70, 229, 0.8) 50%, rgba(99, 102, 241, 0.75) 75%, rgba(139, 92, 246, 0.7) 100%),
    url('assets/img/about/counter.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  overflow: hidden;
  padding: 80px 0 90px;
}

/* Animated particle background - override original ::before */
.counter_area::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(16, 185, 129, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 60% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 30% 80%, rgba(245, 158, 11, 0.08) 0%, transparent 50%) !important;
  animation: particleFloat 8s ease-in-out infinite;
  z-index: -1 !important;
}

@keyframes particleFloat {
  0%, 100% {
    transform: translate(0, 0);
    opacity: 0.6;
  }
  25% {
    transform: translate(20px, -15px);
    opacity: 0.8;
  }
  50% {
    transform: translate(-10px, -25px);
    opacity: 1;
  }
  75% {
    transform: translate(-25px, 10px);
    opacity: 0.7;
  }
}


/* Enhanced section title with stunning effects */
.counter_area .section_title .title {
  color: #ffffff;
  font-size: 3rem !important;
  font-weight: 900;
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
  text-shadow: 
    0 4px 20px rgba(139, 92, 246, 0.4),
    0 8px 40px rgba(99, 102, 241, 0.2),
    0 2px 4px rgba(0, 0, 0, 0.3);
  margin-bottom: 50px !important;
  position: relative;
  display: inline-block;
  background: linear-gradient(45deg, #ffffff 30%, #e0e7ff 50%, #c7d2fe 70%, #ffffff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleGlow 4s ease-in-out infinite;
}

.counter_area .section_title .title::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 6px;
  background: linear-gradient(45deg, #3b82f6, #10b981, #8b5cf6, #f59e0b, #ec4899);
  background-size: 300% 100%;
  border-radius: 20px;
  box-shadow: 
    0 4px 20px rgba(139, 92, 246, 0.4),
    0 0 40px rgba(59, 130, 246, 0.3);
  animation: titleUnderlineFlow 3s ease infinite;
}

@keyframes titleGlow {
  0%, 100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.2);
  }
}

@keyframes titleUnderlineFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Enhanced counter cards - Compact design */
.single_counter {
  background: 
    linear-gradient(145deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 100%);
  backdrop-filter: blur(25px) saturate(200%);
  -webkit-backdrop-filter: blur(25px) saturate(200%);
  border-radius: 20px;
  padding: 25px 20px !important;
  margin: 15px 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.15),
    0 4px 15px rgba(139, 92, 246, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.4);
  position: relative;
  overflow: hidden;
  height: 100%;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.single_counter::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(45deg, #3b82f6, #10b981, #8b5cf6, #f59e0b, #ec4899);
  background-size: 400% 100%;
  border-radius: 20px 20px 0 0;
  animation: gradientFlow 4s ease infinite;
  opacity: 0.8;
}

/* Beautiful shimmer effect on cards */
.single_counter::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 70%
  );
  animation: shimmer 6s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%) translateY(-100%);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateX(100%) translateY(100%);
    opacity: 0;
  }
}

@keyframes gradientFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.single_counter:hover {
  transform: translateY(-15px) scale(1.05);
  background: 
    linear-gradient(145deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.1) 100%);
  box-shadow: 
    0 30px 80px rgba(0, 0, 0, 0.25),
    0 10px 40px rgba(139, 92, 246, 0.2),
    0 5px 20px rgba(59, 130, 246, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Enhanced counter icons */
.counter_icon {
  margin-bottom: 25px;
  position: relative;
}

.counter_icon i {
  font-size: 60px !important;
  line-height: 60px;
  color: #ffffff;
  background: 
    linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.1) 100%);
  width: 100px;
  height: 100px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin: 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.4);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.2),
    0 3px 10px rgba(139, 92, 246, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  position: relative;
  z-index: 2;
}

.single_counter:hover .counter_icon i {
  background: 
    linear-gradient(135deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.2) 100%);
  border-color: rgba(255, 255, 255, 0.7);
  transform: scale(1.15);
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.3),
    0 10px 30px rgba(139, 92, 246, 0.2),
    0 5px 15px rgba(59, 130, 246, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Enhanced counter content */
.counter_content {
  margin-top: 30px !important;
}

.counter_content span {
  font-size: 4.5rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
  display: block;
  margin-bottom: 18px;
  text-shadow: 
    0 6px 30px rgba(255, 255, 255, 0.6),
    0 4px 20px rgba(139, 92, 246, 0.4),
    0 2px 10px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(255, 255, 255, 0.3);
  background: linear-gradient(45deg, #ffffff 0%, #f8fafc 20%, #e2e8f0 40%, #cbd5e1 60%, #ffffff 80%, #f1f5f9 100%);
  background-size: 400% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: enhancedNumberShine 4s ease-in-out infinite;
  transition: all 0.4s ease;
  position: relative;
  z-index: 2;
  filter: brightness(1.2) contrast(1.1);
}

@keyframes enhancedNumberShine {
  0%, 100% { 
    background-position: 0% 50%; 
    filter: brightness(1.2) contrast(1.1);
    text-shadow: 
      0 6px 30px rgba(255, 255, 255, 0.6),
      0 4px 20px rgba(139, 92, 246, 0.4),
      0 2px 10px rgba(0, 0, 0, 0.6),
      0 0 40px rgba(255, 255, 255, 0.3);
  }
  50% { 
    background-position: 100% 50%; 
    filter: brightness(1.4) contrast(1.2);
    text-shadow: 
      0 8px 40px rgba(255, 255, 255, 0.8),
      0 6px 30px rgba(139, 92, 246, 0.5),
      0 4px 15px rgba(0, 0, 0, 0.7),
      0 0 60px rgba(255, 255, 255, 0.5);
  }
}

.single_counter:hover .counter_content span {
  transform: scale(1.25);
  filter: brightness(1.5) contrast(1.3);
  text-shadow: 
    0 10px 50px rgba(255, 255, 255, 1),
    0 8px 40px rgba(139, 92, 246, 0.6),
    0 6px 20px rgba(0, 0, 0, 0.8),
    0 0 80px rgba(255, 255, 255, 0.7);
}

.counter_content p {
  color: rgba(255, 255, 255, 0.95) !important;
  font-size: 1.15rem;
  font-weight: 500;
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
  line-height: 1.7;
  text-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.3),
    0 1px 2px rgba(139, 92, 246, 0.2);
  margin: 0;
  padding: 0 15px;
  position: relative;
  z-index: 2;
}

/* Floating animation for counters */
.single_counter {
  animation: counterFloat 6s ease-in-out infinite;
}

.single_counter:nth-child(2) {
  animation-delay: -2s;
}

.single_counter:nth-child(3) {
  animation-delay: -4s;
}

.single_counter:nth-child(4) {
  animation-delay: -1s;
}

@keyframes counterFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

.single_counter:hover {
  animation-play-state: paused;
}

/* Enhanced responsive design */
@media (max-width: 991px) {
  .counter_area {
    background-attachment: scroll; /* Better performance on mobile */
  }
  
  .counter_area .section_title .title {
    font-size: 2rem !important;
    margin-bottom: 40px !important;
  }
  
  .single_counter {
    padding: 30px 15px !important;
    margin: 15px 5px;
  }
  
  .counter_icon i {
    font-size: 60px !important;
    width: 100px;
    height: 100px;
  }
  
  .counter_content span {
    font-size: 3.5rem !important;
  }
  
  .counter_content p {
    font-size: 1rem;
    padding: 0 5px;
  }
}

@media (max-width: 767px) {
  .counter_area {
    padding-top: 80px !important;
    padding-bottom: 80px !important;
  }
  
  .counter_area .section_title .title {
    font-size: 1.8rem !important;
    margin-bottom: 30px !important;
  }
  
  .single_counter {
    padding: 25px 15px !important;
    margin: 10px 0;
    border-radius: 15px;
  }
  
  .counter_icon i {
    font-size: 50px !important;
    width: 80px;
    height: 80px;
  }
  
  .counter_content span {
    font-size: 3rem !important;
    margin-bottom: 12px;
  }
  
  .counter_content p {
    font-size: 0.9rem;
    line-height: 1.5;
  }
  
  /* Adjust grid for mobile - 2 columns */
  .counter_area .row .col-6 {
    margin-bottom: 20px;
  }
}

@media (max-width: 576px) {
  .counter_area .section_title .title {
    font-size: 1.5rem !important;
  }
  
  .single_counter {
    padding: 20px 10px !important;
  }
  
  .counter_icon i {
    font-size: 40px !important;
    width: 70px;
    height: 70px;
  }
  
  .counter_content span {
    font-size: 2.5rem !important;
  }
  
  .counter_content p {
    font-size: 0.8rem;
  }
}

/* Enhanced Connection Nodes with Beautiful Effects */
.single_counter:not(:last-child):after {
  content: '';
  position: absolute;
  top: 50%;
  right: -12px;
  width: 24px;
  height: 24px;
  background: 
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 30%, transparent 70%),
    radial-gradient(circle, #3b82f6 0%, #10b981 50%, #8b5cf6 100%);
  border-radius: 50%;
  transform: translateY(-50%);
  box-shadow: 
    0 0 30px rgba(59, 130, 246, 0.8),
    0 0 60px rgba(16, 185, 129, 0.5),
    0 0 90px rgba(139, 92, 246, 0.3);
  animation: beautifulNodeGlow 3s ease-in-out infinite;
  z-index: 3;
  border: 2px solid rgba(255, 255, 255, 0.6);
}

@keyframes beautifulNodeGlow {
  0%, 100% {
    transform: translateY(-50%) scale(1);
    box-shadow: 
      0 0 30px rgba(59, 130, 246, 0.8),
      0 0 60px rgba(16, 185, 129, 0.5),
      0 0 90px rgba(139, 92, 246, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
  }
  50% {
    transform: translateY(-50%) scale(1.3);
    box-shadow: 
      0 0 40px rgba(59, 130, 246, 1),
      0 0 80px rgba(16, 185, 129, 0.7),
      0 0 120px rgba(139, 92, 246, 0.5);
    border-color: rgba(255, 255, 255, 0.9);
  }
}

/* Individual card network connections */
.row {
  position: relative;
}


/* Enhanced card gradients and shadows */
.single_counter {
  background: 
    linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%),
    radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

/* Hover gradient enhancement */
.single_counter:hover {
  background: 
    linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.1) 100%),
    radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.15) 0%, transparent 50%);
}

/* Loading animation for counters */
.single_counter {
  opacity: 0;
  animation: counterFadeIn 0.8s ease forwards, counterFloat 6s ease-in-out infinite;
}

.single_counter:nth-child(1) { animation-delay: 0.2s, 0s; }
.single_counter:nth-child(2) { animation-delay: 0.4s, -2s; }
.single_counter:nth-child(3) { animation-delay: 0.6s, -4s; }
.single_counter:nth-child(4) { animation-delay: 0.8s, -1s; }

@keyframes counterFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .single_counter::after {
    width: 15px;
    height: 15px;
    right: -7px;
  }
}

/* Enhanced Connection Grid */
.counter_area .container {
  position: relative;
  z-index: 2;
}

/* Dynamic gradient backgrounds */
.single_counter:nth-child(1) {
  background: 
    linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%),
    radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
}

.single_counter:nth-child(2) {
  background: 
    linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%),
    radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
}

.single_counter:nth-child(3) {
  background: 
    linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%),
    radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
}

.single_counter:nth-child(4) {
  background: 
    linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%),
    radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.08) 0%, transparent 70%);
}
