/* Uitagenda Chatbot stylesheet (extracted from userscript) */

#ua-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 500px;
    background: #100e41;
    border: none;
    border-radius: 20px;
    box-shadow: 0 4px 32px 0 rgba(16,14,65,0.18);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    font-family: var(--font-body, 'Inter', 'Segoe UI', Arial, sans-serif);
    max-height: 80vh;
}
#ua-chatbot-header{
    color: #bfa3f7;
    padding: 18px 24px 12px 24px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    font-size: 2em;
    font-weight: 700;
    letter-spacing: -1px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-heading, 'Inter', 'Segoe UI', Arial, sans-serif);
}
#ua-chatbot-close-btn, #ua-chatbot-open-btn {
    background-color: #bfa3f7;
    color: #100e41;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 2em;
    font-weight: 700;
    line-height: 1;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    cursor: pointer;
    user-select: none;
}
#ua-chatbot-body {
    display: none;
    flex: 1;
    padding: 0 24px 0 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
#ua-chatbot-messages {
    display: flex;
    flex-direction: column;
    margin-top: 12px;
    margin-bottom: 12px;

}
.ua-chatbot-bubble {
    margin: 8px 0;
    border-radius: 14px;
    max-width: 90%;
    word-wrap: break-word;
    font-size: 1.1em;
    box-shadow: none;

    /* Enter animation on create */
    opacity: 0;
    transform: translateY(8px) scale(0.98);
    animation: ua-chatbot-bubble-in 260ms cubic-bezier(.22,.61,.36,1) forwards;
}
.ua-chatbot-bubble.ua-chatbot-user {
    padding: 16px 18px;
    background: #fff;
    color: #2d174d;
    align-self: flex-end;
    border: 1.5px solid #bfa3f7;
}
.ua-chatbot-bubble.ua-chatbot-bot {
    padding: 16px 18px;
    background: #fff;
    color: #2d174d;
    align-self: flex-start;
    border-radius: 14px;
    box-shadow: 0 2px 8px 0 rgba(16,14,65,0.08);
}
.ua-chatbot-bubble.ua-chatbot-highlight {
    padding: 16px 18px;
    background: #FFFF5D;
    color: #2d174d;
    font-weight: 500;
    border-radius: 12px;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px 0 rgba(16,14,65,0.08);
}
.ua-chatbot-bubble.ua-chatbot-loading {
    background: transparent;
    color: #bfa3f7;
    font-style: normal;
    align-self: flex-start;
    font-size: 2em;
}
.ua-chatbot-bubble.ua-chatbot-bubble-event {
    background: #fff;
    padding: 0;
    box-shadow: 0 2px 8px 0 rgba(16,14,65,0.08);
    border-radius: 14px;
    overflow:hidden;
}

@keyframes ua-chatbot-blink { 0%,100% { opacity: 0; } 50% {opacity: 1;} }
.ua-chatbot-bubble.ua-chatbot-loading::after { content: "..."; animation: ua-chatbot-blink 1s infinite;}

/* Bubble enter animation */
@keyframes ua-chatbot-bubble-in {
    0% {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
        filter: blur(2px);
    }
    60% {
        opacity: 1;
        transform: translateY(0) scale(1.01);
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .ua-chatbot-bubble {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }
}
.ua-chatbot-bubble img,
.ua-chatbot-img {
    margin:10px 0;
    display:block;
    border-radius:10px;
}
/* Event bubble (appendEvent) */
.ua-chatbot-event-bubble {
    background: #fff;
    padding: 0;
    box-shadow: 0 2px 8px 0 rgba(16,14,65,0.08);
    border-radius: 16px;
    margin: 12px 0;
    max-width: 100%;
    overflow: hidden;
    align-self: flex-start;
}
.ua-chatbot-event-image-container {
    width: 100%;
    height: 220px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eee;
}
.ua-chatbot-event-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ua-chatbot-event-content {
    padding: 18px 18px 14px 18px;
}
.ua-chatbot-event-title {
    font-size: 1.15em;
    font-weight: 700;
    margin-bottom: 4px;
    color: #2d174d;
}
.ua-chatbot-event-date,
.ua-chatbot-event-time {
    font-size: 1em;
    color: #2d174d;
    margin-bottom: 2px;
}
.ua-chatbot-event-date-label,
.ua-chatbot-event-date-value {
    font-weight: 600;
}
.ua-chatbot-event-more-dates {
    margin-top: 4px;
    font-size: 0.95em;
    color: #6b5a88;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.ua-chatbot-event-more-dates-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #efe9ff;
    color: #6b5a88;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    line-height: 18px;
}
.ua-chatbot-event-location {
    font-size: 1em;
    color: #2d174d;
    margin-bottom: 6px;
}
.ua-chatbot-event-description {
    font-size: 1em;
    color: #2d174d;
    margin-bottom: 8px;
}
.ua-chatbot-event-links {
    margin-top: 8px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.ua-chatbot-event-link {
    color: #2d174d;
    text-decoration: underline;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
#ua-chatbot-input-container {
    display: flex;
    border-top: none;
    padding: 18px 24px 18px 24px;
    background: #fff;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    align-items: center;
    gap: 12px;
}
#ua-chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    outline: none;
    border-radius: 8px;
    font-size: 1.1em;
    background: #f7f7ff;
    color: #2d174d;
}
#ua-chatbot-send {
    padding: 12px 28px 12px 20px;
    background: #100e41;
    color: #FFFF5D;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    position: relative;
    transition: background 0.2s;
}
#ua-chatbot-send::after {
    content: '';
    display: inline-block;
    border: solid #ff2d7a;
    border-width: 0 3px 3px 0;
    padding: 4px;
    margin-left: 10px;
    transform: rotate(-45deg) translateY(-2px);
    vertical-align: middle;
}
#ua-chatbot-send:hover {
    background: #2d174d;
}
.ua-chatbot-options {
    margin: 0 0 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.ua-chatbot-btn {
    background-color: #bfa3f7;
    color: #2d174d;
    border: none;
    border-radius: 12px;
    padding: 10px 22px;
    font-size: 1.08em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s;
    box-shadow: 0 1px 4px 0 rgba(16,14,65,0.06);
}
.ua-chatbot-btn:hover {
    background-color: #FFFF5D;
    color: #2d174d;
}
/* Minimized-only (+) mode: collapse to just the plus button without header */
/* When the minimized header is visible (inline style "display:flex" is set by JS),
   shrink the container and hide the minimized heading text */
#ua-chatbot-container:has(#ua-chatbot-minimized-header[style*="display:flex"]) {
    width: auto;
    background: transparent;
    box-shadow: none;
    border: none;
    border-radius: 0;
    /* ensure tight fit around the button */
    padding: 0;
}

/* Hide the minimized heading label entirely */
#ua-chatbot-minimized-header[style*="display:flex"] #ua-chatbot-minimized-heading {
    display: none !important;
}

/* Make the minimized header itself just a compact area for the button */
#ua-chatbot-minimized-header {
    padding: 0;
    background: transparent;
}

/* Style the "+" open button to be a floating circular button */
#ua-chatbot-open-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 28px;
    background-color: #bfa3f7;
    color: #100e41;
    box-shadow: 0 6px 22px rgba(16,14,65,0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Optional: hover effect for the floating button */
#ua-chatbot-open-btn:hover {
    filter: brightness(0.95);
}
/* Strong minimized state using container class set by JS (setMinimized) */
#ua-chatbot-container.ua-minimized {
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  pointer-events: none; /* prevent invisible 500px box from capturing clicks */
}

/* Only the + button remains interactive/visible */
#ua-chatbot-container.ua-minimized #ua-chatbot-minimized-header {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
}
#ua-chatbot-container.ua-minimized #ua-chatbot-minimized-heading {
  display: none !important; /* hide "Vraag het Uitagenda! ✨" */
}

/* Floating + button styling and interactivity while minimized */
#ua-chatbot-container.ua-minimized #ua-chatbot-open-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-size: 28px;
  background-color: #bfa3f7;
  color: #100e41;
  box-shadow: 0 6px 22px rgba(16,14,65,0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto; /* re-enable pointer events on the button */
}
#ua-chatbot-container.ua-minimized #ua-chatbot-open-btn:hover {
  filter: brightness(0.95);
}
#ua-chatbot-container.ua-minimized #ua-chatbot-open-btn svg {
    width: 34px;
    height: 34px;
}

/* Mobile full-screen experience */
@media (max-width: 640px) {
#ua-chatbot-send {
    padding: 7px 7px 7px 7px;
}
  /* Fullscreen, respect safe areas */
  #ua-chatbot-container {
    position: fixed;
    inset: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
    top: 0; right: 0; bottom: 0; left: 0;
    width: 100vw;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
  }

  /* Sticky header at top */
  #ua-chatbot-header{
    position: sticky;
    top: 0;
    z-index: 2;
    padding-top: calc(18px + env(safe-area-inset-top, 0));
  }

  /* Scroll messages; leave space for sticky input */
  #ua-chatbot-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px;
    padding-bottom: 120px; /* prevent overlap with sticky input */
  }

  /* Sticky input at bottom */
  #ua-chatbot-input-container {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0));
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding: 10px 10px 10px 10px;
    box-shadow: 0 -2px 12px rgba(16,14,65,0.06);
  }

  /* Minimized FAB stays bottom-right with proper spacing */
  #ua-chatbot-container.ua-minimized {
    position: fixed;
    inset: auto auto calc(16px + env(safe-area-inset-bottom, 0)) calc(16px + env(safe-area-inset-left, 0));
    bottom: calc(16px + env(safe-area-inset-bottom, 0));
    right: calc(16px + env(safe-area-inset-right, 0));
    left: auto;
    top: auto;
    width: auto !important;
    height: auto !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  
  #ua-chatbot-header{
    font-size: 1.8em;
  }
}