/**
 * AI PDF Summarizer
 */

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

/**
 * Textareas layout
 */

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

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

.ai-pdf-summarizer-container .textareas > div {
  flex: 1 1 0;
}

.ai-pdf-summarizer-container label {
  display: block;
  margin-bottom: 0.5rem;
  font-family: Poppins, sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0;
  color: #04143A;
}

/**
 * Drop zone
 */

.pdf-dropzone {
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  height: 25rem;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  overflow: hidden;
}

.pdf-dropzone__content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 0;
}

.pdf-dropzone:hover,
.pdf-dropzone--dragover {
  border: 2px dashed #4285F4;
  background-color: #EEF3FF;
}

.pdf-dropzone__dragover {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  text-align: center;
  padding: 2rem;
  pointer-events: none;
}

.pdf-dropzone--has-file {
  cursor: default;
}

.pdf-dropzone__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  gap: 1.5rem;
}

.pdf-dropzone__text {
  font-family: Poppins, sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 15px;
  line-height: 28px;
  letter-spacing: 0;
  text-align: center;
  color: #757575;
  margin: 0;
}

.pdf-dropzone__btn {
  height: 33px;
  padding: 4px 12px;
  border-radius: 8px;
  border-width: 2px;
  border-color: #4285F4;
  background-color: #4285F4;
  font-family: Poppins, sans-serif;
  font-weight: 500;
  font-style: normal;
  font-size: 14px;
  line-height: 100%;
  letter-spacing: -0.02em;
  text-transform: none;
  white-space: nowrap;
  color: #FFFFFF;
  margin: 0;
}

.pdf-dropzone__file {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: safe center;
  align-items: flex-start;
  gap: 10px;
  padding: 0.5rem;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  box-sizing: border-box;
  align-self: stretch;
}

.pdf-dropzone__card-wrapper {
  position: relative;
  width: 195px;
  padding-top: 11px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.pdf-dropzone__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 12px;
  background: #FFFFFF;
  border: 1px solid #CED4DA;
  border-radius: 4px;
  text-align: center;
  width: 100%;
  height: 142px;
  overflow: hidden;
  position: relative;
}

.pdf-dropzone__card--error {
  border-color: #f5c6cb;
  background-color: #fff8f8;
}

.pdf-dropzone__card-error-msg {
  font-family: Poppins, sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: #d94f3d;
  text-align: center;
  line-height: 1.4;
}

.pdf-dropzone__filename {
  font-family: Poppins, sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 15px;
  line-height: 28px;
  letter-spacing: 0;
  text-align: center;
  color: #000000;
  word-break: break-word;
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
}

.pdf-dropzone__remove {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  width: 22px;
  height: 22px;
  border-radius: 48px;
  background: #F6F6F6;
  border: none;
  padding: 1px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.pdf-dropzone__remove:hover {
  background: #e6e6e6;
}

.pdf-dropzone__progress {
  width: 100%;
  height: 4px;
  background-color: #e6e7eb;
  position: absolute;
  bottom: 0;
  left: 0;
  overflow: hidden;
}

@keyframes progress-indeterminate {
  0% { left: -50%; width: 50%; }
  100% { left: 100%; width: 50%; }
}

.pdf-dropzone__progress-bar {
  position: absolute;
  height: 100%;
  background-color: #4285F4;
  border-radius: 2px;
  animation: progress-indeterminate 1.4s ease-in-out infinite;
}

/**
 * Summarize button
 */

.pdf-dropzone-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid #e6e7eb;
  flex-shrink: 0;
}

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

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

/**
 * Result textarea
 */

.ai-pdf-summarizer-container .textarea-container {
  position: relative;
  width: 100%;
  border-radius: 0.25rem;
  border: 1px solid #ced4da;
  height: 25rem;
  display: flex;
  overflow: hidden;
}

.ai-pdf-summarizer-container .textarea-container.result {
  background-color: #f5f7f9;
}

.ai-pdf-summarizer-container .textarea-container textarea {
  resize: none;
  background: none;
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  padding: 0.5rem 2.5rem 0.5rem 0.75rem;
}

.ai-pdf-summarizer-container .textarea-container.result textarea,
.ai-pdf-summarizer-container .textarea-container.result textarea:disabled {
  background-color: #f5f7f9;
}

/**
 * Copy button
 */

.ai-pdf-summarizer-container .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;
}

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

.ai-pdf-summarizer-container .top-right-btn:hover svg {
  opacity: 1;
}

.ai-pdf-summarizer-container .top-right-btn.hide {
  opacity: 0;
  pointer-events: none;
}

/**
 * Result sub-container
 */

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

/**
 * Skeleton loader
 */

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

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

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

.ai-pdf-summarizer-container .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;
}

.ai-pdf-summarizer-container .result-skeleton-line:nth-child(1) { width: 6rem; margin-bottom: 1.5rem; }
.ai-pdf-summarizer-container .result-skeleton-line:nth-last-child(3) { margin-bottom: 1.5rem; }
.ai-pdf-summarizer-container .result-skeleton-line:nth-last-child(2) { width: 5rem; }
.ai-pdf-summarizer-container .result-skeleton-line:nth-last-child(1) { width: 3rem; }

/**
 * Error banner (toast)
 */

.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;
  color: #856404;
  font-size: 1.1rem;
  padding: 0;
  line-height: 1;
  opacity: 0.7;
}

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

/**
 * Error
 */

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

.ai-pdf-summarizer-container .result-error span {
  text-align: center;
  color: #6c757d;
}

.ai-pdf-summarizer-container .result-error .retry-btn {
  background: white;
  color: #000000a1;
  border: 1px solid #d4d9df;
  padding: 0.4rem 0.75rem;
  margin-top: 0.75rem;
}

.ai-pdf-summarizer-container .result-error .retry-btn:hover {
  color: #000000;
}