/* Shared performance and layout fixes */
.navbar-akeda .container-fluid {
  position: relative;
}

.navbar-akeda {
  padding-top: 0.3rem !important;
  padding-bottom: 0.3rem !important;
  background: #fff !important;
  box-shadow: 0 5px 20px rgba(10, 57, 109, 0.07);
  transition: padding 260ms ease, box-shadow 260ms ease, background-color 260ms ease !important;
}

/* Keep the brand directly on the white header; the old JPG contains a circle. */
.navbar-akeda .navbar-brand {
  display: inline-flex !important;
  align-items: center;
  min-width: 74px;
  padding: 0.2rem 0 !important;
  line-height: 1;
  text-decoration: none;
}

.navbar-akeda .navbar-brand img {
  content: url("images/AKEDA-LOGO-TRANSPARENT.png");
  display: block !important;
  width: 88px !important;
  height: 88px !important;
  max-height: none !important;
  object-fit: contain;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  filter: saturate(1.5) contrast(1.12);
  transition: width 260ms ease, height 260ms ease, filter 260ms ease !important;
}

.navbar-akeda .navbar-brand::before {
  content: none;
}

.navbar-akeda .navbar-brand::after {
  content: none;
}

.navbar-akeda.scrolled {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  box-shadow: 0 10px 28px rgba(10, 57, 109, 0.13);
}

.navbar-akeda.scrolled .navbar-brand img {
  width: 56px !important;
  height: 56px !important;
  filter: saturate(1.55) contrast(1.14);
}

.navbar-akeda .nav-link {
  text-align: center;
  white-space: nowrap;
}

.navbar-akeda .language-switcher {
  margin-left: auto;
}

@media (min-width: 992px) {
  .navbar-akeda .navbar-collapse {
    position: absolute;
    left: 50%;
    width: max-content;
    flex-grow: 0;
    transform: translateX(-50%);
  }

  .navbar-akeda .navbar-nav {
    align-items: center;
    justify-content: center;
    margin: 0 !important;
  }
}

@media (max-width: 991.98px) {
  .navbar-akeda .container-fluid {
    flex-wrap: nowrap;
  }

  .navbar-akeda .navbar-collapse {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    transform: none;
    background: #fff;
    box-shadow: 0 12px 22px rgba(10, 57, 109, 0.1);
  }

  .navbar-akeda .navbar-nav {
    padding: 12px 0 8px;
  }

  .navbar-akeda .language-switcher {
    gap: 2px;
    margin: 0 4px 0 auto;
  }

  .navbar-akeda .flip-card {
    width: 38px;
  }

  .navbar-akeda .navbar-toggler {
    flex: 0 0 auto;
    margin-left: 2px;
  }
}

/* The hero always has a usable first paint; video fades in only when playing. */
.video-loading {
  display: none !important;
}

#hero-video {
  position: relative;
  z-index: 1;
  opacity: 0;
  background: #0d325a;
  transition: opacity 420ms ease;
}

#hero-video.is-ready {
  opacity: 1;
}

#hero-video ~ .fallback-image {
  display: block !important;
  z-index: 0;
  opacity: 1;
  visibility: visible;
  transition: opacity 420ms ease, visibility 420ms ease;
}

#hero-video ~ .fallback-image.is-hidden {
  opacity: 0;
  visibility: hidden;
}

/* Service and contact hero images must sit above their decorative fallback. */
.hero-background > img {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative;
  z-index: 1;
}

/* Palma-style assistant, adapted to AKEDA colours. */
.ai-chat-btn {
  bottom: 24px !important;
  left: 24px !important;
  width: auto !important;
  height: 50px !important;
  min-width: 132px;
  padding: 0 18px 0 14px !important;
  gap: 10px;
  border: 0 !important;
  border-radius: 999px !important;
  background: linear-gradient(135deg, #0a396d, #15589a) !important;
  box-shadow: 0 10px 30px rgba(10, 57, 109, 0.3) !important;
  color: #fff;
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  z-index: 10009 !important;
}

.ai-chat-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 14px 34px rgba(10, 57, 109, 0.38) !important;
}

.ai-chat-btn:focus-visible {
  outline: 3px solid rgba(244, 122, 32, 0.45);
  outline-offset: 3px;
}

.ai-chat-btn.is-hidden {
  display: none !important;
}

.ai-chat-btn > svg {
  display: none;
}

.ai-chat-btn .ai-pulse {
  position: static !important;
  width: 10px !important;
  height: 10px !important;
  flex: 0 0 10px;
  border: 2px solid rgba(255, 255, 255, 0.9) !important;
  background: #f47a20 !important;
  animation: none !important;
}

.ai-chat-btn .ai-label {
  white-space: nowrap;
}

.ai-chat-window {
  bottom: 24px !important;
  left: 24px !important;
  width: 370px !important;
  height: min(540px, calc(100vh - 48px)) !important;
  border: 1px solid rgba(10, 57, 109, 0.1);
  border-radius: 20px !important;
  box-shadow: 0 24px 70px rgba(10, 35, 66, 0.24) !important;
  overflow: hidden;
  z-index: 10010 !important;
}

.ai-chat-header {
  min-height: 76px;
  padding: 15px 17px !important;
  background: linear-gradient(135deg, #0a396d, #15589a) !important;
}

.ai-chat-header-avatar {
  width: 42px !important;
  height: 42px !important;
  flex: 0 0 42px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14) !important;
  color: #fff;
  font-size: 1rem !important;
  font-weight: 900;
}

.ai-chat-header-info h6 {
  font-size: 0.94rem !important;
}

.ai-chat-header-info span {
  color: rgba(255, 255, 255, 0.76) !important;
}

.ai-chat-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0 !important;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.11);
}

.ai-chat-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.ai-chat-messages,
.ai-quick-btns {
  background: #f5f7fa !important;
}

.ai-chat-messages {
  padding: 18px !important;
  gap: 12px !important;
}

.ai-msg {
  border-radius: 16px !important;
  font-size: 0.84rem !important;
}

.ai-msg.bot {
  border: 1px solid rgba(10, 57, 109, 0.08);
  border-bottom-left-radius: 5px !important;
  box-shadow: 0 5px 16px rgba(10, 35, 66, 0.06) !important;
}

.ai-msg.user {
  border-bottom-right-radius: 5px !important;
  background: linear-gradient(135deg, #0a396d, #15589a) !important;
}

.ai-quick-btns {
  padding: 2px 16px 12px !important;
  gap: 7px !important;
}

.ai-quick-btn {
  padding: 7px 11px !important;
  border: 1px solid rgba(10, 57, 109, 0.18) !important;
  background: #fff !important;
}

.ai-quick-btn:hover {
  border-color: #0a396d !important;
  background: #0a396d !important;
}

.ai-chat-input-row {
  padding: 13px 14px !important;
  border-top-color: #e6ebf1 !important;
}

.ai-chat-input {
  min-width: 0;
  padding: 10px 15px !important;
  border-color: #dce3ec !important;
  background: #f8fafc;
}

.ai-send-btn {
  width: 40px !important;
  height: 40px !important;
  background: linear-gradient(135deg, #f47a20, #ff9a46) !important;
  box-shadow: 0 6px 16px rgba(244, 122, 32, 0.24);
}

@media (max-width: 480px) {
  .navbar-akeda .navbar-brand {
    min-width: 0;
  }

  .navbar-akeda .navbar-brand img {
    width: 72px !important;
    height: 72px !important;
  }

  .navbar-akeda.scrolled .navbar-brand img {
    width: 50px !important;
    height: 50px !important;
  }

  .ai-chat-btn {
    bottom: 18px !important;
    left: 16px !important;
  }

  .ai-chat-window {
    left: 10px !important;
    bottom: 10px !important;
    width: calc(100vw - 20px) !important;
    height: min(560px, calc(100vh - 20px)) !important;
  }
}

img,
video {
  image-rendering: auto;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* Footer developer contact links */
.footer-credit-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 8px;
  font-size: 0.9rem;
}

.footer-credit-links a {
  color: inherit;
  text-decoration: none;
  opacity: 0.82;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.footer-credit-links a:hover,
.footer-credit-links a:focus-visible {
  color: #f28c28;
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}
