/* ========================================
   INTERACTIVE CONTACT SECTION STYLING
   ======================================== */

.contact-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  padding: 60px 20px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

/* Position header container relative to place icons inside it */
#Contact .division { position: relative; }

/* ========================================
   FLOATING ICONS IN HEADER
   ======================================== */
.floating-elements {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.floating-icon {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
  font-size: 18px;
  animation: float 6s ease-in-out infinite;
}

/* Adjusted upward to align with the title */
.email-float { top: 55%; left: 95%; animation-delay: 0s; }
.github-float { top: 30%; right: 40%; animation-delay: 2s; }
.portfolio-float { bottom: -10%; left: -30%; animation-delay: 4s; }

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  25% { transform: translateY(-20px) rotate(5deg); }
  50% { transform: translateY(-10px) rotate(-3deg); }
  75% { transform: translateY(-15px) rotate(2deg); }
}

/* ========================================
   INTERACTIVE CONTACT GRID
   ======================================== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  width: 100%;
  max-width: 1100px;
}

@media (min-width: 1024px) {
  .contact-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.contact-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 40px 30px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  text-decoration: none;
  color: white;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  min-height: 280px;
  cursor: pointer;
}

/* ========================================
   ANIMATED BACKGROUNDS
   ======================================== */
.contact-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.contact-item:hover .contact-background { opacity: 1; }

.animated-bg { display: none; }

.email-bg { background: linear-gradient(45deg, transparent, rgba(59, 130, 246, 0.15), transparent); }
.github-bg { background: linear-gradient(45deg, transparent, rgba(34, 197, 94, 0.15), transparent); }
.portfolio-bg { background: linear-gradient(45deg, transparent, rgba(249, 115, 22, 0.15), transparent); }

@keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ========================================
   PARTICLE SYSTEMS
   ======================================== */
.particle-system { position: absolute; top: 0; left: 0; right: 0; bottom: 0; }

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #3b82f6;
  border-radius: 50%;
  animation: particleFloat 4s ease-in-out infinite;
}

.portfolio-card .particle { background: #f97316; }

.particle:nth-child(1) { top: 20%; left: 20%; animation-delay: 0s; }
.particle:nth-child(2) { top: 60%; right: 30%; animation-delay: 1s; }
.particle:nth-child(3) { bottom: 30%; left: 40%; animation-delay: 2s; }
.particle:nth-child(4) { top: 40%; right: 20%; animation-delay: 3s; }

@keyframes particleFloat { 0%, 100% { transform: translateY(0px) scale(1); opacity: 0.7; } 50% { transform: translateY(-30px) scale(1.2); opacity: 1; } }

/* ========================================
   CODE RAIN EFFECT (GitHub)
   ======================================== */
.code-rain { position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; }

.code-rain span {
  position: absolute;
  color: #22c55e;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  animation: codeRain 3s linear infinite;
}

.code-rain span:nth-child(1) { left: 10%; animation-delay: 0s; }
.code-rain span:nth-child(2) { left: 30%; animation-delay: 0.5s; }
.code-rain span:nth-child(3) { left: 50%; animation-delay: 1s; }
.code-rain span:nth-child(4) { left: 70%; animation-delay: 1.5s; }
.code-rain span:nth-child(5) { left: 90%; animation-delay: 2s; }

@keyframes codeRain { 0% { top: -20px; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { top: 100%; opacity: 0; } }

 

/* ========================================
   CONTACT ICONS WITH PULSE
   ======================================== */
.contact-icon {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
  font-size: 32px;
  transition: all 0.4s ease;
  z-index: 2;
}

.email-card .contact-icon { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.github-card .contact-icon { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.portfolio-card .contact-icon { background: rgba(249, 115, 22, 0.15); color: #f97316; }

.icon-pulse {
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse { 0% { transform: scale(0.8); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }

/* ========================================
   CONTACT TEXT WITH ACTIONS
   ======================================== */
.contact-text { display: flex; flex-direction: column; align-items: center; text-align: center; z-index: 2; }

.contact-label { font-size: 0.9rem; color: #8b5cf6; font-weight: 600; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
.email-card .contact-label { color: #3b82f6; }
.github-card .contact-label { color: #22c55e; }
.portfolio-card .contact-label { color: #f97316; }

.contact-link { font-size: 1.1rem; color: #ffffff; font-weight: 500; margin-bottom: 8px; }

.contact-action { font-size: 0.85rem; color: rgba(255, 255, 255, 0.7); opacity: 0; transform: translateY(10px); transition: all 0.3s ease; }
.contact-item:hover .contact-action { opacity: 1; transform: translateY(0); }

/* ========================================
   HOVER EFFECTS AND RIPPLES
   ======================================== */
.hover-effect { position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; border-radius: 20px; }

.ripple { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.1); transform: scale(0); animation: ripple 0.6s linear; pointer-events: none; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

.contact-item:hover { transform: translateY(-10px) scale(1.02); border-color: rgba(139, 92, 246, 0.4); background: rgba(255, 255, 255, 0.1); box-shadow: none; }
.email-card:hover { border-color: rgba(59, 130, 246, 0.4); box-shadow: none; }
.github-card:hover { border-color: rgba(34, 197, 94, 0.4); box-shadow: none; }
.portfolio-card:hover { border-color: rgba(249, 115, 22, 0.4); box-shadow: none; }

.contact-item:hover .contact-icon { transform: scale(1.1) rotate(5deg); }


/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
  .contact-container { padding: 40px 15px; gap: 30px; }
  .contact-grid { grid-template-columns: 1fr; gap: 20px; }
  .contact-item { padding: 30px 20px; min-height: 240px; }
  .contact-icon { width: 60px; height: 60px; font-size: 24px; }
  .floating-icon { width: 30px; height: 30px; font-size: 14px; }
}

@media (max-width: 480px) {
  .contact-item { padding: 25px 15px; min-height: 200px; }
  .contact-icon { width: 50px; height: 50px; font-size: 20px; }
  .floating-elements { display: none; }
}
