/* Import Inter font from Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

.assistant-button {
  background-color: transparent;
  color: #f59e0b;
  border: 1px solid #f59e0b;
  padding: 8px 12px;
  border-radius: 4px;
  margin-right: 10px;

  cursor: pointer;
  transition: all 0.3s ease;
  display: none; /* Hide buttons by default */
  align-items: center;
  font-family: "Inter", sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 500;
}

.assistant-button:hover {
  background-color: #f59e0b;
  color: white;
}

.assistant-button:hover .sparkles-icon {
  filter: brightness(100);
}

.assistant-button .sparkles-icon {
  width: 16px;
  height: 16px;
  margin-right: 4px;
  fill: currentColor;
}

.article-action-buttons {
  display: flex;
  margin: 10px 0 20px 0;
}

/* Assistant content styles */
.assistant-loading {
  padding: 40px 20px;
  text-align: center;
  font-family: "Inter", sans-serif;
  color: #4b5563;
  font-size: 16px;
  position: relative;
}

/* Loader animation */
.assistant-loader {
  display: inline-block;
  width: 40px;
  height: 40px;
  margin-bottom: 15px;
}

.assistant-loader:after {
  content: " ";
  display: block;
  width: 32px;
  height: 32px;
  margin: 4px;
  border-radius: 50%;
  border: 4px solid #f59e0b;
  border-color: #f59e0b transparent #f59e0b transparent;
  animation: loader 1.2s linear infinite;
}

@keyframes loader {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.assistant-result {
  margin-left: -2.6%;
  margin-top: -20px;
  font-family: "Inter", sans-serif;
}

.assistant-result h2 {
  font-size: 22px;
  margin-bottom: 15px;
  color: #1f2937;
  font-weight: 600;
}

.assistant-content {
  line-height: 1.6;
  color: #374151;
  margin-bottom: 20px;
  font-size: 16px;
}

.assistant-content p {
  margin-bottom: 15px;
}

.assistant-content ul,
.assistant-content ol {
  margin: 15px 0;
  padding-left: 10px;
}

.assistant-content li {
  margin-bottom: 8px;
}

/* Hide summary button when viewing summary */
.viewing-summary #summarize-article {
  display: none;
}

/* Full Article button styling */
.viewing-summary .article-action-buttons {
  display: flex;
}

.assistant-button.restore-button {
  margin-top: 0;
  padding: 8px 18px;
  display: flex;
}
.assistant-button.restore-button i {
  margin-right: 4px;
}

.assistant-iframe-container {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  margin-top: 20px;
}

.assistant-iframe-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}
#st-1 .st-toggle {
  display: none !important;
}
#st-1.st-has-labels .st-btn:hover {
  width: 85px !important;
}

/* Chat window styles */
.chat-window {
  position: fixed;
  bottom: 40px;
  right: 10px;
  width: 22%;
  min-width: 300px;
  max-width: 80vw;
  height: 45vh; /* Default to minimized height */
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  padding: 0;
  border-radius: 8px;
  transition: height 0.2s ease-in-out; /* Fast transition for height changes */
  resize: none; /* Disable default resize since we're adding custom handle */
}

.chat-window.minimized {
  height: 55vh;
}

.chat-window:not(.minimized) {
  height: 83vh;
}

/* Resize handle */
.chat-resize-handle {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: ew-resize;
  background: transparent;
  z-index: 10;
  transition: background 0.2s ease;
}

.chat-resize-handle:hover {
  background: #192342;
}

.chat-resize-handle:active {
  background: #192342;
}

/* Disable transitions during resize for smoother interaction */
.chat-window.resizing {
  transition: none !important;
}

.chat-window.minimized {
  height: 55vh;
}

.chat-window:not(.minimized) {
  height: 83vh;
}

.chat-iframe {
  flex: 1;
  border: none;
}

.chat-window iframe {
  border: none;
}

.chat-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 8px 8px 0 0;
  gap: 5px;
}

.chat-controls-buttons {
  display: flex;
  gap: 5px;
}

.chat-control-btn {
  background: transparent;
  color: #6b7280;
  border: none;
  border-radius: 4px;
  width: 28px;
  height: 28px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.chat-control-btn:hover {
  color: #4b5563;
}

.chat-control-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  stroke: currentColor;
}

.sparkle-chat-btn {
  position: fixed;
  bottom: 40px;
  right: 20px;
  background: #f59e0b;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  z-index: 9998;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.sparkle-chat-btn:hover {
  background: #d97706;
  transform: scale(1.05);
}

.sparkle-chat-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

#featuredCompaniesCollapse{
  margin-bottom: 30%;
}

body:has(.chat-window:not([style*="display: none"])) #featuredCompaniesCollapse{
  margin-bottom: 125% !important;
}

.chat-heading {
  margin-left: 3px;
}

.chat-heading img{
  margin-top: 5px;
  height: 18px;
}

.chat-heading span {
  font-size: 15px;
  font-weight: 600;
  color: #374151;
  margin-left: 2px;
}

.chat-controls{
  max-height: 42px;
}

@media (max-width: 768px) {
  .chat-window {
    width: 100% !important;
    min-width: unset;
    right: 0;
    left: 0;
    bottom: 0;
    border-radius: 8px 8px 0 0;
  }
  
  .chat-resize-handle {
    display: none; /* Hide resize handle on mobile */
  }
}
