/* ––––––––––––––––––––––––––––––––––––––––––––– */
/* Mobile Footer Optimization Styles */
/* ––––––––––––––––––––––––––––––––––––––––––––– */

/* Mobile-First Footer Layout */
@media (max-width: 767px) {
  /* Footer container mobile optimization */
  footer > div > div {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    /* padding-top handled in responsive sections below */
  }
  
  /* Newsletter section mobile styling */
  footer h2 {
    font-size: 1.75rem !important;
    line-height: 1.3 !important;
    margin-bottom: 1.5rem !important;
    text-align: center !important;
  }
  
  /* Newsletter form mobile optimization */
  .gform_wrapper.mora_subscribe_wrapper form.mora_subscribe {
    height: auto !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto !important;
    gap: 0 !important;
    padding: 1rem 1rem 1rem 1rem !important;
    margin-top: 2rem !important;
  }
  
  .gform_wrapper.mora_subscribe_wrapper .gform_fields {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  
  .gform_wrapper.mora_subscribe_wrapper .gfield {
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25) !important;
    margin: 0 !important;
  }
  
  .gform_wrapper.mora_subscribe_wrapper .gfield:last-child {
    border-bottom: none !important;
  }
  
  .gform_wrapper.mora_subscribe_wrapper .ginput_container input {
    height: 50px !important;
    padding-inline: 20px !important;
    font-size: 16px !important; 
    background: rgb(30, 28, 58) !important; 
    background-color: rgb(30, 28, 58) !important;
    border-width: 1px !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    border: none !important;
    border-radius: 0 !important;
    color: white !important;
  }

  /* Remove any container backgrounds that might be causing the dark appearance */
  .gform_wrapper.mora_subscribe_wrapper .gfield,
  .gform_wrapper.mora_subscribe_wrapper .ginput_container,
  .gform_wrapper.mora_subscribe_wrapper .gform_body,
  .gform_wrapper.mora_subscribe_wrapper .gform_fields,
  .gform_wrapper.mora_subscribe_wrapper ul.gform_fields,
  .gform_wrapper.mora_subscribe_wrapper li.gfield {
    background: rgb(30, 28, 58) !important; 
    background-color: rgb(30, 28, 58) !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
  }

  /* Ensure input fields keep their borders but remove backgrounds */
  .gform_wrapper.mora_subscribe_wrapper input[type="text"],
  .gform_wrapper.mora_subscribe_wrapper input[type="email"] {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
  }

  .gform_wrapper.mora_subscribe_wrapper .gform_footer {
    margin-top: 3rem !important; /* Increased spacing above submit button to prevent overlap */
    text-align: center !important;
    padding-top: 1rem !important; /* Additional padding for more separation */
  }

  /* Use more specific selectors to override Gravity Forms styles */
  footer .gform_wrapper.mora_subscribe_wrapper .gform_button,
  footer .gform_wrapper.mora_subscribe_wrapper button[type="submit"],
  footer .gform_wrapper.mora_subscribe_wrapper input[type="submit"],
  footer #gform_submit_button_5 {
    height: 50px !important;
    font-size: 16px !important;
    padding: 0 3rem !important;
    background: #6494CE !important; /* Blue background */
    background-color: #6494CE !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    min-width: 200px !important; /* Ensure minimum width */
    box-shadow: 0 2px 8px rgba(100, 148, 206, 0.3) !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    margin-top: -1rem !important; /* Additional spacing above button */
  }

  footer .gform_wrapper.mora_subscribe_wrapper .gform_button:hover,
  footer .gform_wrapper.mora_subscribe_wrapper button[type="submit"]:hover,
  footer .gform_wrapper.mora_subscribe_wrapper input[type="submit"]:hover,
  footer #gform_submit_button_5:hover {
    background: #5a84b8 !important; /* Darker blue on hover */
    background-color: #5a84b8 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(100, 148, 206, 0.4) !important;
  }

  footer .gform_wrapper.mora_subscribe_wrapper .gform_button:active,
  footer .gform_wrapper.mora_subscribe_wrapper button[type="submit"]:active,
  footer .gform_wrapper.mora_subscribe_wrapper input[type="submit"]:active,
  footer #gform_submit_button_5:active {
    background: #5a84b8 !important;
    background-color: #5a84b8 !important;
    transform: translateY(0) !important;
    box-shadow: 0 2px 6px rgba(100, 148, 206, 0.3) !important;
  }

  /* Form wrapper with light border */
  .gform_wrapper.mora_subscribe_wrapper {
    background: rgb(30, 28, 58) !important;
    background-color: rgb(30, 28, 58) !important;
    background-image: none !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important; /* Light border on outer edge */
    box-shadow: none !important;
    border-radius: 15px !important;
  }

  /* Keep nested elements without borders */
  footer .gform_wrapper.mora_subscribe_wrapper > *:not(.gform_footer),
  footer div[id*="gform_wrapper"] > *:not(.gform_footer) {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
  }

  /* Footer form mobile border styles */
  footer .gform_wrapper.mora_subscribe_wrapper {
    border-radius: 0 !important;
    border: none !important;
  }

  /* Footer form first field - rounded top corners with borders */
  footer .gform_wrapper.mora_subscribe_wrapper .gfield:first-child {
    border-top-left-radius: 0.5rem !important;
    border-top-right-radius: 0.5rem !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border: 1px solid #e6e6e6 !important;
    border-bottom: 1px solid #e6e6e6 !important;
  }

  /* Footer form middle fields - no rounded corners with left/right/bottom borders */
  footer .gform_wrapper.mora_subscribe_wrapper .gfield:not(:first-child):not(:last-child) {
    border-radius: 0 !important;
    border-left: 1px solid #e6e6e6 !important;
    border-right: 1px solid #e6e6e6 !important;
    border-bottom: 1px solid #e6e6e6 !important;
    border-top: none !important;
  }

  /* Footer form last field - rounded bottom corners with borders */
  footer .gform_wrapper.mora_subscribe_wrapper .gfield:last-child {
    border-bottom-left-radius: 0.5rem !important;
    border-bottom-right-radius: 0.5rem !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    border-left: 1px solid #e6e6e6 !important;
    border-right: 1px solid #e6e6e6 !important;
    border-bottom: 1px solid #e6e6e6 !important;
    border-top: none !important;
  }

  /* Footer form single field - all rounded corners */
  footer .gform_wrapper.mora_subscribe_wrapper .gfield:first-child:last-child {
    border-radius: 0.5rem !important;
    border: 1px solid #e6e6e6 !important;
  }

  /* Footer form footer - no borders on mobile */
  footer .gform_wrapper.mora_subscribe_wrapper .gform_footer {
    border: none !important;
    border-radius: 0 !important;
    margin-top: 1rem !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Additional mobile form improvements */
  .gform_wrapper.mora_subscribe_wrapper .gfield_label {
    color: white !important;
    font-size: 16px !important;
    margin-bottom: 8px !important;
  }

  .gform_wrapper.mora_subscribe_wrapper .gfield_required {
    color: #ff6b6b !important; /* Red color for required asterisk */
  }

  /* Additional aggressive background removal for any nested elements (excluding inputs) */
  footer .gform_wrapper.mora_subscribe_wrapper *:not(input),
  footer .gform_wrapper.mora_subscribe_wrapper *:not(input):before,
  footer .gform_wrapper.mora_subscribe_wrapper *:not(input):after {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
  }

  /* Specifically target any potential form containers */
  footer .gform_wrapper.mora_subscribe_wrapper .gform_body,
  footer .gform_wrapper.mora_subscribe_wrapper .gform_fields,
  footer .gform_wrapper.mora_subscribe_wrapper .gfield_list,
  footer .gform_wrapper.mora_subscribe_wrapper .ginput_complex,
  footer .gform_wrapper.mora_subscribe_wrapper .ginput_full {
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
}

/* Mobile Navigation Sections */
@media (max-width: 767px) {
  /* Navigation section styling - only for sections with sub-links */
  footer .space-y-8 > div:has(ul),
  footer .space-y-8 > div:has(.space-y-3) {
    padding: 1.5rem 1rem;
    border-radius: 0.5rem;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
  }

  /* Sections without sub-links - simple text styling */
  footer .space-y-8 > div:not(:has(ul)):not(:has(.space-y-3)) {
    padding: 0;
    background: none;
    border: none;
    margin-bottom: 2rem;
    text-align: center;
  }

  /* Headings for sections without sub-links */
  footer .space-y-8 > div:not(:has(ul)):not(:has(.space-y-3)) h3 {
    font-size: 1.125rem !important;
    line-height: 1.4 !important;
    font-weight: 700 !important;
    text-align: center !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
    color: #ffffff !important;
  }
  
  /* Navigation headings - only for sections with sub-links */
  footer .space-y-8 > div:has(ul) h3,
  footer .space-y-8 > div:has(.space-y-3) h3 {
    font-size: 1.125rem !important;
    line-height: 1.4 !important;
    font-weight: 700 !important;
    text-align: center !important;
    margin-bottom: 1rem !important;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
  }
  
  /* Navigation links */
  footer .space-y-3 li a,
  footer .space-y-3 li span {
    font-size: 1rem !important;
    line-height: 1.5 !important;
    display: block !important;
    padding: 0.75rem 1rem !important;
    margin: -0.75rem -1rem !important;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
    text-align: center !important;
    color: #EAF3FF !important;
  }
  

  
  /* Consistent vertical spacing */
  footer .space-y-12 > * + * {
    margin-top: 3rem !important;
  }
  
  footer .space-y-8 > * + * {
    margin-top: 2rem !important;
  }
}

/* Mobile Social Media Section */
@media (max-width: 767px) {
  .footer-social-icons {
    padding: 2rem 1rem !important;
    margin-top: 3rem !important;
  }
  
  .footer-social-icons a {
    min-height: 48px !important;
    min-width: 48px !important;
    width: 48px !important;
    height: 48px !important;
  }
  
  .footer-social-icons img {
    width: 20px !important;
    height: 20px !important;
  }
}

/* Mobile Copyright Section */
@media (max-width: 767px) {
  footer .border-t {
    margin-top: 3rem !important;
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
  
  footer .border-t p {
    font-size: 0.875rem !important;
    line-height: 1.6 !important;
    padding: 0 1rem;
  }
}

/* Mobile Back-to-Top Button */
@media (max-width: 767px) {
  .back-to-top-button {
    bottom: 15px !important;
  }
  
  .back-to-top-button a {
    width: 48px !important;
    height: 48px !important;
    background-color: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 50% !important;
  }
  
  .back-to-top-button a:hover,
  .back-to-top-button a:focus {
    background-color: rgba(255, 255, 255, 0.25) !important;
    transform: translateY(-4px) scale(1.05) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
  }
  
  .back-to-top-button img {
    width: 24px !important;
    height: 24px !important;
  }
}

/* Tablet Optimizations */
@media (min-width: 768px) and (max-width: 1023px) {
  footer .md\:grid-cols-2 > div {
    padding: 1rem;
  }
  
  footer .space-y-3 li a {
    padding: 0.5rem 0.75rem !important;
    margin: -0.5rem -0.75rem !important;
    text-align: left !important;
  }
  
  footer h2 {
    font-size: 2rem !important;
    text-align: center !important;
  }
  
  footer h3 {
    font-size: 1rem !important;
    text-align: left !important;
  }
  
  .footer-social-icons a {
    width: 40px !important;
    height: 40px !important;
  }
  
  .footer-social-icons img {
    width: 16px !important;
    height: 16px !important;
  }
}

/* Enhanced Social Media Styling */
.footer-social-icons {
  padding: 1rem 0;
}

.footer-social-icons a {
  position: relative;
  transition: all 0.3s ease;
  transform-origin: center;
}

.footer-social-icons a:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 12px rgba(100, 148, 206, 0.3);
}

.footer-social-icons a:focus {
  outline: 2px solid #6494CE;
  outline-offset: 2px;
}

/* Accessibility improvements */
@media (max-width: 767px) {
  footer a:focus {
    outline: 2px solid #6494CE;
    outline-offset: 2px;
    border-radius: 0.25rem;
  }
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Ensure proper body layout */
body {
  position: static !important;
  height: auto !important;
  min-height: 100vh !important;
}

/* ––––––––––––––––––––––––––––––––––––––––––––– */
/* Teardrop SVG Positioning Fix */
/* ––––––––––––––––––––––––––––––––––––––––––––– */

/* Ensure teardrop SVG doesn't overlap content */
footer .relative {
  position: relative;
}

/* Mobile teardrop adjustments */
@media (max-width: 767px) {
  footer .absolute.top-0 svg {
    width: 20rem !important;
    height: 2.5rem !important;
  }

  footer .absolute.top-0 {
    top: 0 !important;
    margin-top: -3px !important;
  }

  /* Ensure content starts below the teardrop - 120px SVG height + 3rem spacing */
  footer .px-4 {
    padding-top: 11rem !important; /* 176px - enough for 120px teardrop + 3rem spacing */
  }
}

/* Tablet teardrop adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
  footer .absolute.top-0 svg {
    width: 25rem !important;
    height: 2.75rem !important;
  }

  footer .px-4 {
    padding-top: 8rem !important; /* 128px - adjusted for tablet teardrop */
  }

  /* Tablet newsletter form adjustments */
  .gform_wrapper.mora_subscribe_wrapper .gform_button {
    min-width: 220px !important;
    height: 56px !important;
    font-size: 15px !important;
  }
}

/* Desktop - maintain original spacing */
@media (min-width: 1024px) {
  footer .px-4 {
    padding-top: 8rem !important; /* 128px - enough for desktop teardrop + spacing */
  }

  /* Desktop newsletter form adjustments */
  .gform_wrapper.mora_subscribe_wrapper .gform_button {
    min-width: 240px !important;
    height: 52px !important;
    font-size: 14px !important;
  }

  .gform_wrapper.mora_subscribe_wrapper .gform_footer {
    margin-top: 1.5rem !important; /* Less spacing on desktop */
  }
}
