/* Refined Contact Form Styles */

/* Contact section container */
.contact {
  margin-top: 80px;
  padding: 2rem;
  background-color: #fff;
  position: relative;
  font-family: "Times New Roman", Times, serif;
}

/* Decorative elements */
.contact::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(
      circle at 10% 10%,
      rgba(25, 25, 112, 0.03) 0%,
      transparent 20%
    ),
    radial-gradient(
      circle at 90% 90%,
      rgba(255, 215, 0, 0.03) 0%,
      transparent 20%
    );
  pointer-events: none;
  z-index: -1;
}

/* Page title with enhanced styling */
.contact h1 {
  color: #191970;
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
  position: relative;
  padding-bottom: 0.5rem;
  font-family: "Times New Roman", Times, serif;
}

.contact h1::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(to right, #191970, #ffd700);
  border-radius: 3px;
}

/* Form container with enhanced styling */
.contact-form-section {
  max-width: 600px;
  margin: 0 auto 3rem;
  padding: 2.5rem;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-form-section:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

/* Subtle corner accent */
.contact-form-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  background-color: #191970;
  border-radius: 0 0 6px 0;
}

.contact-form-section::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 6px;
  height: 6px;
  background-color: #ffd700;
  border-radius: 6px 0 0 0;
}

/* Form elements with enhanced styling */
#contactForm {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  font-family: "Times New Roman", Times, serif;
}

/* Label styling */
#contactForm label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #191970;
  font-size: 1rem;
  transition: color 0.3s ease;
  position: relative;
  padding-left: 0.5rem;
  font-family: "Times New Roman", Times, serif;
}

#contactForm label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 70%;
  background-color: #191970;
  border-radius: 3px;
  opacity: 0.7;
}

/* Required field indicator - modified to disappear when filled */
#contactForm label::after {
  content: "*";
  color: #dc3545;
  margin-left: 4px;
  font-size: 0.9rem;
  transition: opacity 0.3s ease;
}

/* Hide asterisk when field is filled */
#contactForm .filled-field label::after {
  opacity: 0;
}

/* Input and textarea styling */
#contactForm input,
#contactForm textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background-color: #f9f9f9;
  color: #333;
  font-family: "Times New Roman", Times, serif;
}

/* Enhanced placeholder styling */
#contactForm input::placeholder,
#contactForm textarea::placeholder {
  color: #a0a0a0;
  opacity: 0.7;
  font-style: italic;
  font-size: 0.9rem;
  transition: opacity 0.3s ease;
  font-family: "Times New Roman", Times, serif;
}

#contactForm input:focus::placeholder,
#contactForm textarea:focus::placeholder {
  opacity: 0.4;
}

/* Custom placeholder text */
#name::placeholder {
  content: "Your full name";
}

#email::placeholder {
  content: "your.email@example.com";
}

#message::placeholder {
  content: "How can I help you today?";
}

#contactForm input:focus,
#contactForm textarea:focus {
  border-color: #191970;
  box-shadow: 0 0 0 3px rgba(25, 25, 112, 0.1);
  outline: none;
  background-color: #fff;
}

#contactForm input.error,
#contactForm textarea.error {
  border-color: #dc3545;
  background-color: rgba(220, 53, 69, 0.05);
}

/* Character counter with refined styling */
#charCount {
  font-size: 0.8rem;
  color: #666;
  text-align: right;
  margin-top: 0.5rem;
  transition: color 0.3s ease;
  font-family: "Times New Roman", Times, serif;
}

#charCount.warning {
  color: #e67e22;
  font-weight: 600;
}

/* Enhanced error message styling */
.error-message {
  color: #dc3545;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  padding-left: 1.8rem;
  position: relative;
  animation: slideInUp 0.3s ease forwards;
  display: flex;
  align-items: center;
  line-height: 1.4;
  font-family: "Times New Roman", Times, serif;
}

.error-message::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dc3545' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle  stroke='%23dc3545' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* Submit button with enhanced styling */
#contactForm .cta-btn {
  background-color: #191970;
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  box-shadow: 0 4px 6px rgba(25, 25, 112, 0.1);
  font-family: "Times New Roman", Times, serif;
}

#contactForm .cta-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.7s ease;
}

#contactForm .cta-btn:hover {
  background-color: #ffd700;
  color: #191970;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(255, 215, 0, 0.2);
}

#contactForm .cta-btn:hover::before {
  left: 100%;
}

#contactForm .cta-btn:active {
  transform: translateY(0);
}

#contactForm .cta-btn:disabled {
  background-color: #cccccc;
  color: #666666;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#contactForm .cta-btn:disabled::before {
  display: none;
}

/* Loading spinner with refined styling */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

/* Improved loading state - centered spinner instead of overlay */
.loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #191970;
  color: white;
  padding: 1rem 2rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  z-index: 100;
  font-family: "Times New Roman", Times, serif;
}

.loading-indicator .loading-spinner {
  width: 24px;
  height: 24px;
}

.loading-indicator-text {
  font-weight: 600;
  font-size: 1rem;
  font-family: "Times New Roman", Times, serif;
}

/* Form messages container */
#formMessages {
  margin-top: 1.5rem;
  font-family: "Times New Roman", Times, serif;
}

/* Enhanced form message styling */
.form-message {
  padding: 1.2rem;
  border-radius: 8px;
  font-weight: 500;
  position: relative;
  padding-left: 3.5rem;
  animation: slideInUp 0.4s ease forwards;
  opacity: 1;
  transition: opacity 0.3s ease;
  margin-bottom: 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  line-height: 1.5;
  font-family: "Times New Roman", Times, serif;
}

.form-message::before {
  content: "";
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

/* Success message with enhanced styling */
.form-message.success {
  background-color: #d4edda;
  color: #155724;
  border-left: 4px solid #28a745;
  display: flex;
  flex-direction: column;
}

.form-message.success::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23155724' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'%3E%3C/path%3E%3Cpolyline points='22 4 12 14.01 9 11.01'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Success message title and description */
.form-message.success .success-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
  font-family: "Times New Roman", Times, serif;
}

.form-message.success .success-description {
  font-size: 0.9rem;
  opacity: 0.9;
  font-family: "Times New Roman", Times, serif;
}

/* Error message with enhanced styling */
.form-message.error {
  background-color: #f8d7da;
  color: #721c24;
  border-left: 4px solid #dc3545;
}

.form-message.error::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23721c24' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
}

/* Custom validation tooltip */
.validation-tooltip {
  position: absolute;
  background-color: #191970;
  color: white;
  padding: 0.5rem 0.8rem;
  border-radius: 4px;
  font-size: 0.8rem;
  z-index: 100;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  max-width: 250px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  font-family: "Times New Roman", Times, serif;
}

.validation-tooltip::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 15px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #191970;
}

.input-wrapper {
  position: relative;
}

.input-wrapper:hover .validation-tooltip,
.input-wrapper:focus-within .validation-tooltip {
  opacity: 1;
  transform: translateY(0);
}

/* Social links section with text and icons on same horizontal line */
.social-links {
  text-align: center;
  padding: 2rem 0;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  max-width: 600px;
  margin: 0 auto;
  font-family: "Times New Roman", Times, serif;
}

.social-links h2 {
  color: #191970;
  font-size: 1.8rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0 1rem;
  font-family: "Times New Roman", Times, serif;
}

.social-links h2::before,
.social-links h2::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 30px;
  height: 2px;
}

.social-links h2::before {
  right: 100%;
  background: linear-gradient(to left, #ffd700, transparent);
}

.social-links h2::after {
  left: 100%;
  background: linear-gradient(to right, #ffd700, transparent);
}

/* Social icons styling */
.social-icon {
  display: inline-block;
  transition: all 0.3s ease;
  position: relative;
}

.social-icon::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  width: 6px;
  height: 6px;
  background-color: #ffd700;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.social-icon:hover {
  transform: translateY(-5px);
}

.social-icon:hover::after {
  transform: translateX(-50%) scale(1);
}

.social-icon img {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 2px solid transparent;
  display: block;
}

.social-icon:hover img {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  border-color: #ffd700;
}

/* Form field validation styling */
#contactForm input:invalid,
#contactForm textarea:invalid {
  border-color: #e0e0e0; /* Keep normal until submit attempt */
}

#contactForm.attempted input:invalid,
#contactForm.attempted textarea:invalid {
  border-color: #dc3545;
  background-color: rgba(220, 53, 69, 0.05);
}

/* Success animation for form submission */
@keyframes successPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
  }
}

.form-success-animation {
  animation: successPulse 1.5s ease-out;
}

/* Animations */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Input field animation on focus */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(25, 25, 112, 0.4);
  }
  70% {
    box-shadow: 0 0 0 5px rgba(25, 25, 112, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(25, 25, 112, 0);
  }
}

#contactForm input:focus,
#contactForm textarea:focus {
  animation: pulse 1s ease-in-out;
}

/* Focus visible for accessibility */
#contactForm input:focus-visible,
#contactForm textarea:focus-visible,
#contactForm .cta-btn:focus-visible {
  outline: 2px solid #191970;
  outline-offset: 2px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .contact-form-section {
    padding: 2rem;
    margin: 0 1rem 2rem;
  }

  .contact h1 {
    font-size: 2rem;
  }

  #contactForm .cta-btn {
    padding: 0.9rem 1.8rem;
  }

  /* Stack social links vertically on smaller screens */
  .social-links {
    flex-direction: column;
    gap: 1rem;
  }

  .social-links h2 {
    margin-bottom: 1rem;
  }

  /* Social icons container for mobile */
  .social-icons-container {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .contact-form-section {
    padding: 1.5rem;
  }

  #contactForm label {
    font-size: 0.9rem;
  }

  #contactForm input,
  #contactForm textarea {
    padding: 0.8rem;
  }

  .social-icon img {
    width: 40px;
    height: 40px;
  }
}
/* Remove the asterisk after labels completely */
#contactForm label::after {
  content: none; /* Remove the asterisk completely */
}

/* ===== Dark Mode Support with Enhanced Gold ===== */
@media (prefers-color-scheme: dark) {
  /* Main container background */
  .contact {
    background-color: #121212;
    color: #ffffff;
  }

  /* Decorative elements */
  .contact::before {
    background-image: radial-gradient(
        circle at 10% 10%,
        rgba(255, 215, 0, 0.05) 0%,
        transparent 20%
      ),
      radial-gradient(
        circle at 90% 90%,
        rgba(25, 25, 112, 0.05) 0%,
        transparent 20%
      );
  }

  /* Page title with enhanced gold styling */
  .contact h1 {
    color: #a67c00;
    background: linear-gradient(
      135deg,
      #704700 0%,
      #a67c00 20%,
      #d4af37 40%,
      #f9df85 50%,
      #d4af37 60%,
      #a67c00 80%,
      #704700 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: goldShimmer 8s linear infinite;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  }

  .contact h1::after {
    background: linear-gradient(to right, #a67c00, #191970);
    animation: goldShimmer 8s linear infinite;
    background-size: 200% auto;
  }

  /* Form container */
  .contact-form-section {
    background-color: #1e1e1e;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  }

  .contact-form-section:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), 0 0 20px rgba(166, 124, 0, 0.1);
  }

  /* Corner accents */
  .contact-form-section::before {
    background-color: #a67c00;
  }

  .contact-form-section::after {
    background-color: #191970;
  }

  /* Form labels */
  #contactForm label {
    color: #d4af37;
  }

  #contactForm label::before {
    background-color: #d4af37;
  }

  /* Form inputs */
  #contactForm input,
  #contactForm textarea {
    background-color: #2a2a2a;
    border-color: #333333;
    color: #ffffff;
  }

  #contactForm input::placeholder,
  #contactForm textarea::placeholder {
    color: #888888;
  }

  #contactForm input:focus,
  #contactForm textarea:focus {
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
    background-color: #2a2a2a;
  }

  /* Character counter */
  #charCount {
    color: #aaaaaa;
  }

  /* Submit button with gold gradient */
  #contactForm .cta-btn {
    background: linear-gradient(
      135deg,
      #704700 0%,
      #a67c00 20%,
      #d4af37 40%,
      #f9df85 50%,
      #d4af37 60%,
      #a67c00 80%,
      #704700 100%
    );
    background-size: 200% 200%;
    animation: goldWave 12s ease infinite;
    color: #191970;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  }

  #contactForm .cta-btn:hover {
    background: #191970;
    color: #ffffff;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3), 0 0 15px rgba(166, 124, 0, 0.2);
    animation: none;
  }

  #contactForm .cta-btn::before {
    background: linear-gradient(
      90deg,
      transparent,
      rgba(255, 255, 255, 0.1),
      transparent
    );
  }

  #contactForm .cta-btn:disabled {
    background-color: #444444;
    color: #888888;
    animation: none;
  }

  /* Loading indicator */
  .loading-indicator {
    background-color: #a67c00;
    color: #191970;
  }

  .loading-spinner {
    border: 3px solid rgba(25, 25, 112, 0.3);
    border-top: 3px solid #191970;
  }

  /* Form messages */
  .form-message.success {
    background-color: rgba(40, 167, 69, 0.2);
    color: #4ade80;
    border-left: 4px solid #28a745;
  }

  .form-message.error {
    background-color: rgba(220, 53, 69, 0.2);
    color: #f87171;
    border-left: 4px solid #dc3545;
  }

  /* Validation tooltip */
  .validation-tooltip {
    background-color: #a67c00;
    color: #191970;
  }

  .validation-tooltip::before {
    border-bottom: 6px solid #a67c00;
  }

  /* Social links */
  .social-links h2 {
    color: #d4af37;
    background: linear-gradient(
      135deg,
      #704700 0%,
      #a67c00 20%,
      #d4af37 40%,
      #f9df85 50%,
      #d4af37 60%,
      #a67c00 80%,
      #704700 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: goldShimmer 8s linear infinite;
  }

  .social-links h2::before {
    background: linear-gradient(to left, #191970, transparent);
  }

  .social-links h2::after {
    background: linear-gradient(to right, #191970, transparent);
  }

  .social-icon::after {
    background-color: #191970;
  }

  .social-icon img {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  }

  .social-icon:hover img {
    border-color: #191970;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4), 0 0 15px rgba(166, 124, 0, 0.2);
  }

  /* Focus states */
  #contactForm input:focus-visible,
  #contactForm textarea:focus-visible,
  #contactForm .cta-btn:focus-visible {
    outline: 2px solid #d4af37;
  }

  /* Animation adjustments */
  @keyframes pulse {
    0% {
      box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4);
    }
    70% {
      box-shadow: 0 0 0 5px rgba(212, 175, 55, 0);
    }
    100% {
      box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
    }
  }

  /* Error states */
  #contactForm input.error,
  #contactForm textarea.error {
    border-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
  }

  #contactForm.attempted input:invalid,
  #contactForm.attempted textarea:invalid {
    border-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
  }

  /* Gold effect animations */
  @keyframes goldShimmer {
    0% {
      background-position: 0% 50%;
    }
    50% {
      background-position: 100% 50%;
    }
    100% {
      background-position: 0% 50%;
    }
  }

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

/* Update headings: */
.contact h1,
.contact-form-section h1,
.social-links h2 {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

/* Update form elements and labels: */
#contactForm label {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

#contactForm input,
#contactForm textarea {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

/* Update button specifically: */
#contactForm .cta-btn {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

/* Keep Inter for form messages and descriptions: */
.form-message,
.error-message,
.loading-indicator-text,
.validation-tooltip {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}
