/* ==========================================================================
   Outfit Builder Style (PromptFactoryPRO v4.0 Patch)
   ========================================================================== */

/* Shell Layout */
.outfit-shell {
  width: min(1480px, calc(100% - 28px));
  margin: 0 auto 36px;
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(420px, 1.3fr) minmax(360px, 1.15fr);
  gap: 14px;
  align-items: start;
}

@media (max-width: 1100px) {
  .outfit-shell {
    grid-template-columns: 1fr 1.2fr;
  }
  .outfit-panel-left {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .outfit-shell {
    grid-template-columns: 1fr;
  }
  .outfit-panel-left,
  .outfit-panel-center,
  .outfit-panel-right {
    grid-column: span 1;
  }
}

/* Base Panel Styles (Matching style.css card style) */
.outfit-card {
  border: 1px solid rgba(217, 224, 232, 0.9);
  border-radius: var(--radius);
  background: var(--surface-alpha);
  box-shadow: var(--shadow-soft);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

:root[data-theme="dark"] .outfit-card {
  border-color: var(--line);
}

.outfit-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.outfit-card-title h2 {
  font-size: 16px;
  font-weight: 900;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Left Panel: Saved Outfits */
.outfit-save-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.outfit-save-row input[type="text"] {
  flex: 1;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--text);
  font-size: 13px;
}

.outfit-list-container {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-soft);
}

.outfit-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.15s;
}

.outfit-list-item:last-child {
  border-bottom: none;
}

.outfit-list-item:hover {
  background: rgba(20, 184, 166, 0.05);
}

.outfit-list-item.active {
  background: rgba(20, 184, 166, 0.1);
  border-left: 3px solid var(--teal);
}

.outfit-item-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.outfit-item-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.outfit-item-date {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}

.outfit-item-actions {
  display: flex;
  gap: 4px;
}

.outfit-item-actions button {
  padding: 4px 6px;
  font-size: 11px;
  min-height: 24px;
}

.outfit-io-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Left Panel: Slot Summaries */
.outfit-slot-summary-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.outfit-slot-summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  cursor: pointer;
  transition: all 0.15s;
}

.outfit-slot-summary-item:hover {
  border-color: var(--line-strong);
}

.outfit-slot-summary-item.active {
  border-color: var(--teal);
  background: rgba(94, 234, 212, 0.06);
  box-shadow: 0 0 12px rgba(94, 234, 212, 0.3);
}

/* Edit Badge for Active Slot */
.edit-badge {
  font-size: 10px;
  font-weight: 950;
  background: var(--teal);
  color: var(--strong-text);
  padding: 2px 6px;
  border-radius: 4px;
  animation: pulseEdit 2s infinite;
}

@keyframes pulseEdit {
  0% { opacity: 0.8; }
  50% { opacity: 1; box-shadow: 0 0 8px rgba(94, 234, 212, 0.6); }
  100% { opacity: 0.8; }
}

/* Body Graphics Wrapper */
.outfit-body-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.outfit-slot-summary-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.outfit-slot-summary-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--paper-soft);
  color: var(--muted);
  font-weight: bold;
}

.outfit-slot-summary-item.enabled .outfit-slot-summary-badge {
  background: var(--teal-soft);
  color: var(--teal);
}

.outfit-slot-summary-name {
  font-size: 12px;
  font-weight: bold;
  color: var(--ink);
}

.outfit-slot-summary-desc {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

/* Center Panel: Equipment Screen UI */
.outfit-canvas-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 480px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-soft);
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.outfit-character-canvas {
  width: 100%;
  max-width: 380px;
  height: 440px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.outfit-body-graphic {
  width: 160px;
  height: 380px;
  color: var(--muted);
  opacity: 0.85;
  transition: color 0.3s;
  display: flex;
  justify-content: center;
  align-items: center;
}

.human-silhouette {
  width: 100%;
  height: 100%;
}

/* Slot positions on the body screen (MMORPG grid style) */
.outfit-slot-btn {
  position: absolute;
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  z-index: 5;
}

.outfit-slot-icon-box {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  border: 2px solid var(--line-strong);
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-soft);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text);
}

.outfit-slot-btn:hover .outfit-slot-icon-box {
  transform: scale(1.08);
  border-color: var(--teal);
  box-shadow: 0 0 8px rgba(20, 184, 166, 0.3);
}

.outfit-slot-btn.active .outfit-slot-icon-box {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: 0 0 16px rgba(94, 234, 212, 0.8);
  color: var(--teal);
  transform: scale(1.08);
}

.outfit-slot-btn.disabled .outfit-slot-icon-box {
  opacity: 0.45;
  border-style: dashed;
}

.outfit-slot-label {
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--paper);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--line);
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.outfit-slot-btn.active .outfit-slot-label {
  color: var(--teal);
  border-color: var(--teal);
}

.outfit-slot-item-preview {
  font-size: 10px;
  color: var(--text);
  max-width: 80px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(var(--paper), 0.8);
}

/* Absolute Positions around the silhouette */
.slot-pos-set {
  top: -15px;
  left: calc(50% - 40px);
}

/* Left side slots: Head, Outer, Inner, Bottom */
.slot-pos-head {
  top: 10px;
  left: 20px;
}

.slot-pos-outer {
  top: 110px;
  left: 10px;
}

.slot-pos-inner {
  top: 210px;
  left: 10px;
}

.slot-pos-bottom {
  top: 310px;
  left: 20px;
}

/* Right side slots: Accessory, Legwear, Footwear, Optional */
.slot-pos-accessory {
  top: 10px;
  right: 20px;
}

.slot-pos-legwear {
  top: 110px;
  right: 10px;
}

.slot-pos-footwear {
  top: 210px;
  right: 10px;
}

.slot-pos-optional {
  top: 310px;
  right: 20px;
}

/* Responsive Overrides for Center Panel */
@media (max-width: 480px) {
  .outfit-character-canvas {
    height: auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }
  .outfit-body-graphic {
    display: none;
  }
  .outfit-slot-btn {
    position: static;
    width: auto;
  }
  .outfit-slot-item-preview {
    max-width: 70px;
  }
  .outfit-canvas-container {
    min-height: auto;
    padding: 10px;
  }
}

/* Right Panel: Editor Forms */
.outfit-editor-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.outfit-form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.outfit-form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.outfit-form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.outfit-form-field span {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}

.outfit-form-field input[type="text"],
.outfit-form-field select {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--text);
  font-size: 13px;
  outline: none;
}

.outfit-form-field input[type="text"]:focus,
.outfit-form-field select:focus {
  border-color: var(--teal);
}

.outfit-form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  min-height: 36px;
  cursor: pointer;
}

.outfit-form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
}

.outfit-form-check span {
  font-size: 12px;
  font-weight: bold;
  color: var(--text);
}

/* Tag Suggestions Area */
.outfit-suggestions-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.outfit-suggestions-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.outfit-suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
  padding: 6px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-soft);
  transition: max-height 0.2s ease-in-out;
}

.outfit-suggestions-box.expanded .outfit-suggestions-list {
  max-height: 450px;
}

.outfit-suggest-chip {
  padding: 0;
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.1s;
}

.suggest-main-btn {
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
  flex: 1;
}

.suggest-main-btn:hover {
  background: rgba(20, 184, 166, 0.05);
  color: var(--teal);
}

.suggest-add-btn {
  padding: 6px 10px;
  background: var(--paper-soft);
  border: none;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
}

.suggest-add-btn:hover {
  background: var(--teal-soft);
  color: var(--teal);
}

/* Prompt Output Card */
.outfit-output-card {
  border-color: var(--teal);
  background: linear-gradient(180deg, var(--surface-alpha), rgba(20, 184, 166, 0.02));
}

.outfit-prompt-textarea {
  width: 100%;
  min-height: 115px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-soft);
  color: var(--ink);
  font-family: monospace;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
}

.outfit-prompt-textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 8px rgba(94, 234, 212, 0.25);
}

.outfit-prompt-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
  margin-bottom: 4px;
}

.outfit-prompt-actions .solid-btn {
  border-color: var(--teal);
  background: var(--teal);
  color: var(--strong-text);
  font-weight: 950;
  padding: 8px 20px;
  font-size: 13px;
  min-height: 38px;
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.25);
}

.outfit-prompt-actions .ghost-btn {
  border-color: var(--line);
  background: var(--paper);
  color: var(--teal);
  font-weight: 850;
  padding: 8px 16px;
  font-size: 12px;
  min-height: 38px;
}

/* Subcategory filter styles */
.outfit-subcategory-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 8px;
}

.subcategory-tab-btn {
  padding: 4px 12px;
  font-size: 11px;
  font-weight: bold;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.subcategory-tab-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.subcategory-tab-btn.active {
  background: var(--teal-soft);
  color: var(--teal);
  border-color: var(--teal);
  box-shadow: 0 2px 6px rgba(20, 184, 166, 0.15);
}

/* Copy feedback animations */
.outfit-card.copy-feedback {
  animation: copyFlash 0.8s ease;
}

.copy-success {
  background: var(--teal) !important;
  border-color: var(--teal) !important;
  color: var(--strong-text) !important;
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.5) !important;
}

@keyframes copyFlash {
  0% {
    box-shadow: var(--shadow-soft);
  }
  30% {
    box-shadow: 0 0 15px rgba(20, 184, 166, 0.4);
    border-color: var(--teal);
  }
  100% {
    box-shadow: var(--shadow-soft);
  }
}

/* Individual Slot Clear Button */
.outfit-slot-clear-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.outfit-slot-clear-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Slot Summary Details & Japanese Text */
.outfit-slot-summary-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.outfit-slot-summary-ja {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
  margin-top: 1px;
}

/* Danger ghost button variant */
.ghost-btn.danger {
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

.ghost-btn.danger:hover {
  background: rgba(239, 68, 68, 0.08) !important;
  border-color: #ef4444 !important;
}

