/* =======================
   FOOTER (CLEAN + ANIMATED + MOBILE 2-COLUMN SUPPORT/NEWSLETTER)
   Matches your HTML exactly
   Animations: gentle gradient drift + floating glow orbs + shimmer accent line
   ======================= */

/* ---------- FOOTER BASE ---------- */
footer{
  position: relative;
  overflow: hidden;
  z-index: 2;
  margin-top: 0 !important;

  padding: 2.2rem 0;

  background: linear-gradient(135deg,
    var(--ahda-teal) 0%,
    #0d5a75 40%,
    #10685e 70%,
    #0B4F66 100%);
  color: var(--ahda-white);
}

/* Subtle texture dots (static, very light) */
footer::before{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.03) 1px, transparent 2px),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,.03) 1px, transparent 2px);
  background-size: 100px 100px, 120px 120px;
  opacity: .30;
  pointer-events:none;
  z-index:0;
}

/* Floating glow orbs (animated) */
footer::after{
  content:"";
  position:absolute;
  inset:-25%;
  pointer-events:none;
  z-index:0;
  opacity: .45;
  filter: blur(18px);

  background:
    radial-gradient(circle at 18% 30%, rgba(245,123,44,.22) 0%, transparent 36%),
    radial-gradient(circle at 82% 40%, rgba(20,119,109,.22) 0%, transparent 38%),
    radial-gradient(circle at 55% 85%, rgba(11,79,102,.25) 0%, transparent 40%);

  animation: footerOrbs 10s ease-in-out infinite;
}

/* Container above overlays */
footer .container{
  position: relative;
  z-index: 1;
}

/* Top accent line + shimmer sweep */
footer .container::before{
  content:"";
  position:absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 3px;
  border-radius: 0 0 2px 2px;

  background: linear-gradient(90deg,
    transparent,
    var(--ahda-orange) 30%,
    var(--ahda-maroon) 50%,
    var(--ahda-orange) 70%,
    transparent);

  box-shadow: 0 2px 8px rgba(245,123,44,.40);
  overflow: hidden;
}

/* Shimmer overlay on the accent line */
footer .container::after{
  content:"";
  position:absolute;
  top: -10px;
  left: 10%;
  width: 30%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  opacity: .55;
  pointer-events:none;
  animation: footerShimmer 3.6s ease-in-out infinite;
}

/* ---------- LOGO (NO HOVER EFFECT) ---------- */
.footer-logo-container{
  display: inline-block;
  max-width: 200px;
  margin-bottom: 15px;
}

.footer-logo{
  width: 100%;
  height: auto;
  display: block;
  background: transparent !important;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.30)) brightness(1.1) contrast(1.1);
  transition: none !important;
}

.footer-logo-container:hover .footer-logo{
  transform: none !important;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.30)) brightness(1.1) contrast(1.1) !important;
}

/* ---------- TEXT / HEADINGS / LINKS ---------- */
.footer-text{
  color: rgba(255,255,255,.95);
  line-height: 1.6;
  font-size: .95rem;
  font-weight: 400;
  text-shadow: 0 1px 2px rgba(0,0,0,.20);
  margin-bottom: 15px;

  /* subtle entrance */
  animation: footerFadeUp .75s ease both;
}

.footer-heading{
  color: var(--ahda-white);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 15px;
  text-shadow: 0 2px 3px rgba(0,0,0,.30);
  display: flex;
  align-items: center;
  gap: 8px;

  animation: footerFadeUp .75s ease both;
  animation-delay: .05s;
}
.footer-heading i{ color: var(--ahda-orange); }

.footer-small{
  color: rgba(255,255,255,.70) !important;
  font-size: .8rem;
  display: block;
  margin-top: 8px;
}

.footer-link{
  color: rgba(255,255,255,.82) !important;
  text-decoration: none;
  font-size: .9rem;
  transition: transform .2s ease, color .2s ease;
}
.footer-link:hover{
  color: var(--ahda-white) !important;
  transform: translateX(2px);
}
.footer-link i{ color: var(--ahda-orange); }

/* ---------- QUICK LINKS ---------- */
.footer-links-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.quick-link-item{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding: 12px 8px;
  background: rgba(255,255,255,.08);
  border-radius: 10px;
  color: rgba(255,255,255,.90);
  text-decoration:none;
  transition: transform .25s ease, background .25s ease;
  position: relative;
  height: 100%;

  /* subtle “breathing” */
  animation: footerBreath 5.5s ease-in-out infinite;
  will-change: transform;
}
.quick-link-item:nth-child(2){ animation-delay: .4s; }
.quick-link-item:nth-child(3){ animation-delay: .8s; }
.quick-link-item:nth-child(4){ animation-delay: 1.2s; }
.quick-link-item:nth-child(5){ animation-delay: 1.6s; }

.quick-link-item i{
  font-size: 1.3rem;
  color: rgba(255,255,255,.90);
  margin-bottom: 6px;
  transition: transform .25s ease, color .25s ease;
}
.quick-link-item .link-text{
  font-size: .8rem;
  font-weight: 600;
  text-align:center;
  line-height: 1.2;
}
.quick-link-item:hover{
  background: rgba(255,255,255,.15);
  transform: translateY(-2px);
  color: var(--ahda-white);
}
.quick-link-item:hover i{
  color: var(--ahda-orange);
  transform: scale(1.08);
}

/* tooltip */
.link-tooltip{
  position: absolute;
  top: -35px;
  left: 50%;
  transform: translateX(-50%) scale(.9);
  background: rgba(11,79,102,.95);
  color: var(--ahda-white);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all .2s ease;
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,.30);
  border: 1px solid rgba(255,255,255,.15);
  backdrop-filter: blur(10px);
}
.link-tooltip::after{
  content:"";
  position:absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: rgba(11,79,102,.95) transparent transparent transparent;
}
.link-tooltip.visible{
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) scale(1);
  top: -40px;
}

/* ---------- SUPPORT CARD ---------- */
.support-section{
  background: linear-gradient(135deg, rgba(245,123,44,.15), rgba(172,26,44,.10));
  padding: 20px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.15);
  text-align: center;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;

  animation: footerFadeUp .75s ease both;
  animation-delay: .1s;
}
.support-section:hover{
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(245,123,44,.20);
  border-color: rgba(245,123,44,.30);
}
.support-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--ahda-orange), var(--ahda-maroon));
  border-radius: 50%;
  color: var(--ahda-white);
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(245,123,44,.40);
  transition: transform .25s ease;

  /* pulse */
  animation: footerPulse 3.2s ease-in-out infinite;
}
.support-section:hover .support-icon{ transform: scale(1.08); }

.btn-support{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 100%;
  margin-top: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  text-decoration:none;
  font-weight: 800;
  font-size: .95rem;
  color: var(--ahda-white);
  background: linear-gradient(135deg, var(--ahda-orange), var(--ahda-maroon));
  box-shadow: 0 4px 12px rgba(245,123,44,.30);
  transition: transform .25s ease, filter .25s ease, box-shadow .25s ease;
}
.btn-support:hover{
  filter: brightness(1.05);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(245,123,44,.40);
  color: var(--ahda-white);
}

/* ---------- NEWSLETTER FORM ---------- */
.footer-newsletter .input-group{
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.20);
  background: rgba(255,255,255,.10);
  box-shadow: 0 4px 12px rgba(0,0,0,.20);
  backdrop-filter: blur(5px);
}
.footer-newsletter .form-control{
  border: none;
  background: transparent;
  color: var(--ahda-white);
  height: 44px;
  padding: 10px 15px;
  font-size: .9rem;
}
.footer-newsletter .form-control::placeholder{
  color: rgba(255,255,255,.60);
}
.footer-newsletter .form-control:focus{
  background: rgba(255,255,255,.12);
  color: var(--ahda-white);
  box-shadow: none;
}

/* arrow wiggle */
.btn-newsletter{
  border: none;
  min-width: 44px;
  padding: 0 18px;
  display:flex;
  align-items:center;
  justify-content:center;
  color: var(--ahda-white);
  background: linear-gradient(135deg, var(--ahda-orange), var(--ahda-maroon));
  transition: transform .25s ease, filter .25s ease;
}
.btn-newsletter:hover{
  transform: translateX(2px);
  filter: brightness(1.05);
}
.btn-newsletter i{
  display:inline-block;
  animation: footerArrow 2.2s ease-in-out infinite;
}

/* ---------- COPYRIGHT ---------- */
.border-white-10{ border-color: rgba(255,255,255,.15) !important; }
.footer-links-small{ font-size: .85rem; }

/* ---------- BACK TO TOP ---------- */
.back-to-top{
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--ahda-orange);
  color: var(--ahda-white);
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 1.3rem;
  cursor:pointer;
  opacity: 0;
  visibility: hidden;
  transition: all .3s ease;
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(245,123,44,.40);
  border: 2px solid rgba(255,255,255,.90);
}
.back-to-top.visible{
  opacity: 1;
  visibility: visible;
}
.back-to-top:hover{
  background: #e06a1f;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(245,123,44,.50);
}

/* =====================================================
   MOBILE: Make Support + Newsletter SAME ROW
   ===================================================== */
@media (max-width: 767px){

  footer{
    padding: 1.35rem 0 !important;
  }

  .footer-logo-container{
    max-width: 160px;
    margin: 0 auto 1rem;
  }

  footer .col-lg-8 > .row.g-3{
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 12px !important;
    align-items: stretch;
  }

  footer .col-lg-8 > .row.g-3 > .col-lg-4.col-md-6.col-12.mb-3:first-child{
    grid-column: 1 / -1;
  }

  footer .col-lg-8 > .row.g-3 > .col-lg-4.col-md-6.col-12.mb-3:nth-child(2){
    grid-column: 1 / 2;
  }
  footer .col-lg-8 > .row.g-3 > .col-lg-4.col-md-12.col-12.mb-3:nth-child(3){
    grid-column: 2 / 3;
  }

  footer .col-lg-8 > .row.g-3 > [class*="col-"]{
    margin-bottom: 0 !important;
  }

  .support-section{
    text-align: left !important;
    padding: 14px !important;
    display:flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 170px;
  }

  .support-icon{
    width: 42px !important;
    height: 42px !important;
    font-size: 1.2rem !important;
    margin-bottom: 10px !important;
  }

  .support-section .footer-heading{
    font-size: .95rem !important;
    margin-bottom: 6px !important;
  }

  .support-section .footer-text{
    font-size: .82rem !important;
    line-height: 1.35 !important;
    margin-bottom: 0 !important;
  }

  .btn-support{
    font-size: .88rem !important;
    padding: 9px 12px !important;
    margin-top: 10px !important;
  }

  .footer-newsletter .input-group{
    flex-wrap: nowrap !important;
  }
  .footer-newsletter .form-control{
    height: 40px !important;
    padding: 8px 12px !important;
    font-size: .85rem !important;
  }
  .btn-newsletter{
    min-width: 42px !important;
    padding: 0 14px !important;
  }

  .footer-links-grid{
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .quick-link-item{
    padding: 10px 6px;
    min-height: 70px;
  }
  .quick-link-item i{
    font-size: 1.2rem;
    margin-bottom: 4px;
  }
  .quick-link-item .link-text{
    font-size: .75rem;
  }

  footer .row.mt-4{
    margin-top: 1rem !important;
  }
  footer .pt-3{
    padding-top: .85rem !important;
  }

  .back-to-top{
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    bottom: 15px;
    right: 15px;
  }
}

/* Very small phones: stack support/newsletter */
@media (max-width: 360px){
  footer .col-lg-8 > .row.g-3{
    grid-template-columns: 1fr !important;
  }
  footer .col-lg-8 > .row.g-3 > .col-lg-4.col-md-12.col-12.mb-3:nth-child(3){
    grid-column: 1 / -1;
  }
  footer .col-lg-8 > .row.g-3 > .col-lg-4.col-md-6.col-12.mb-3:nth-child(2){
    grid-column: 1 / -1;
  }

  .footer-links-grid{ grid-template-columns: repeat(2, 1fr); }
}

/* ---------- KEYFRAMES (ANIMATIONS) ---------- */
@keyframes footerOrbs{
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(-18px, 10px, 0) scale(1.03); }
  100% { transform: translate3d(0,0,0) scale(1); }
}

@keyframes footerShimmer{
  0%   { left: 10%; opacity: .15; }
  45%  { opacity: .55; }
  100% { left: 75%; opacity: .15; }
}

@keyframes footerFadeUp{
  from{ opacity: 0; transform: translateY(10px); }
  to{ opacity: 1; transform: translateY(0); }
}

@keyframes footerBreath{
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}

@keyframes footerPulse{
  0%, 100% { transform: scale(1);   box-shadow: 0 4px 12px rgba(245,123,44,.35); }
  50%      { transform: scale(1.06); box-shadow: 0 8px 18px rgba(245,123,44,.45); }
}

@keyframes footerArrow{
  0%, 100% { transform: translateX(0); opacity: 1; }
  50%      { transform: translateX(2px); opacity: .95; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  footer::after,
  footer .container::after,
  .quick-link-item,
  .support-icon,
  .btn-newsletter i,
  .footer-text,
  .footer-heading{
    animation: none !important;
  }

  *, *::before, *::after{
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}