/* AI Essay Writer - Tool Specific Styles */

/* ========== ESSAY HEADER ========== */
.essay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid #e2e8f0;
  gap: 20px;
  flex-wrap: wrap;
}

.essay-versions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.versions-label {
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
}

.version-tabs {
  display: flex;
  gap: 8px;
}

.version-tab {
  padding: 8px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'CircularStd', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.version-tab:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.version-tab.active {
  background: #233f8c;
  border-color: #1e293b;
  color: #ffffff;
}

.essay-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.word-count {
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-share,
.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border-radius: 6px;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'CircularStd', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.btn-share:hover,
.btn-copy:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
}

.btn-share svg,
.btn-copy svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ========== ESSAY CONTENT ========== */
.essay-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  position: relative;
  min-height: 470px;
  max-height: 470px;
}

.essay-text {
  font-size: 15px;
  line-height: 1.8;
  color: #1e293b;
  word-wrap: break-word;
}

.essay-text p {
  margin: 0 0 16px 0;
}

.essay-text p:last-child {
  margin-bottom: 0;
}

/* ========== ESSAY FOOTER ========== */
.essay-footer {
  padding: 24px 32px;
  border-top: 1px solid #e2e8f0;
}

.editors-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  padding: 20px 28px;
  border-radius: 16px;
}

.editors-info {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}

.editors-text-large {
  font-size: 15px;
  font-weight: 600;
  color: #075985;
  margin: 0;
}

.btn-polish {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: #233f8c;
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'CircularStd', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  box-shadow: 0 4px 12px rgba(30, 41, 59, 0.25);
  flex-shrink: 0;
}

.btn-polish:hover {
  background: #0f172a;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30, 41, 59, 0.35);
}

.btn-polish svg {
  width: 20px;
  height: 20px;
}

/* ========== INFO TOOLTIP ========== */
.info-tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: #233f8c;
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
  z-index: 1000;
}

.info-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1e293b;
}

.btn-icon:hover .info-tooltip {
  opacity: 1;
  visibility: visible;
}

.tooltip-item {
  font-size: 13px;
  line-height: 1.6;
  color: #e2e8f0;
}

.tooltip-item:not(:last-child) {
  margin-bottom: 4px;
}

.tooltip-value {
  font-weight: 600;
  color: #ffffff;
}

/* ========== TOPIC SUGGESTION STYLES ========== */
.topic-suggestion {
  position: absolute;
  top: calc(45% + 8px);
  left: 0;
  right: 0;
  background: white;
  border: 1.5px solid #bae6fd;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(35, 63, 140, 0.08);
  padding: 14px 16px;
  z-index: 100;
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 60px;
}

.topic-suggestion.result-screen-suggestion {
  flex-direction: column;
  align-items: center;
  width: 113%;
  left: -20px;
  top: 140%;
}

.topic-suggestion.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.suggestion-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.suggestion-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #075985;
}

.suggestion-icon.loading {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.suggestion-content {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.suggestion-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #075985;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.suggestion-text {
  font-size: 13px;
  color: #1e293b;
  line-height: 1.5;
  font-weight: 500;
  word-wrap: break-word;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.suggestion-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.suggestion-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #e2e8f0;
  background: white;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #64748b;
}

.suggestion-btn:hover {
  border-color: #075985;
  background: #f8fafc;
  color: #075985;
}

.suggestion-refresh:hover {
  animation: rotate 0.4s ease;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(180deg); }
}

.suggestion-use-btn {
  padding: 8px 14px;
  background: linear-gradient(135deg, #075985 0%, #0c4a6e 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: 'CircularStd', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.suggestion-use-btn:hover {
  background: linear-gradient(135deg, #0c4a6e 0%, #075985 100%);
  box-shadow: 0 4px 12px rgba(7, 89, 133, 0.2);
}

.suggestion-use-btn:active {
  transform: scale(0.98);
}

.suggestion-use-btn svg {
  flex-shrink: 0;
}

/* ========== RESPONSIVE STYLES ========== */
@media (max-width: 768px) {
  .essay-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px;
  }

  .essay-versions {
    width: 100%;
    flex-wrap: wrap;
  }

  .essay-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .essay-content {
    padding: 24px 20px;
  }

  .essay-footer {
    padding: 20px;
  }

  .editors-cta {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 20px;
  }

  .editors-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .btn-polish {
    width: 100%;
    justify-content: center;
  }

  .topic-suggestion {
    padding: 10px 12px;
    gap: 10px;
    flex-wrap: wrap;
    top: calc(35% + 8px);
  }

  .topic-header .topic-suggestion.result-screen-suggestion {
    left: -20px;
  }

  .suggestion-wrapper {
    gap: 8px;
    width: 100%;
  }

  .suggestion-icon {
    width: 28px;
    height: 28px;
  }

  .suggestion-label {
    font-size: 10px;
  }

  .suggestion-text {
    font-size: 12px;
  }

  .suggestion-actions {
    gap: 4px;
  }

  .suggestion-btn {
    width: 26px;
    height: 26px;
  }

  .suggestion-use-btn {
    width: 100%;
    justify-content: center;
    padding: 8px 12px;
    font-size: 12px;
  }
}

@media (max-width: 575px) {
  .essay-header {
    padding: 14px 16px;
  }

  .essay-content {
    padding: 20px 16px;
    max-height: unset;
    min-height: unset;
  }

  .essay-text {
    font-size: 14px;
  }

  .version-tab {
    padding: 6px 12px;
    font-size: 12px;
  }

  .btn-share,
  .btn-copy {
    padding: 6px 10px;
    font-size: 13px;
  }

  .btn-share span,
  .btn-copy span {
    display: none;
  }
}
