  /* Skip to Chat accessible link */
#skip-to-chat {
  position: fixed;
  top: -100px;
  left: 20px;
  background-color: #cf4311;
  color: white;
  padding: 8px 16px;
  font-family: 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border-radius: 0 0 8px 8px;
  z-index: 999999;
  text-decoration: none;
  transition: top 0.2s ease;
}

#skip-to-chat:focus {
  top: 0;
  outline: 3px solid white;
  outline-offset: 2px;
}

/* Floating Chat Toggle Button */
#agent-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  padding: 0;
  cursor: pointer;
  z-index: 99999;
}

button#agent-toggle {
  background-color: transparent;
  border: none;
  border-radius: 50%;
}

#agent-toggle img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
  display: block;
  animation: pulse 2.5s ease-in-out infinite;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

/*  Removing animation for users with motion sensitivity.  */
@media (prefers-reduced-motion: reduce) {
    #agent-toggle img {
        animation: none;
    }
}

#agent-toggle:hover {
    background-color: rgba(255, 130, 0, 0.1);  
    border-radius: 50% !important; 
     
}

button#agent-toggle:hover {
    /*background-color: rgba(255, 130, 0, 0.1);  */
    /*border-radius: 50% !important; */
    /*outline: 4px solid white;*/
    /*outline: 3px solid #CD451F;*/
    outline: none; /* remove default outline */
    box-shadow: 0 0 0 4px #CD451F, 0 0 0 8px white;  
}

#agent-toggle:hover img {
    /* stops the pulse */
    /*animation: none; */
    /*pauses the pulse */
    animation-play-state: paused;
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(255, 130, 0, 0.6);
}


/*#agent-toggle:focus {*/
/*  outline: 3px solid #ff8200;*/
/*  outline-offset: 4px;*/
/*}*/


#agent-toggle:focus {
  outline: none; /* remove default blue square */
  /*box-shadow:*/
  /*  0 0 0 4px white,       */
  /*  0 0 0 8px #CD451F;      */
  box-shadow: 0 0 0 4px #CD451F, 0 0 0 8px white;    
  border-radius: 50% !important; 
}


/* Backdrop */
#agent-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4); /* Semi-transparent black */
  display: none;
  z-index: 99998;
}


/* Chat Container */
#agent-container {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 300px;
  height: 540px;
  max-height: calc(100vh - 110px);
  display: flex !important;
  flex-direction: column;
  z-index: 99997;
  border-radius: 12px;
  overflow: hidden;
  background-color: #ffffff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 0.3s ease-out;
}

/* Header — ID-qualified to beat external stylesheets that set display:none on .agent-header */
#agent-container .agent-header {
  background-color: #cf4311;
  color: white;
  font-family: 'Segoe UI', sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  padding: 12px 35px 12px 12px;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  position: relative;
  display: block !important;
  flex-shrink: 0;
}

/* Iframe wrapper — clips the iframe so resource/citation panel content
   cannot scroll behind the header or off-screen. */
#agent-iframe-wrapper {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* Iframe — negative margin hides Microsoft's internal webchat header bar */
#agent-container iframe {
  display: block;
  border: none;
  width: 100%;
  margin-top: -80px;
  height: calc(100% + 80px);
}

/* Resize Handle */
#agent-resize-handle {
  position: absolute;
  left: 0;
  top: 0;
  width: 10px;
  height: 100%;
  cursor: ew-resize;
  z-index: 10;
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
  background: rgba(207, 67, 17, 0.18);
  border-right: 2px solid rgba(207, 67, 17, 0.35);
  transition: background 0.2s ease, border-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Grip lines */
#agent-resize-handle::after {
  content: '';
  display: block;
  width: 2px;
  height: 28px;
  border-radius: 2px;
  box-shadow:
    -3px 0 0 rgba(207, 67, 17, 0.6),
     3px 0 0 rgba(207, 67, 17, 0.6),
     0   0 0 1px rgba(207, 67, 17, 0.6);
}

#agent-resize-handle:hover {
  background: rgba(207, 67, 17, 0.35);
  border-right-color: rgba(207, 67, 17, 0.7);
}

#agent-resize-handle:active {
  background: rgba(207, 67, 17, 0.5);
  border-right-color: #cf4311;
}

@media (max-width: 480px) {
  #agent-resize-handle {
    display: none;
  }
}

/* Reduce header at high zoom (200%+) — effective viewport ~700px and below */
@media (max-width: 700px) {
  #agent-container .agent-header {
    font-size: 14px;
    padding: 9px 35px 9px 10px;
  }
}

/* Reduce header at very high zoom (300%+) — effective viewport ~450px and below */
@media (max-width: 450px) {
  #agent-container .agent-header {
    font-size: 12px;
    padding: 7px 35px 7px 8px;
  }
}

/* 400% zoom on 1280px screen — effective viewport 320x256px */
@media (max-width: 360px) {
  #agent-container .agent-header {
    font-size: 11px;
    padding: 4px 30px 4px 6px;
  }
  #agent-container {
    bottom: 75px;
    max-height: calc(100vh - 88px);
  }
  #agent-container iframe {
    margin-top: -56px;
    height: calc(100% + 56px);
  }
}

/* Animations */
@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(255, 130, 0, 0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 12px rgba(255, 130, 0, 0.6); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(255, 130, 0, 0.4); }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  #agent-container {
    bottom: 90px;
    right: 0;
    left: 16px;
    width: 89%;
    height: 61%;
    border-radius: 0;
    max-height: 100vh;
    overflow: hidden;
  }

  #agent-container iframe {
    margin-top: -100px; /* extra buffer hides MS header at 150% zoom on mobile */
    height: calc(100% + 100px);
  }

  #agent-container .agent-header {
    border-radius: 0;
    font-size: 14px;
    padding: 8px 35px 8px 8px;
  }

  #agent-toggle {
    bottom: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
  }
}

/* Accessibility: Focus styles for modal elements */
#agent-container button:focus,
#agent-container a:focus,
#agent-container input:focus,
#agent-container select:focus,
#agent-container textarea:focus,
#agent-container iframe:focus {
    outline: 3px solid #ff8200;
    outline-offset: 4px;
    border-radius: 4px;
}

#closeChatbot{
    position: absolute;
    top: 4px !important;
    height: 32px;
    background-color: #cf4311 !important;
    /*border: none !important;*/
    color: #fff !important;
    font-size: 20px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}
#closeChatbot:focus {
        /*outline: #ffffff  solid 3px !important;*/
        outline: none !important;
}