/* ========================================
   Contact Me Section - Space Theme Design
   ======================================== */

.section-contact {
  min-height: 100vh;
  padding: 4rem 2rem 10rem;
  position: relative;
  overflow-x: hidden;
  overflow-y: visible;
  /* Deep space gradient background - darker than Rabbit Hole for visual distinction */
  background: linear-gradient(135deg, #0a0d1a 0%, #1a1528 50%, #0d0f1a 100%);
}

/* Animated starfield background mesh */
.section-contact::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(at 10% 20%, rgba(119, 191, 226, 0.15) 0px, transparent 50%),
    radial-gradient(at 90% 30%, rgba(139, 127, 214, 0.12) 0px, transparent 50%),
    radial-gradient(at 30% 70%, rgba(2, 165, 255, 0.1) 0px, transparent 50%),
    radial-gradient(at 80% 80%, rgba(78, 205, 196, 0.08) 0px, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

@keyframes cosmicDrift {
  0%,
  100% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  50% {
    opacity: 0.85;
    transform: translate(30px, -30px) scale(1.05);
  }
}

/* Particle canvas container */
.contact-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

/* ========================================
   Celestial Objects (Decorative Planets/Asteroids)
   ======================================== */

.celestial-objects {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

/* Large Jupiter-Style Planet (Bottom-Left) */
.planet-jupiter {
  position: absolute;
  top: 52%;
  left: 2%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  z-index: 0;
  /* Jupiter-like banded gradient */
  background: radial-gradient(ellipse at 30% 35%, rgba(255, 200, 150, 0.4) 0%, transparent 25%),
    linear-gradient(
      180deg,
      #d4915e 0%,
      #c98850 8%,
      #e8d4b8 15%,
      #d4915e 22%,
      #8b6f47 30%,
      #c98850 38%,
      #e8d4b8 45%,
      #d4915e 52%,
      #8b6f47 60%,
      #c98850 68%,
      #d4915e 75%,
      #e8d4b8 82%,
      #c98850 90%,
      #8b6f47 100%
    );
  /* Glow effect */
  box-shadow: 0 0 80px rgba(212, 145, 94, 0.4), 0 0 150px rgba(212, 145, 94, 0.2),
    inset 0 0 60px rgba(0, 0, 0, 0.3);
  animation: floatPlanet 10s ease-in-out infinite;
}

/* Great Red Spot on Jupiter */
.planet-jupiter::before {
  content: '';
  position: absolute;
  top: 45%;
  left: 25%;
  width: 120px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(180, 70, 50, 0.8) 0%,
    rgba(200, 90, 70, 0.6) 40%,
    transparent 70%
  );
}

/* Small Moon (Top-Right) */
.moon-1 {
  position: absolute;
  top: 15%;
  right: 18%;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 30%,
    #e8e8e8 0%,
    #c0c0c0 30%,
    #a0a0a0 60%,
    #808080 100%
  );
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2), inset -10px -10px 30px rgba(0, 0, 0, 0.4),
    inset 5px 5px 20px rgba(255, 255, 255, 0.3);
  animation: floatMoon 5s ease-in-out infinite;
  z-index: 3;
}

/* Crater effects on moon */
.moon-1::before {
  content: '';
  position: absolute;
  top: 40%;
  left: 50%;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  box-shadow: -20px -10px 0 5px rgba(0, 0, 0, 0.15), 10px 15px 0 3px rgba(0, 0, 0, 0.1),
    -5px 20px 0 2px rgba(0, 0, 0, 0.12);
}

/* Asteroid 1 (Mid-Right) */
.asteroid-1 {
  position: absolute;
  top: 50%;
  right: 12%;
  width: 60px;
  height: 60px;
  border-radius: 45% 55% 50% 50%;
  background: linear-gradient(135deg, #6b5b4f 0%, #8b7355 30%, #5a4a3a 60%, #4a3a2a 100%);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5), inset -8px -8px 20px rgba(0, 0, 0, 0.6),
    inset 5px 5px 15px rgba(139, 115, 85, 0.4);
  animation: tumbleAsteroid 12s linear infinite, floatMoon 6s ease-in-out infinite;
  z-index: 3;
}

/* Distant Purple Planet (Upper-Right) */
.planet-distant {
  position: absolute;
  top: 8%;
  right: 35%;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 30%,
    #b39bda 0%,
    #8b7fd6 40%,
    #6b5fcf 70%,
    #4b3f9f 100%
  );
  box-shadow: 0 0 40px rgba(139, 127, 214, 0.3), 0 0 80px rgba(139, 127, 214, 0.15),
    inset -15px -15px 40px rgba(0, 0, 0, 0.4);
  animation: orbitSlow 20s ease-in-out infinite;
  z-index: 2;
}

/* Small Asteroid 2 (Bottom-Right) */
.asteroid-2 {
  position: absolute;
  bottom: 25%;
  right: 8%;
  width: 40px;
  height: 40px;
  border-radius: 40% 60% 55% 45%;
  background: linear-gradient(225deg, #7a6a5a 0%, #5a4a3a 50%, #3a2a1a 100%);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.4), inset -5px -5px 15px rgba(0, 0, 0, 0.7);
  animation: tumbleAsteroid 8s linear infinite reverse, floatMoon 4s ease-in-out infinite;
  z-index: 3;
}

/* Section Container */
.section-contact .section-container {
  max-width: 1400px;
  padding-bottom: 8rem;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Section Title */
.section-contact .section-title {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: var(--font-size-7xl);
  color: var(--color-white);
  text-align: center;
  margin-bottom: 3rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  position: relative;
  z-index: 10;
  text-shadow: 0 4px 30px rgba(119, 191, 226, 0.4);
}

/* Section Subtitle */
.section-contact .section-subtitle {
  font-family: var(--font-primary);
  font-style: italic;
  font-weight: 400;
  font-size: var(--font-size-xl);
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  margin-bottom: 3rem;
}

/* ========================================
   Contact Hero Section (Title + Subtitle + Image)
   ======================================== */

.contact-hero {
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  padding-bottom: 1rem;
}

/* ========================================
   Contact Form Section (Below Hero)
   ======================================== */

.contact-form-section {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem 0 0;
  position: relative;
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   Image Container (Hero Section)
   ======================================== */

.contact-image-container {
  position: relative;
  width: 90%;
  max-width: 1000px;
  margin: 0 auto;
  /* Initial state for scroll animation */
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
}

.contact-hero .contact-image-container {
  opacity: 1;
  transform: translateY(0);
}

.contact-image-wrapper {
  position: relative;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 80px rgba(119, 191, 226, 0.3);
  transition: all 0.4s ease;
}

.contact-image-wrapper:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 100px rgba(119, 191, 226, 0.5);
}

@keyframes floatImage {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
}

.contact-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease;
}

.contact-image-wrapper:hover .contact-image {
  transform: scale(1.05);
}

/* Glowing border effect */
.contact-image-wrapper::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(
    45deg,
    rgba(119, 191, 226, 0.5),
    rgba(139, 127, 214, 0.5),
    rgba(2, 165, 255, 0.5),
    rgba(119, 191, 226, 0.5)
  );
  border-radius: 30px;
  opacity: 0;
  z-index: -1;
  animation: borderGlow 3s linear infinite;
  transition: opacity 0.4s ease;
}

.contact-image-wrapper:hover::before {
  opacity: 1;
}

@keyframes borderGlow {
  0%,
  100% {
    filter: blur(10px);
  }
  50% {
    filter: blur(15px);
  }
}

/* ========================================
   Contact Form Container (Centered Below Hero)
   ======================================== */

.contact-form-container {
  position: relative;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
}

.contact-form-card {
  background: rgba(255, 255, 255, 0.02);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  padding: 2.5rem 3.5rem;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
  z-index: 5;
}

/* Glass highlight on top edge */
.contact-form-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
}

/* ========================================
   Form Elements
   ======================================== */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.form-group {
  position: relative;
  opacity: 1;
  transform: translateY(0);
}

/* Form labels */
.form-label {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  display: block;
  margin-bottom: 0.8rem;
  letter-spacing: 0.02em;
}

.form-label .required {
  color: #ff6b9d;
  margin-left: 0.2rem;
}

/* Form inputs and textarea */
.form-input,
.form-textarea {
  width: 100%;
  padding: 1.4rem 1.8rem;
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: var(--font-size-base);
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(119, 191, 226, 0.6);
  box-shadow: 0 0 0 4px rgba(119, 191, 226, 0.15);
}

.form-input:hover:not(:focus),
.form-textarea:hover:not(:focus) {
  border-color: rgba(255, 255, 255, 0.25);
}

.form-textarea {
  resize: vertical;
  min-height: 150px;
  font-family: var(--font-primary);
  font-weight: 500;
}

/* Validation states */
.form-group.error .form-input,
.form-group.error .form-textarea {
  border-color: rgba(255, 107, 157, 0.6);
  background: rgba(255, 107, 157, 0.1);
}

.form-group.error .form-input:focus,
.form-group.error .form-textarea:focus {
  box-shadow: 0 0 0 4px rgba(255, 107, 157, 0.15);
}

.form-group.success .form-input,
.form-group.success .form-textarea {
  border-color: rgba(78, 205, 196, 0.6);
  background: rgba(78, 205, 196, 0.08);
}

/* Error message */
.form-error-message {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: var(--font-size-tiny);
  color: #ff6b9d;
  margin-top: 0.6rem;
  display: none;
  animation: fadeIn 0.3s ease;
}

.form-group.error .form-error-message {
  display: block;
}

/* ========================================
   Submit Button
   ======================================== */

.form-submit-group {
  margin-top: 1rem;
  opacity: 1;
  transform: translateY(0);
}

.form-submit-btn {
  width: 100%;
  padding: 1.6rem 3rem;
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: var(--font-size-large);
  color: var(--color-white);
  background: linear-gradient(135deg, #77bfe2 0%, #02a5ff 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 30px rgba(119, 191, 226, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Button shine effect */
.form-submit-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s ease;
}

.form-submit-btn:hover::before {
  left: 100%;
}

.form-submit-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(119, 191, 226, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.form-submit-btn:active {
  transform: translateY(-1px);
}

.form-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ========================================
   Success Message
   ======================================== */

.form-success-message {
  background: rgba(78, 205, 196, 0.15);
  border: 2px solid rgba(78, 205, 196, 0.5);
  border-radius: 12px;
  padding: 2rem;
  margin-top: 2rem;
  text-align: center;
  display: none;
  animation: fadeIn 0.5s ease;
}

.form-success-message.show {
  display: block;
}

.success-message-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.success-message-title {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: var(--font-size-3xl);
  color: #4ecdc4;
  margin-bottom: 0.5rem;
  letter-spacing: 0.03em;
}

.success-message-text {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: var(--font-size-base);
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
}

/* ========================================
   Responsive Design
   ======================================== */

/* Large Desktop (1200px - 1400px) */
@media (max-width: 1400px) {
  .contact-hero {
    min-height: 80vh;
  }

  .contact-image-container {
    width: 85%;
    max-width: 900px;
  }

  /* Slightly smaller Jupiter */
  .planet-jupiter {
    width: 500px;
    height: 500px;
  }
}

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
  .section-contact {
    padding: 4rem 3rem 4rem;
  }

  .section-contact .section-title {
    font-size: var(--font-size-5xl);
  }

  .section-contact .section-subtitle {
    font-size: var(--font-size-base);
    margin-bottom: 2rem;
  }

  .contact-hero {
    min-height: 70vh;
  }

  .contact-image-container {
    width: 85%;
    max-width: 600px;
  }

  .contact-form-container {
    max-width: 600px;
  }

  .contact-form-card {
    padding: 2.5rem 2.5rem;
  }

  .contact-footer {
    margin-top: 4rem;
    padding-top: 3rem;
  }

  .contact-footer-content {
    gap: 2rem;
  }

  .footer-tagline {
    font-size: var(--font-size-2xl);
  }

  .footer-nav-links {
    gap: 2rem;
  }

  .footer-nav-links li:not(:last-child)::after {
    right: -1.15rem;
  }

  /* Reduce Jupiter size */
  .planet-jupiter {
    width: 400px;
    height: 400px;
    top: 55%;
    left: 3%;
  }

  /* Hide one asteroid to reduce clutter */
  .asteroid-2 {
    display: none;
  }

  /* Adjust moon size */
  .moon-1 {
    width: 60px;
    height: 60px;
  }

  /* Adjust distant planet */
  .planet-distant {
    width: 80px;
    height: 80px;
  }
}

/* Mobile (up to 768px) */
@media (max-width: 768px) {
  .section-contact {
    padding: 3rem 3rem 3rem;
  }

  .section-contact .section-title {
    font-size: var(--font-size-4xl);
  }

  .section-contact .section-subtitle {
    margin-bottom: 2rem;
  }

  .contact-hero {
    min-height: 60vh;
    padding-bottom: 2rem;
  }

  .contact-image-container {
    width: 90%;
  }

  .contact-form-container {
    max-width: 100%;
    padding: 0 1rem;
  }

  .contact-form-card {
    padding: 2rem 2rem;
  }

  .form-input,
  .form-textarea {
    padding: 1.2rem 1.5rem;
    font-size: var(--font-size-small);
  }

  .form-label {
    font-size: var(--font-size-small);
  }

  .form-submit-btn {
    padding: 1.4rem 2.5rem;
    font-size: var(--font-size-base);
  }

  .contact-footer {
    margin-top: 3rem;
    padding-top: 2.5rem;
  }

  .contact-footer-content {
    gap: 2rem;
  }

  .footer-tagline {
    font-size: var(--font-size-xl);
  }

  .footer-nav-links {
    gap: 1.5rem;
    flex-direction: column;
  }

  .footer-nav-links li:not(:last-child)::after {
    display: none;
  }

  .footer-nav-link {
    font-size: var(--font-size-small);
  }

  /* Hide Jupiter on mobile to avoid clutter */
  .planet-jupiter {
    display: none;
  }

  /* Keep only moon and one asteroid visible */
  .asteroid-1 {
    display: none;
  }

  .planet-distant {
    width: 60px;
    height: 60px;
    top: 10%;
    right: 10%;
  }

  .moon-1 {
    width: 50px;
    height: 50px;
    top: 20%;
    right: 5%;
  }
}

/* Small Mobile (up to 480px) */
@media (max-width: 480px) {
  .section-contact {
    padding: 2.5rem 1rem 2rem;
  }

  .contact-hero {
    min-height: 50vh;
    padding-bottom: 1.5rem;
  }

  .contact-image-container {
    width: 95%;
  }

  .contact-form-card {
    padding: 1.8rem 1.5rem;
  }

  .form-textarea {
    min-height: 120px;
  }

  .contact-footer {
    margin-top: 2.5rem;
    padding-top: 2rem;
  }

  .contact-footer-content {
    gap: 1.5rem;
  }

  .footer-tagline {
    font-size: var(--font-size-large);
  }

  .footer-nav-links {
    gap: 1rem;
  }

  .footer-nav-link {
    font-size: var(--font-size-tiny);
  }

  .footer-copyright {
    font-size: var(--font-size-tiny);
  }

  /* Minimal celestial objects on small mobile */
  .moon-1,
  .planet-distant {
    width: 40px;
    height: 40px;
  }
}

/* ========================================
   Celestial Object Animations
   ======================================== */

/* Jupiter planet float and rotation */
@keyframes floatPlanet {
  0%,
  100% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(-20px) translateX(0);
  }
}

@keyframes rotatePlanet {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes rotateSpot {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Moon gentle float */
@keyframes floatMoon {
  0%,
  100% {
    transform: translateY(0) translateX(0);
  }
  25% {
    transform: translateY(-8px) translateX(3px);
  }
  50% {
    transform: translateY(-12px) translateX(0);
  }
  75% {
    transform: translateY(-8px) translateX(-3px);
  }
}

/* Asteroid tumbling rotation */
@keyframes tumbleAsteroid {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Distant planet slow orbital movement */
@keyframes orbitSlow {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(10px, -15px) scale(1.05);
  }
  50% {
    transform: translate(20px, 0) scale(1);
  }
  75% {
    transform: translate(10px, 15px) scale(0.95);
  }
}

/* ========================================
   Accessibility
   ======================================== */

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .section-contact,
  .section-contact::before,
  .contact-image-wrapper,
  .contact-form-card,
  .form-group,
  .form-submit-btn,
  .planet-jupiter,
  .planet-jupiter::before,
  .moon-1,
  .asteroid-1,
  .asteroid-2,
  .planet-distant {
    animation: none !important;
    transition: none !important;
  }

  .contact-image-wrapper:hover,
  .form-submit-btn:hover {
    transform: none !important;
  }

  .contact-particles {
    display: none;
  }
}

/* Focus visible for keyboard navigation */
.form-input:focus-visible,
.form-textarea:focus-visible,
.form-submit-btn:focus-visible {
  outline: 3px solid rgba(119, 191, 226, 0.8);
  outline-offset: 2px;
}
