.gpai-wrapper {
  max-width: 800px;
  margin: 20px auto;
  padding: 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #4B5563;
  box-sizing: border-box;
}
.gpai-wrapper * {
  box-sizing: border-box;
}

.gpai-hero {
  text-align: center;
  margin-bottom: 2rem;
}

.gpai-hero-title {
  margin: 0 0 8px 0;
  font-size: 24px;
  font-weight: 700;
  color: #111827;
}

.gpai-hero-subtitle {
  margin: 0 0 24px 0;
  font-size: 16px;
  color: #6B7280;
  line-height: 1.5;
}

.gpai-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin-bottom: 24px;
}

.gpai-input-card {
  margin-top: 1rem;
}

.gpai-field {
  margin-bottom: 1rem;
}

.gpai-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

.gpai-textarea {
  width: 100%;
  min-height: 100px;
  border-radius: 8px;
  border: 1px solid #D1D5DB;
  padding: 10px 12px;
  font-size: 14px;
  color: #111827;
  background-color: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  margin-bottom: 16px;
  font-family: inherit;
}

.gpai-textarea:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.gpai-input-meta {
  margin-top: 0.35rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.gpai-helper {
  font-size: 0.8rem;
  color: #6b7280;
}

.gpai-counter {
  font-size: 0.8rem;
  color: #4b5563;
  white-space: nowrap;
}

.gpai-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.gpai-field-half {
  flex: 1 1 180px;
}

.gpai-select {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #D1D5DB;
  padding: 10px 12px;
  font-size: 14px;
  color: #111827;
  background-color: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

.gpai-select:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

/* Softer focus ring */
.gpai-textarea:focus,
.gpai-select:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.gpai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.gpai-btn {
  border-radius: 9999px;
  border: 0;
  padding: 0.55rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.1s ease, color 0.1s ease;
}

/* Button active press effect */
.gpai-btn:active {
  transform: scale(0.97);
}

.gpai-btn-primary {
  background-color: #2563EB;
  color: #ffffff;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 20px;
  border-radius: 9999px;
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.gpai-btn-primary:hover:not(:disabled) {
  background-color: #1D4ED8;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.gpai-btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.gpai-btn-primary:disabled::before {
  content: '';
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: gpai-spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 7px;
}

.gpai-btn-secondary {
  background-color: #ffffff;
  color: #374151;
  border: 1px solid #D1D5DB;
  border-radius: 9999px;
  padding: 6px 14px;
  font-size: 13px;
}

.gpai-btn-secondary:hover {
  background-color: #F3F4F6;
  border-color: #9CA3AF;
}

.gpai-btn-ghost {
  background-color: transparent;
  color: #4b5563;
  border: 1px solid #e5e7eb;
}

.gpai-btn-ghost:hover {
  background-color: #f9fafb;
}

.gpai-status {
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

.gpai-status-loading {
  color: #6366f1;
}

.gpai-status-error {
  color: #b91c1c;
}

.gpai-status-success {
  color: #15803d;
}

.gpai-result-card {
  margin-top: 24px;
}

.gpai-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.gpai-result-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

/* ── CHANGE 1: Spinner ── */
.gpai-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(37, 99, 235, 0.2);
  border-top-color: #2563EB;
  border-radius: 50%;
  animation: gpai-spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes gpai-spin {
  to { transform: rotate(360deg); }
}

.gpai-status-loading::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(99, 102, 241, 0.25);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: gpai-spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

/* ── CHANGE 2: Better Result Display ── */
.gpai-result {
  width: 100%;
  min-height: 120px;
  margin: 0;
  padding: 16px;
  background-color: #FAFAFA;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #111827;
  line-height: 1.75;
  white-space: pre-wrap;
  max-height: 480px;
  overflow: auto;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.gpai-result.gpai-result--visible {
  opacity: 1;
}

.gpai-result:empty {
  opacity: 0 !important;
}

/* ── CHANGE 3: Drag-and-Drop Dropzone ── */
.gpai-dropzone {
  position: relative;
  width: 100%;
  min-height: 120px;
  border: 2px dashed #D1D5DB;
  border-radius: 10px;
  background: #FAFAFA;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  padding: 24px 16px;
  text-align: center;
}

.gpai-dropzone:hover,
.gpai-dropzone.gpai-dropzone--over {
  border-color: #2563EB;
  background: #EFF6FF;
}

.gpai-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.gpai-dropzone-icon {
  font-size: 28px;
  line-height: 1;
  color: #9CA3AF;
}

.gpai-dropzone-label {
  font-size: 13px;
  color: #6B7280;
}

.gpai-dropzone-label span {
  color: #2563EB;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.gpai-dropzone-filename {
  font-size: 12px;
  color: #374151;
  font-weight: 500;
  display: none;
}

.gpai-dropzone--has-file .gpai-dropzone-filename {
  display: block;
}

.gpai-dropzone--has-file .gpai-dropzone-icon,
.gpai-dropzone--has-file .gpai-dropzone-label {
  display: none;
}

/* ── CHANGE 4: Toast ── */
.gpai-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #111827;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  z-index: 99999;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.gpai-toast.gpai-toast--show {
  opacity: 1;
  transform: translateY(0);
}

/* ── CHANGE 5: Per-Tool Accent Borders ── */

/* Image tools — amber */
.gpai-image-prompts .gpai-input-card,
.gpai-image-to-prompt .gpai-input-card,
.gpai-image-to-text .gpai-input-card,
.gpai-two-images-to-prompt .gpai-input-card,
.gpai-midjourney-prompt-generator .gpai-input-card,
.gpai-stable-diffusion-prompt-generator .gpai-input-card,
.gpai-imagen-prompt-generator .gpai-input-card,
.gpai-nano-banana-prompt-generator .gpai-input-card {
  border-top: 3px solid #F59E0B;
  border-radius: 10px;
  padding: 20px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Video tools — violet */
.gpai-veo3-video-prompts .gpai-input-card,
.gpai-sora2-video-prompt-generator .gpai-input-card {
  border-top: 3px solid #8B5CF6;
  border-radius: 10px;
  padding: 20px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Text/AI writing tools — emerald */
.gpai-ai-humanizer .gpai-input-card,
.gpai-ai-text-detector .gpai-input-card,
.gpai-product-description .gpai-input-card {
  border-top: 3px solid #10B981;
  border-radius: 10px;
  padding: 20px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Prompt generator tools — blue */
.gpai-main-prompt .gpai-input-card,
.gpai-prompt-checker .gpai-input-card,
.gpai-claude-prompt-generator .gpai-input-card,
.gpai-gemini-prompt-generator .gpai-input-card,
.gpai-deepseek-prompt-generator .gpai-input-card,
.gpai-qwen-prompt-generator .gpai-input-card,
.gpai-kimi-prompt-generator .gpai-input-card {
  border-top: 3px solid #2563EB;
  border-radius: 10px;
  padding: 20px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Match result cards to their input card */
.gpai-wrapper .gpai-result-card {
  border-radius: 10px;
  padding: 20px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Responsive */
@media (max-width: 640px) {
  .gpai-card {
    padding: 1.1rem 1.1rem 1.25rem;
  }

  .gpai-input-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .gpai-hero-title {
    font-size: 1.6rem;
  }

  .gpai-hero-subtitle {
    font-size: 0.95rem;
  }
}
