/* ===== Base Section ===== */
#contact-section {
  font-family: "Source Code Pro", monospace;
  color: #000;
  padding: 60px 20px;
  box-sizing: border-box;
  background: #fff;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 95px;
  padding-bottom: 100px;
}

.contact-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* ===== Session Title ===== */
.contact-scramble-title {
  font-family: "Orbitron", sans-serif;
  font-size: clamp(32px, 8vw, 56px);
  font-weight: 700;
  letter-spacing: clamp(1px, 0.5vw, 3px);
  margin: 0 0 60px 0;
  text-align: center;
  color: #000;
  line-height: 1.1;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  text-transform: uppercase;
  word-break: break-word;
}

.contact-scramble-title.visible {
  opacity: 1;
}

/* ===== Content Sections ===== */
.contact-subtitle { 
  font-size: clamp(24px, 5vw, 48px); 
  letter-spacing: clamp(1px, 0.3vw, 2px); 
  line-height: 1.2; 
  margin-bottom: 20px;
  word-break: break-word;
}

.contact-address, .contact-info { 
  font-size: clamp(14px, 2.5vw, 15px); 
  color: #222; 
  white-space: pre-line; 
  line-height: 1.6;
}

/* ===== Social Media Styles ===== */
.social-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.social-links li {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  font-size: clamp(14px, 2.5vw, 16px);
  color: #222;
}

.social-links i {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  font-size: clamp(16px, 3vw, 20px);
  color: #333;
  transition: color 0.3s ease, transform 0.2s ease;
}

.social-links a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

.social-links a:hover {
  color: #000;
}

.social-links a:hover i {
  transform: translateX(3px);
}

/* Specific social media colors on hover */
.social-links a:hover .fa-instagram {
  color: #E4405F;
}

.social-links a:hover .fa-twitter {
  color: #000000;
}

.social-links a:hover .fa-linkedin {
  color: #0077B5;
}

.contact-form-title {
  font-family: "Source Code Pro", monospace;
  font-size: clamp(28px, 6vw, 48px);
  margin: 40px 0 24px 0;
  letter-spacing: clamp(0.5px, 0.2vw, 1px);
  word-break: break-word;
}

/* ===== Form Styles ===== */
.contact-form label { 
  font-size: clamp(13px, 2.2vw, 15px); 
  color: #666; 
  margin-bottom: 8px; 
  display: block; 
  font-weight: 500; 
}

.contact-required::after { 
  content: " *"; 
  color: #d32f2f; 
}

.contact-form .form-control {
  border: none;
  border-bottom: 2px solid #dcdcdc;
  border-radius: 0;
  box-shadow: none;
  padding: 12px 0;
  background: transparent;
  font-family: "Source Code Pro", monospace;
  font-size: clamp(14px, 2.5vw, 16px);
  transition: border-bottom-color 0.3s ease;
  margin-bottom: 15px;
  width: 100%;
}

.contact-form .form-control:focus { 
  outline: none; 
  border-bottom-color: #333; 
  box-shadow: none; 
}

.contact-form .form-control.is-valid { 
  border-bottom-color: #28a745; 
}

.contact-form .form-control.is-invalid { 
  border-bottom-color: #dc3545; 
}

.contact-form textarea.form-control { 
  min-height: clamp(100px, 15vh, 140px); 
  resize: vertical; 
}

.contact-form .form-control::placeholder { 
  color: #9b9b9b; 
  opacity: 1; 
}

/* ===== Button Styles ===== */
.contact-btn {
  background: #000;
  color: #fff;
  border: none;
  padding: clamp(12px, 2vh, 15px) clamp(24px, 4vw, 32px);
  font-family: "Source Code Pro", monospace;
  font-size: clamp(14px, 2.5vw, 16px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 25px;
  cursor: pointer;
  border-radius: 0;
  transition: background-color 0.3s ease, opacity 0.3s ease;
  min-width: clamp(160px, 40vw, 200px);
  justify-content: center;
  font-weight: 500;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.contact-btn .btn-text {
  display: inline-block;
  width: 100%;
  text-align: center;
  white-space: nowrap;
  font-family: "Source Code Pro", monospace;
  line-height: 1.2;
  pointer-events: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: inherit;
}

/* Allow text wrapping for buttons with longer text */
.contact-btn .btn-text[style*="white-space: normal"] {
  white-space: normal;
  word-break: break-word;
  hyphens: auto;
}

.contact-btn:hover:not(:disabled) { 
  background: #333; 
}

.contact-btn:disabled { 
  opacity: 0.6; 
  cursor: not-allowed; 
}

.contact-btn .loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 8px;
  flex: 0 0 auto;
}

@keyframes spin { 
  0% { transform: rotate(0deg); } 
  100% { transform: rotate(360deg); } 
}

/* ===== Error and Success Messages ===== */
.contact-error { 
  color: #dc3545; 
  font-size: clamp(12px, 2vw, 13px); 
  margin-top: 8px; 
  font-family: "Source Code Pro", monospace; 
  display: block; 
}

.contact-success { 
  color: #28a745; 
  font-size: clamp(14px, 2.5vw, 16px); 
  margin-top: 30px; 
  padding: 20px; 
  border: 1px solid #28a745; 
  background: rgba(40, 167, 69, 0.1); 
  font-family: "Source Code Pro", monospace; 
  border-radius: 4px; 
}

.contact-form-container { 
  transition: opacity 0.3s ease; 
}

.contact-form-container.sending { 
  opacity: 0.7; 
  pointer-events: none; 
}

.contact-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ===== Responsive Design ===== */

/* Extra Small devices (portrait phones) */
@media (max-width: 575.98px) {
  #contact-section {
    padding: 40px 15px;
    min-height: 100dvh;
  }
  
  .contact-scramble-title {
    margin-bottom: 40px;
  }
  
  .contact-form-title {
    margin: 30px 0 20px 0;
  }
  
  .contact-btn {
    margin-top: 20px;
    max-width: none;
  }
  
  .contact-info br {
    display: none;
  }
  
  .contact-info {
    white-space: normal;
  }

  .social-links li {
    margin-bottom: 12px;
  }
}

/* Small devices (landscape phones) */
@media (min-width: 576px) and (max-width: 767.98px) {
  #contact-section {
    padding: 50px 25px;
  }
  
  .contact-btn {
    max-width: 300px;
  }
}

/* Medium devices (tablets) */
@media (min-width: 768px) and (max-width: 991.98px) {
  #contact-section {
    padding: 60px 30px;
  }
  
  .contact-btn {
    max-width: 250px;
    width: auto;
  }
}

/* Large devices (desktops) */
@media (min-width: 992px) {
  .contact-btn {
    max-width: 200px;
    width: auto;
  }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 500px) {
  #contact-section {
    padding: 30px 20px;
    min-height: auto;
  }
  
  .contact-scramble-title {
    margin-bottom: 30px;
  }
  
  .contact-form-title {
    margin: 20px 0 15px 0;
  }
  
  .contact-form .form-control {
    margin-bottom: 10px;
  }
}

/* Ultra-wide screens */
@media (min-width: 1400px) {
  .contact-container {
    max-width: 1400px;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .contact-scramble-title,
  .contact-subtitle,
  .contact-form-title {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* Print styles */
@media print {
  #contact-section {
    background: white;
    color: black;
    padding: 20px;
  }
  
  .contact-btn {
    display: none;
  }
  
  .contact-scramble-title {
    opacity: 1;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .contact-scramble-title,
  .contact-form .form-control,
  .contact-btn,
  .contact-form-container {
    transition: none;
  }
  
  .loading-spinner {
    animation: none;
  }

  .social-links a:hover i {
    transform: none;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .contact-form .form-control {
    border-bottom-color: #000;
  }
  
  .contact-form .form-control:focus {
    border-bottom-color: #000;
    border-bottom-width: 3px;
  }
  
  .contact-btn {
    border: 2px solid #000;
  }

  .social-links i {
    color: #000;
  }
}