/* === Connect Section General Styling === */
#connect {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem 1rem 6rem;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(74, 222, 128, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, rgba(34, 197, 94, 0.06) 0%, transparent 60%),
    #f8fafc;
}

/* Animated gradient blob */
#connect::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 800px;
  height: 800px;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    circle,
    rgba(74, 222, 128, 0.2) 0%,
    rgba(34, 197, 94, 0.08) 40%,
    transparent 70%
  );
  filter: blur(80px);
  z-index: 0;
  animation: blobPulse 10s ease-in-out infinite alternate;
}

@keyframes blobPulse {
  0% {
    transform: translate(-55%, -45%) scale(0.9);
    opacity: 0.6;
  }
  100% {
    transform: translate(-45%, -55%) scale(1.1);
    opacity: 1;
  }
}

/* Subtle dot grid overlay */
#connect::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(22, 163, 74, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  z-index: 0;
  pointer-events: none;
}

.connect-container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
  width: 100%;
  max-width: 1100px;
}

@media (min-width: 992px) {
  .connect-container {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

/* === Connect Chips Grid === */
.connect-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.connect-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.75rem;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.04),
    0 2px 4px -2px rgba(0, 0, 0, 0.03);
  text-decoration: none;
  color: #374151;
  font-weight: 600;
  font-size: 0.95rem;
  transition:
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.25s ease,
    background-color 0.25s ease,
    border-color 0.25s ease;
  white-space: nowrap;
  position: relative;
}

.connect-chip .chip-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.connect-chip:hover:not(.main-connect) {
  transform: translateY(-4px) scale(1.02);
  box-shadow:
    0 12px 24px -8px rgba(0, 0, 0, 0.1),
    0 4px 8px -4px rgba(0, 0, 0, 0.05);
  background-color: rgba(255, 255, 255, 0.95);
  border-color: rgba(148, 163, 184, 0.4);
}

/* Staggered layout */
.connect-chip:nth-child(1) {
  align-self: flex-start;
  margin-left: 1rem;
}
.connect-chip:nth-child(2) {
  align-self: flex-start;
  margin-left: 2.5rem;
}
.connect-chip.main-connect {
  align-self: center;
}
.connect-chip:nth-child(4) {
  align-self: flex-end;
  margin-right: 2.5rem;
}
.connect-chip:nth-child(5) {
  align-self: flex-end;
  margin-right: 1rem;
}

/* Main "Connect me" chip */
.connect-chip.main-connect {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: white;
  border: none;
  padding: 1rem 2.25rem;
  font-size: 1.05rem;
  gap: 0.6rem;
  box-shadow:
    0 8px 24px -6px rgba(34, 197, 94, 0.35),
    0 4px 8px -4px rgba(34, 197, 94, 0.2);
}

.connect-chip.main-connect:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow:
    0 16px 32px -8px rgba(34, 197, 94, 0.4),
    0 6px 12px -6px rgba(34, 197, 94, 0.25);
}

.connect-chip.main-connect .chip-icon {
  width: 20px;
  height: 20px;
}

/* === Contact Form === */
.contact-form {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.6);
  box-shadow:
    0 20px 40px -12px rgba(0, 0, 0, 0.08),
    0 8px 16px -6px rgba(0, 0, 0, 0.04);
  padding: 2.25rem;
  border-radius: 1.75rem;
  width: 100%;
  max-width: 460px;
  justify-self: center;
  transition: box-shadow 0.3s ease;
}

.contact-form:hover {
  box-shadow:
    0 24px 48px -14px rgba(0, 0, 0, 0.12),
    0 8px 16px -6px rgba(0, 0, 0, 0.06);
}

.contact-form h2 {
  color: #1f2937;
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
  letter-spacing: -0.02em;
}

/* Decorative heading underline */
.contact-form h2::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, #16a34a, #4ade80);
  border-radius: 999px;
  margin: 0.75rem auto 0;
}

/* === Input Groups === */
.input-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.input-group input,
.input-group textarea {
  width: 100%;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1rem 1.125rem;
  color: #1f2937;
  font-size: 0.95rem;
  outline: none;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.input-group textarea {
  resize: vertical;
  min-height: 110px;
}

.input-group input:focus,
.input-group textarea:focus {
  border-color: #22c55e;
  box-shadow:
    0 0 0 4px rgba(34, 197, 94, 0.12),
    inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

/* Floating labels */
.input-group label {
  position: absolute;
  top: 1rem;
  left: 1.125rem;
  color: #94a3b8;
  background: transparent;
  padding: 0 0.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label,
.input-group textarea:focus + label,
.input-group textarea:not(:placeholder-shown) + label {
  top: -0.55rem;
  left: 0.85rem;
  font-size: 0.75rem;
  color: #16a34a;
  background: #ffffff;
  padding: 0 0.4rem;
  font-weight: 600;
}

/* === Image Previews === */
#image-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  min-height: 0;
}

.preview-image {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 0.75rem;
  border: 2px solid #e2e8f0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease;
}

.preview-image:hover {
  transform: scale(1.08);
}

/* === Form Actions Row === */
.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.btn-attach,
.btn-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.85rem 1.25rem;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  transition:
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.btn-attach {
  flex: 1;
  background: #f1f5f9;
  color: #475569;
  border: 1.5px solid #e2e8f0;
}

.btn-attach:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.12);
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.btn-attach:active {
  transform: translateY(0);
}

.btn-send {
  flex: 1;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: white;
  box-shadow: 0 4px 14px -4px rgba(34, 197, 94, 0.35);
}

.btn-send:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -6px rgba(34, 197, 94, 0.4);
}

.btn-send:active {
  transform: translateY(0);
}

/* === Responsive === */
@media (max-width: 991px) {
  .connect-grid {
    order: 1;
  }
  .contact-form {
    order: 2;
  }
}

@media (max-width: 640px) {
  #connect {
    padding: 4rem 1rem;
  }

  .contact-form {
    padding: 1.5rem;
    border-radius: 1.25rem;
  }

  /* Convert staggered column to single icon row */
  .connect-grid {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 0.75rem;
  }

  .connect-chip {
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    align-self: center !important;
    margin: 0 !important;
  }

  .connect-chip span {
    display: none;
  }

  .connect-chip .chip-icon {
    width: 24px;
    height: 24px;
  }

  .connect-chip.main-connect {
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
  }

  .connect-chip.main-connect .chip-icon {
    width: 22px;
    height: 22px;
  }

  .form-actions {
    flex-direction: column;
  }
}
