/* ============================================
   Contact Page CSS - Updated with Blue Palette
   ============================================ */

/* ========== VISUALLY HIDDEN (for accessibility) ========== */
.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* ========== ERROR MESSAGES ========== */
.error-message {
  display: block;
  color: #d32f2f;
  font-size: 0.875rem;
  margin-top: 4px;
  padding: 4px 8px;
  background-color: #ffebee;
  border-left: 3px solid #d32f2f;
  border-radius: 4px;
}

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

.input-row:has(input:invalid:not(:placeholder-shown)) .error-message,
.textarea-row:has(textarea:invalid:not(:placeholder-shown)) .error-message {
  position: static;
  width: auto;
  height: auto;
  padding: 4px 8px;
  margin: 4px 0 0 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  border-left: 3px solid #d32f2f;
}

/* ========== CONTACT US SECTION ========== */
.contact-us {
  min-height: 100vh;
  background-image: url('../images/site/contact-background.webp');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 120px 20px 60px; /* Increased top padding to prevent content from being cut off by navbar */
  box-sizing: border-box;
  scroll-margin-top: 100px; /* Account for sticky navbar */
  scroll-padding-top: 100px; /* Account for sticky navbar */
  max-width: 100vw;
  overflow-x: hidden;
}

#contact {
  scroll-margin-top: 100px; /* Account for sticky navbar */
  scroll-padding-top: 100px; /* Account for sticky navbar */
}

/* Gradient overlay from right to middle */
.contact-us::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to left,
    rgba(240, 240, 240, 0.95) 0%,
    rgba(240, 240, 240, 0.85) 20%,
    rgba(240, 240, 240, 0.6) 40%,
    rgba(240, 240, 240, 0.3) 50%,
    transparent 60%
  );
  pointer-events: none;
  z-index: 0;
}

/* ========== RIGHT OVERLAY (Removed - using ::before gradient instead) ========== */
.right-overlay {
  display: none;
}

/* ========== CONTACT WRAPPER (Form + Map) ========== */
.contact-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 0;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  align-items: stretch;
  /* Default: RTL - form on right, map on left (natural order) */
  flex-direction: row;
}

/* LTR: Reverse order so form is on right, map on left */
.contact-wrapper.ltr {
  flex-direction: row-reverse;
}

/* RTL: Keep natural order (form on right, map on left) */
.contact-wrapper.rtl {
  flex-direction: row;
}

/* ========== CONTACT FORM CONTAINER ========== */
.contact-form-container {
  position: relative;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 32px rgba(0, 99, 173, 0.15);
  color: rgba(51, 51, 51, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
  padding: 2rem 1.5rem;
  padding-bottom: 40px;
  border-radius: 0px 20px 20px 0;
  border: 1px solid rgba(0, 99, 173, 0.1);
  border-right: none;
}

/* ========== GOOGLE MAPS CONTAINER ========== */
.contact-map-container {
  flex: 1;
  min-width: 0;
  min-height: 500px;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 32px rgba(0, 99, 173, 0.15);
  border-radius: 20px 0px 0px 20px; 
  border: 1px solid rgba(0, 99, 173, 0.1);
  border-left: none;
  overflow: hidden;
}

.contact-map-container iframe {
  width: 100%;
  height: 100%;
  min-height: 500px;
  border: none;
  display: block;
}

.contact-form-container h2 {
  margin: 0 0 25px 0;
  font-family: "Noto Sans Hebrew", "Open Sans", sans-serif;
  font-weight: 700;
  font-style: normal;
  letter-spacing: 1px;
  font-size: 2rem;
  color: #333;
  text-align: center;
}

/* Optima font for English contact title */
[lang="en"] .contact-form-container h2,
[dir="ltr"] .contact-form-container h2,
.ltr .contact-form-container h2 {
  font-family: "Optima LT W02 Roman", "Optima", sans-serif;
  text-transform: uppercase;
}

/* ========== FORM STYLES ========== */
.contact-form-container form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ========== INPUT AND TEXTAREA ROWS ========== */
.input-row,
.textarea-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 15px;
  padding: 0 5px;
}

/* ========== INPUT STYLES ========== */
.input-row input {
  padding: 10px 15px;
  border: 1px solid rgba(0, 99, 173, 0.3);
  color: #333;
  font-size: 15px;
  font-family: "Noto Sans Hebrew", "Open Sans", sans-serif;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0.5px;
  background-color: rgba(255, 255, 255, 0.9);
  outline: none;
  box-sizing: border-box;
  flex: 1;
  min-width: 220px;
  width: 100%;
  height: 45px;
  margin: 0;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.input-row input:focus {
  border-color: #0063AD;
  box-shadow: 0 0 0 3px rgba(0, 99, 173, 0.1);
  background-color: #ffffff;
}

/* ========== TEXTAREA STYLES ========== */
.textarea-row textarea {
  width: 100%;
  min-height: 100px;
  margin: 0;
  padding: 12px 15px;
  border: 1px solid rgba(0, 99, 173, 0.3);
  color: #333;
  font-size: 15px;
  outline: none;
  font-family: "Noto Sans Hebrew", "Open Sans", sans-serif;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0.5px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  transition: all 0.3s ease;
  resize: vertical;
}

.textarea-row textarea:focus {
  border-color: #0063AD;
  box-shadow: 0 0 0 3px rgba(0, 99, 173, 0.1);
  background-color: #ffffff;
}

/* ========== RTL/LTR INPUT STYLES ========== */
input.rtl,
textarea.rtl {
  direction: rtl;
  text-align: right;
}

input.ltr,
textarea.ltr {
  direction: ltr;
  text-align: left;
}

/* ========== PLACEHOLDER STYLES ========== */
input::placeholder,
textarea::placeholder {
  color: rgba(0, 99, 173, 0.5);
  opacity: 1;
}

/* ========== RECAPTCHA CONTAINER ========== */
.recaptcha-container {
  display: flex;
  justify-content: center;
  margin: 15px 0;
}

/* ========== TERMS CHECKBOX ========== */
.terms-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 15px 0;
  font-size: 13px;
  color: #333;
  font-family: "Noto Sans Hebrew", "Open Sans", sans-serif;
  line-height: 1.6;
}

.terms-checkbox.rtl {
  direction: rtl;
  text-align: right;
}

.terms-checkbox.ltr {
  direction: ltr;
  text-align: left;
}

.terms-checkbox input[type="checkbox"] {
  margin: 0;
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: #0063AD;
}

.terms-checkbox input[type="checkbox"]:focus {
  outline: 2px solid #0063AD;
  outline-offset: 2px;
}

/* ========== TERMS LABEL ========== */
.terms-label {
  display: inline;
  line-height: 1.6;
  white-space: normal;
}

.terms-label a {
  display: inline;
  color: #0063AD;
  text-decoration: underline;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.3s;
}

.terms-label a:hover {
  color: #004a7a;
  text-decoration: underline;
}

/* ========== SUBMIT BUTTON ========== */
.submit-btn {
  display: flex;
  justify-content: center;
  margin-top: 5px;
}

.contact-form-container button[type="submit"] {
  font-weight: 600;
  background-color: #0063AD;
  color: #ffffff;
  font-family: "Noto Sans Hebrew", "Open Sans", sans-serif;
  font-size: 16px;
  letter-spacing: 1px;
  padding: 12px 35px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 280px;
  align-self: center;
  border-radius: 99px;
  box-shadow: 0 4px 12px rgba(0, 99, 173, 0.3);
}

.contact-form-container button[type="submit"]:hover {
  background-color: #004a7a;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 99, 173, 0.4);
}

.contact-form-container button[type="submit"]:active {
  transform: translateY(0);
}

.contact-form-container button[type="submit"]:focus-visible {
  outline: 3px solid rgba(0, 99, 173, 0.5);
  outline-offset: 2px;
}

.contact-form-container button[type="submit"]:disabled {
  background-color: #999;
  cursor: not-allowed;
  transform: none;
}

/* ========== SUBMISSION MESSAGE ========== */
.submission-message {
  text-align: center;
  margin-top: 20px;
  color: #0063AD;
  font-family: "Noto Sans Hebrew", "Open Sans", sans-serif;
  font-size: 16px;
  font-weight: 500;
  padding: 15px;
  background-color: rgba(0, 99, 173, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(0, 99, 173, 0.2);
}

.submission-message.error {
  color: #d32f2f;
  background-color: rgba(211, 47, 47, 0.1);
  border-color: rgba(211, 47, 47, 0.2);
}

/* ============================================
   MEDIA QUERIES
   ============================================ */

@media (max-width: 1024px) {
  .contact-us {
    padding: 80px 20px 40px;
  }
  
  .contact-wrapper,
  .contact-wrapper.ltr,
  .contact-wrapper.rtl {
    flex-direction: column !important;
    gap: 0;
    max-width: 700px;
  }
  
  .contact-form-container {
    padding: 2.5rem 2rem;
    border-radius: 20px 20px 0px 0px;
    border-right: 1px solid rgba(0, 99, 173, 0.1);
    border-bottom: none;
  }
  
  .contact-map-container {
    min-height: 400px;
    border-radius: 0px 0px 20px 20px;
    border-left: 1px solid rgba(0, 99, 173, 0.1);
    border-top: none;
  }
  
  .contact-map-container iframe {
    min-height: 400px;
  }
  
  .input-row input,
  .textarea-row textarea {
    margin: 0;
  }
}

@media (max-width: 768px) {
  .contact-us {
    padding: 60px 15px 30px;
    background-attachment: scroll; /* Disable fixed background on mobile */
  }
  
  .contact-us::before {
    background: linear-gradient(
      to left,
      rgba(240, 240, 240, 0.95) 0%,
      rgba(240, 240, 240, 0.85) 15%,
      rgba(240, 240, 240, 0.6) 30%,
      rgba(240, 240, 240, 0.3) 45%,
      transparent 55%
    );
  }
  
  .contact-wrapper,
  .contact-wrapper.ltr,
  .contact-wrapper.rtl {
    flex-direction: column !important;
    gap: 0;
    max-width: 100%;
  }
  
  .contact-form-container {
    padding: 2rem 1.5rem;
    border-right: 1px solid rgba(0, 99, 173, 0.1);
    border-bottom: none;
  }
  
  .contact-form-container h2 {
    font-size: 2rem;
    margin-bottom: 30px;
  }
  
  .contact-map-container {
    min-height: 300px;
    border-left: 1px solid rgba(0, 99, 173, 0.1);
    border-top: none;
  }
  
  .contact-map-container iframe {
    min-height: 300px;
  }
}

@media (max-width: 560px) {
  .recaptcha-container {
    justify-content: center;
  }

  .input-row input {
    padding: 12px 15px;
    min-width: 100%;
    font-size: 15px;
    height: 48px;
  }

  .textarea-row textarea {
    font-size: 15px;
    min-height: 100px;
  }

  .input-row,
  .textarea-row {
    gap: 15px;
    margin-bottom: 20px;
  }
  
  .contact-form-container {
    padding: 1.5rem 1.25rem;
  }
  
  .contact-form-container h2 {
    font-size: 1.75rem;
  }
}

@media (max-width: 480px) {
  .contact-form-container button[type="submit"] {
    width: 100%;
    max-width: 100%;
    padding: 12px 30px;
    font-size: 16px;
  }
  
  .terms-checkbox {
    font-size: 13px;
  }
}

@media (max-width: 400px) {
  .contact-form-container {
    padding: 1.25rem 1rem;
  }

  .contact-form-container button[type="submit"] {
    font-size: 15px;
    padding: 12px 25px;
  }
}

