/**
 * 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: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%;
}

.ai-summarizer-textarea {
  flex: 1 1 auto;
  min-height: 0;
}

.ai-summarizer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: white;
  padding-top: .5rem;
  margin-top: .5rem;
  margin-left: -.75rem;
  margin-right: -.5rem;
  padding-left: .75rem;
  padding-right: .5rem;
}

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

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

.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;
}

