/* Text Editor Minimalist AI Inpainting & Typography Styles */
.text-editor-container {
  max-width: 1200px;
  margin: 0 auto 3rem auto;
  padding: 0 1rem;
}

.text-editor-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 24px;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  padding: 1.5rem;
}

/* Top Action Bar */
.te-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
  gap: 1rem;
  flex-wrap: wrap;
}

.te-top-left, .te-top-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.te-divider {
  width: 1px;
  height: 24px;
  background: #cbd5e1;
  margin: 0 0.25rem;
}

.te-btn-upload-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 12px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.te-btn-upload-primary:hover {
  background: #1d4ed8;
}

.te-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.te-tool-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.te-tool-btn.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}

.te-brush-size-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #64748b;
  margin-left: 0.5rem;
}

.te-brush-size-wrap input[type="range"] {
  width: 100px;
  cursor: pointer;
}

.te-size-val {
  min-width: 36px;
  font-weight: 600;
  color: #0f172a;
}

/* Main Split View */
.te-split-body {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.5rem;
  align-items: stretch;
}

/* Canvas Viewport */
.te-canvas-viewport {
  position: relative;
  background: #0f172a;
  background-image: 
    linear-gradient(45deg, #1e293b 25%, transparent 25%), 
    linear-gradient(-45deg, #1e293b 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #1e293b 75%), 
    linear-gradient(-45deg, transparent 75%, #1e293b 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  border-radius: 18px;
  overflow: hidden;
  min-height: 540px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed transparent;
  transition: border-color 0.2s;
}

.te-canvas-viewport.dragover {
  border-color: #38bdf8;
}

.te-canvas-wrapper {
  position: relative;
  display: inline-block;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  user-select: none;
}

#baseCanvas {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

#maskCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  z-index: 5;
}

/* In-Canvas Floating Upload Pill */
.te-in-canvas-upload-pill {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 8;
}

.te-btn-pill-upload {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.45rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.te-btn-pill-upload:hover {
  background: rgba(37, 99, 235, 0.9);
  border-color: #60a5fa;
  transform: translateY(-1px);
}

.te-brush-cursor {
  position: absolute;
  border: 2px solid rgba(239, 68, 68, 0.95);
  background: rgba(239, 68, 68, 0.25);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 20;
}

.te-canvas-tip {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  color: #f8fafc;
  font-size: 0.8rem;
  padding: 6px 16px;
  border-radius: 20px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  white-space: nowrap;
}

/* Parametric Sidebar - AI Minimalist */
.te-sidebar {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  justify-content: flex-start;
}

.te-ai-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.te-ai-badge {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  background: #e0f2fe;
  color: #0284c7;
  padding: 4px 10px;
  border-radius: 12px;
}

.te-ai-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.te-ai-desc {
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.5;
  margin: 0;
}

.te-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.te-field-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
}

.te-form-group textarea {
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 0.75rem;
  font-size: 0.95rem;
  background: #ffffff;
  color: #0f172a;
  outline: none;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  line-height: 1.45;
  transition: all 0.2s;
}

.te-form-group textarea:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.te-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.te-chip {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 0.76rem;
  padding: 4px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.te-chip:hover {
  background: #e0f2fe;
  border-color: #38bdf8;
  color: #0369a1;
}

.te-action-box {
  margin-top: 0.5rem;
}

.te-btn-magic-replace {
  width: 100%;
  padding: 0.95rem 1.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 14px;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.35);
  transition: all 0.2s;
}

.te-btn-magic-replace:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -5px rgba(37, 99, 235, 0.45);
}

.te-feature-notes {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.te-note-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: #475569;
}

.te-note-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.te-note-txt b {
  display: block;
  color: #0f172a;
  margin-bottom: 2px;
}

.te-note-txt span {
  font-size: 0.74rem;
  color: #64748b;
  line-height: 1.35;
  display: block;
}
