/**
 * Main container
 */

.ai-summarizer-container {
  border: 1px solid #e6e7eb;
  padding: 1.5rem;
  width: 100%;
}

/**
 * Textareas
 */

.textareas {
  display: flex;
  flex-direction: row;
  width: 100%;
  gap: 1.5rem;
}

@media screen and (max-width: 991px) {
  .textareas {
    flex-direction: column;
  }
}

.textareas>div {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
}

.textareas>div>label {
  min-height: 2rem;
  display: flex;
  align-items: center;
  margin-bottom: 0.25rem;
}

.textarea-container {
  position: relative;
  width: 100%;
  border-radius: 0.25rem;
  border: 1px solid #CED4DA;
  height: 25rem;
  display: flex;
  overflow: hidden;
  padding: .375rem .5rem .5rem .75rem;
}

.textarea-container.input-container {
  padding-bottom: 8px;
}

#ai-summarizer .textarea-container.input-container.has-files {
  padding-top: 0;
}

.textarea-container.input-container:focus-within {
  border-color: #80bdff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, .25);
}

.textarea-container textarea {
  resize: none;
  background: none;
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
}

.textarea-container.result textarea {
  padding: 0.5rem 2.5rem 0.5rem 0.75rem;
}

.textarea-container textarea,
.textarea-container textarea:focus,
.textarea-container textarea:focus-visible,
.textarea-container textarea:active {
  border: none;
  outline: none;
}

.submit-btn {
  font-size: 0.875rem;
  margin: 0;
  padding: 4px 12px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.ai-summarizer-input {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: relative;
}

.ai-summarizer-input.has-files {
  padding-top: 44px;
}

.ai-summarizer-textarea {
  flex: 1 1 auto;
  min-height: 4rem;
  overflow: hidden;
}

.ai-summarizer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  padding: 6px .5rem 0 .75rem;
  margin-top: .25rem;
  margin-left: -.75rem;
  margin-right: -.5rem;
}


.ai-summarizer-actions--bordered {
  border-top: 1px solid #E6E7EB;
}

.textarea-container.result {
  background-color: #F5F7F9;
  padding: 0;
}

.textarea-container.result textarea,
.textarea-container.result textarea:disabled,
.textarea-container.result textarea:focus {
  background-color: #F5F7F9;
}

.top-right-btn {
  position: absolute;
  top: 0;
  right: 0;
  margin: 0.75rem 0.75rem 0 0;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.top-right-btn svg {
  opacity: 0.8;
  transition: transform 0.1s ease-out, opacity 0.1s ease-out;
}

.top-right-btn:hover svg {
  opacity: 1;
}

.top-right-btn.hide {
  opacity: 0;
  pointer-events: none;
}

/**
 * Skeleton loaders
 */

@keyframes skeleton-loader-fade {
  0% {
    opacity: 0;
    transform: translateX(-100%);
  }

  50% {
    opacity: 1;
    transform: translateX(0);
  }

  100% {
    opacity: 0;
    transform: translateX(100%);
  }
}

.result-skeleton {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 1rem 0.75rem;
}

.result-skeleton-line {
  background: #CED4DA;
  max-width: 15rem;
  height: 1rem;
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
  position: relative;
  overflow: hidden;
}

.result-skeleton-line::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(to right, transparent 0%, #e6e7eb 50%, transparent 100%);
  animation: skeleton-loader-fade 1.5s linear infinite;
}

.result-skeleton-line:nth-child(1) {
  width: 6rem;
  margin-bottom: 1.5rem;
}

.result-skeleton-line:nth-last-child(3) {
  margin-bottom: 1.5rem;
}

.result-skeleton-line:nth-last-child(2) {
  width: 5rem;
}

.result-skeleton-line:nth-last-child(1) {
  width: 3rem;
}

/**
 * Result sub-container
 */

.result-sub-container {
  width: 100%;
  height: 100%;
  position: relative;
}

/**
 * Error
 */

.result-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 2rem;
  width: 100%;
}

.result-error span {
  text-align: center;
  color: #6C757D;
}

.result-error .retry-btn {
  background: white;
  color: #000000A1;
  border: 1px solid #D4D9DF;
  padding: 0.4rem 0.75rem;
}

.result-error .retry-btn:hover {
  color: #000000;
}

/**
 * Result header (label + language selector)
 */

 .ai-summarizer-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
  min-height: 2rem;
}

.ai-summarizer-result-header label {
  margin-bottom: 0;
}

/**
 * Translation error alert
 */

.translation-error-alert {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0;
  border-top: 1px solid #FFEEBA;
  border-left: none;
  border-right: none;
  border-bottom: none;
  border-bottom-right-radius: 3px;
  border-bottom-left-radius: 3px;
  background-color: #FFF3CDF7;
  padding: 8px 36px 8px 12px;
  font-size: 0.75rem;
  z-index: 10;
}

.translation-error-alert .close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  opacity: 0.6;
}

/**
 * Drag & drop
 */

.textarea-container.input-container.input-container--dragover {
  border: 2px dashed #4285F4;
  background-color: #EEF3FF;
}

.ai-summarizer-dragover {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  text-align: center;
  padding: 2rem;
  width: 100%;
  pointer-events: none;
}

.ai-summarizer-dragover__text {
  font-size: 15px;
  line-height: 28px;
  color: #757575;
  margin: 0;
}

/**
 * Attach button
 */

.ai-summarizer-attach-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: Poppins, sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 20px;
  color: #6C757D;
  height: 24px;
  padding: 0 4px !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 6px;
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}

.ai-summarizer-attach-btn:hover {
  color: #343a40;
  text-decoration: none;
  background-color: #F6F6F6;
}

/**
 * File chips
 */

.ai-summarizer-file-chips-wrapper {
  position: absolute;
  top: 0;
  left: -.75rem;
  right: -.5rem;
  height: 44px;
  background: white;
  z-index: 1;
}

.ai-summarizer-file-chips-wrapper--bordered {
  border-bottom: 1px solid #E6E7EB;
}

.ai-summarizer-file-chips {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  height: 100%;
  padding: 0 .5rem 0 .75rem;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.ai-summarizer-file-chips::-webkit-scrollbar {
  display: none;
}

.ai-summarizer-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 28px;
  max-width: 166px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid #E6E7EB;
  background: #fff;
  flex-shrink: 0;
}

.ai-summarizer-file-chip__name {
  font-family: Poppins, sans-serif;
  font-weight: 500;
  font-size: 15px;
  line-height: 28px;
  color: #04143A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-summarizer-file-chip__remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 48px;
  background: transparent;
  border: none;
  padding: 1px;
  color: #495057;
  font-size: 0.9rem;
  line-height: 1;
}

.ai-summarizer-file-chip__remove:hover {
  background: #e6e6e6;
  color: #343a40;
}

/**
 * File error banner
 */

.ai-summarizer-error-banner {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 27px;
  padding: 4px 12px;
  background-color: rgba(255, 243, 205, 0.97);
  border-top: 1px solid #FFEEBA;
  border-bottom-right-radius: 3px;
  border-bottom-left-radius: 3px;
  font-size: 0.8rem;
  color: #856404;
  z-index: 10;
}

.ai-summarizer-error-banner__close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: #856404;
  font-size: 1.1rem;
  padding: 0;
  line-height: 1;
  opacity: 0.7;
}

.ai-summarizer-error-banner__close:hover {
  opacity: 1;
  color: #856404;
}

/**
 * Result error banner
 */

.result-error-banner {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 27px;
  padding: 4px 12px;
  background-color: rgba(255, 243, 205, 0.97);
  border-top: 1px solid #FFEEBA;
  border-bottom-right-radius: 3px;
  border-bottom-left-radius: 3px;
  font-size: 0.8rem;
  color: #856404;
}

.result-error-banner__close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: #856404;
  font-size: 1.1rem;
  padding: 0;
  line-height: 1;
  opacity: 0.7;
}

.result-error-banner__close:hover {
  opacity: 1;
  color: #856404;
}

