/* File: summaries/css/summaries.css */

#textAbove,
#textAbove p {
  margin-bottom: 10px;
  padding: 10px;
  /* overflow: hidden; */
  white-space: pre-wrap;
  background-color: #fcfcfc;
  /* animation: typing 2s steps(30, end); */
}

@keyframes revealText {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

#textAbove p {
  animation: revealText 2s steps(30, end);
}

#bottomForm {
  width: 80%;
  max-width: 500px;
  background-color: #f0f0f0;
  padding: 15px;
  border-radius: 8px;
}

#bottomInput {
  width: 100%;
}

#chatContainer {
  margin-bottom: 10px;
  padding: 10px;
  white-space: pre-wrap;
  background-color: #ffffff;
  /* animation: typing 2s steps(30, end); */
}

#processingContainer {
  padding: 10px 30px 10px 10px;
  white-space: pre-wrap;
  background-color: #ffffff;
}

.input-box {
  margin-bottom: 10px; /* Adjust as needed */
  padding: 5px;
  border: 1ps solid #eee;
}

/* Container styling for the processing status text */
.processing-status {
  flex: auto;
  font-size: 0.825rem;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  color: #838383;
}

/* Typewriter effect for the status message text without a blinking cursor */
.scrolling-text {
  display: inline-block;
  overflow: hidden; /* Clip the text as it types */
  white-space: nowrap; /* Prevent wrapping */
  /* Remove the border-right (caret) and the blink animation */
  animation: typing 3s steps(30, end) forwards;
}

/* Keyframes for the typing animation */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

/* Keyframes for the caret blink animation */
@keyframes blink-caret {
  from,
  to {
    border-color: transparent;
  }
  50% {
    border-color: #838383;
  }
}

.prompt-processing-buttons {
  margin-top: 0.25rem;
}

.prompt-processing-buttons input {
  margin-right: 0.25rem;
  overflow: hidden;
  --tw-bg-opacity: 1;
  padding: 1rem;
  --tw-text-opacity: 1;
  /* background-color: rgba(241, 241, 241, var(--tw-bg-opacity)); */
  background: none;
}

.processing-button.tw-inline-flex {
  flex: initial;
  position: relative;
  margin-right: 30px;
  width: 2rem;
  height: 2rem;
  overflow: hidden;
  --tw-bg-opacity: 1;
  --tw-text-opacity: 1;
  color: #838383;
  border: none;
}

.processing-button.tw-inline-flex:hover {
  /* Reset the custom property to none (or 0 0 #0000) */
  --tw-shadow: none;
  /* Force the box-shadow to none as well */
  box-shadow: none;
  --tw-bg-opacity: 1;
  background-color: rgba(248, 250, 252, var(--tw-bg-opacity));
}

/* Add the icon via ::before */
.processing-button.tw-inline-flex::before {
  /* "Font Awesome 6 Free"/"Font Awesome 6 Pro"/"Font Awesome 6 Thin" - depends on your setup */
  font-family: "Font Awesome 6 Pro";
  font-weight: 100;
  content: "\f2ed";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  /* Align style with Tailwind utility approach */
  font-size: 1.25rem;
  color: #636c7b;
  text-indent: 0;
}

/* Ensure the wrapper is positioned relatively */
.trash-button-wrapper {
  position: relative;
  width: 2rem; /* Match the button's size */
  height: 2rem;
  margin-right: 2rem;
}

/* Position the icon over the button */
.trash-button-wrapper i {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none; /* Prevent the icon from intercepting clicks */
  font-size: 1.25rem; /* Adjust size as needed */
  color: #636c7b;
}

.chat-prompt {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2e2e2e;
  text-align: center;
  margin: 1.25rem 0;
  padding: 2rem;
}

#umap-wrapper,
#umap-plot {
  min-height: 600px;
  max-height: 1000px;
  height: 800px;
  margin-bottom: 1rem;
}

#custom-tooltip {
  position: absolute;
  background: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  font-size: 13px;
  font-family: Arial, sans-serif;
  color: #222;
  z-index: 9999;
  display: none;
  pointer-events: auto;
  max-width: 300px;
  cursor: pointer;
}

#custom-tooltip a {
  color: #646c7b;
  text-decoration: underline;
  cursor: pointer;
}

#umap-plot {
  position: relative;
}

.umap-pulse-ring {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid #bababb;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: pulse-ring 1.2s ease-out infinite;
  z-index: 10;
}

@keyframes pulse-ring {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.6;
  }
  70% {
    transform: translate(-50%, -50%) scale(2.2);
    opacity: 0.15;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0;
  }
}

/* Full-screen overlay container */
.filter-modal {
  position: fixed;
  top: 0;
  right: 0;
  width: 450px;
  max-width: 100%;
  height: 100%;
  background-color: #ffffff;
  z-index: 2000;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
}

/* Slide-in effect when active */
.filter-modal.show {
  transform: translateX(0);
}

/* Modal content */
.filter-modal-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  overflow-y: auto;
}

/* Close button */
.modal-close-btn {
  position: absolute;
  top: 10px;
  left: 28px;
  margin: 2rem 0;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #555;
  cursor: pointer;

  background-image: url("/modules/custom/summaries/assets/images/toggle-window.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 28px 28px;
  width: 40px;
  height: 40px;
  border: none;
  text-indent: -9999px; /* hide text accessibly */
  overflow: hidden;
  transform: rotate(180deg);
}

/* Optional: Dimmed overlay effect (if you want it) */
.filter-modal::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: calc(100% - 450px); /* Adjust to match modal width */
  height: 100%;
  background-color: rgba(0, 0, 0, 0.2);
  z-index: -1;
}

.filter-toggle-container {
  margin: 1rem auto 0 auto;
  width: 100%;
  display: flex;
  justify-content: flex-end;
  max-width: 1200px; /* match your page width */
}

.filter-toggle-btn {
  /* background: #f5f5f5; */
  padding: 0.5rem 1rem;
  /* border-radius: 6px;
  border: 1px solid #ccc; */
  cursor: pointer;
  /* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); */

  background-image: url("/modules/custom/summaries/assets/images/toggle-window.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 28px 28px;
  width: 40px;
  height: 40px;
  border: none;
  text-indent: -9999px; /* hide text accessibly */
  overflow: hidden;
}

.filter-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 7rem 1rem 0 1rem;
}

.filter-modal-body input[type="text"] {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  box-shadow: none;
  outline: none;
  color: #003049;
}

.filter-modal-body .search-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #003049;
}

/* Flatten the default form item structure */
.filter-button-group .form-checkboxes,
.filter-button-group .form-item,
.filter-button-group .form-type-checkbox {
  display: contents; /* allows flex styling to pass through */
}
/* Group layout */
.filter-button-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  padding: 2.5rem 0 1rem 0;
}

/* Hide the native checkbox */
.filter-button-group input[type="checkbox"] {
  display: none;
}

.filter-button-group input[type="checkbox"] + label {
  display: inline-block;
  margin: 0.45rem;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  border: 1px solid #7dc8eb;
  background-color: #ffffff;
  font-size: 0.875rem;
  font-weight: 500;
  color: #143669;
  opacity: 0.8;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s;
}

/* Active chip */
.filter-button-group input[type="checkbox"]:checked + label {
  background-color: #7dc8eb;
  color: #333;
  font-weight: 600;
  border-color: #7dc8eb;
}

.filter-button-group input[type="checkbox"]:focus-visible + label {
  outline: 2px solid #1c5d99;
  outline-offset: 2px;
}

.modal-close-btn:focus-visible {
  outline: 2px solid #555;
  outline-offset: 2px;
}

legend {
  width: 100%;
  padding: 0;
  margin-bottom: 0;
  border: none;
  text-align: left;
}

.fieldset-legend,
label[for="edit-map-query"] {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #143669;
  padding: 0;
  text-align: left;
}

label[for="edit-map-query"] {
  margin-bottom: 0.5rem;
}

#ai-main-interface #edit-submit--2 {
  display: none;
}

#processingStatus {
  display: flex;
  align-items: center; /* vertically center child elements */
}

/* Pulsing dot animation */
.thinking-dot {
  display: inline-block;
  animation: pulse 2s infinite ease-in-out;
  color: #636c7b;
  font-size: 1.6rem;
  margin-right: 0.5rem;
  line-height: 1;
  vertical-align: middle;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.5);
    opacity: 0.5;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
