/* ===== 탭 영역 (기존) ===== */

.ai-tabs-wrap {
  background: linear-gradient(180deg, #f8f9fb 0%, #eef2f7 100%);
  border: 1px solid #d9e0ea;
  box-shadow: 0 8px 28px rgba(18, 37, 63, 0.08);
  overflow: hidden;
}

.ai-browser-bar {
  background: #e9edf3;
  border-bottom: 1px solid #d6dde7;
  padding: 10px 12px 0;
}

.ai-browser-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.ai-browser-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.ai-browser-dots span:nth-child(1) { background: #ff5f57; }
.ai-browser-dots span:nth-child(2) { background: #febc2e; }
.ai-browser-dots span:nth-child(3) { background: #28c840; }

.ai-tab-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.ai-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px 12px 0 0;
  border: 1px solid transparent;
  color: #526173;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.95rem;
  background: rgba(255,255,255,0.35);
}

.ai-tab:hover {
  color: #243447;
  background: rgba(255,255,255,0.6);
}

.ai-tab.active {
  background: #ffffff;
  border-color: #d6dde7;
  border-bottom-color: #ffffff;
  color: #16324f;
  box-shadow: 0 -2px 0 #8fb8ff inset;
}

.ai-tab.disabled {
  opacity: 0.65;
  cursor: default;
}

.ai-tab.disabled:hover {
  background: rgba(255,255,255,0.35);
  color: #526173;
}

.ai-tool-body {
  background: #fff;
  padding: 28px;
  min-height: 380px;
}

.ai-tool-title {
  color: #173a5e;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.ai-placeholder-card {
  border: 1px dashed #cfd8e6;
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfcff 0%, #f5f8fd 100%);
  padding: 18px;
}


/* ===== 이미지 생성 카드 ===== */

.aimg-card {
  font-family: 'Gowun Dodum', sans-serif;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.aimg-model-header {
  font-family: 'Gowun Dodum', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1d3557;
  background: linear-gradient(135deg, #f0f4f8 0%, #e8edf5 100%);
  border: 1px solid #d0d9e6;
  border-radius: 10px;
  padding: 14px 20px;
  margin-bottom: 28px;
  letter-spacing: 0.02em;
}

.aimg-section {
  margin-bottom: 22px;
}

.aimg-label {
  font-family: 'Gowun Dodum', sans-serif;
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

/* 업로드 영역 */
.aimg-upload-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.aimg-upload-input-wrap {
  flex: 1;
}

.aimg-file-input {
  font-family: 'Gowun Dodum', sans-serif;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.9rem;
}

.aimg-file-input:focus {
  border-color: #457b9d;
  box-shadow: 0 0 0 3px rgba(69, 123, 157, 0.15);
}

.aimg-file-name {
  font-family: 'Gowun Dodum', sans-serif;
  font-size: 0.82rem;
  color: #9ca3af;
  margin-top: 6px;
}

.aimg-preview-wrap {
  width: 120px;
  height: 120px;
  border: 2px dashed #d1d5db;
  border-radius: 10px;
  overflow: hidden;
  display: none;
  flex-shrink: 0;
  background: #f9fafb;
}

.aimg-preview-wrap.has-image {
  display: flex;
  align-items: center;
  justify-content: center;
  border-style: solid;
  border-color: #457b9d;
}

.aimg-preview-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* 프롬프트 */
.aimg-textarea {
  font-family: 'Gowun Dodum', sans-serif;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.aimg-textarea:focus {
  border-color: #457b9d;
  box-shadow: 0 0 0 3px rgba(69, 123, 157, 0.15);
}

.aimg-textarea::placeholder {
  color: #9ca3af;
}

/* 버튼 */
.aimg-btn-row {
  text-align: center;
}

.aimg-generate-btn {
  font-family: 'Gowun Dodum', sans-serif;
  padding: 12px 36px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
  letter-spacing: 0.03em;
}

/* 프롬프트 라벨 + 영어변환 버튼 한 줄 */
.aimg-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.aimg-label-row .aimg-label {
  margin-bottom: 0;
}

.aimg-translate-btn {
  font-family: 'Gowun Dodum', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 8px;
  border: 1px solid #457b9d;
  color: #457b9d;
  background: #fff;
  transition: all 0.2s ease;
}

.aimg-translate-btn:hover {
  background: #457b9d;
  color: #fff;
}

.aimg-translate-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 로딩 */
.aimg-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
  font-family: 'Gowun Dodum', sans-serif;
  color: #457b9d;
  font-size: 0.95rem;
}

/* 에러 */
.aimg-error {
  font-family: 'Gowun Dodum', sans-serif;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 18px;
  font-size: 0.9rem;
}

.aimg-error-detail {
  margin-top: 10px;
}

.aimg-error-detail summary {
  cursor: pointer;
  font-size: 0.82rem;
  color: #991b1b;
  user-select: none;
}

.aimg-error-detail pre {
  margin-top: 8px;
  padding: 10px 12px;
  background: #1e1e1e;
  color: #d4d4d4;
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.5;
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* 결과 이미지 */
.aimg-result-section {
  border-top: 1px solid #e5e7eb;
  padding-top: 24px;
}

.aimg-result-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 20px;
  color: #b0b8c4;
  font-family: 'Gowun Dodum', sans-serif;
  font-size: 0.95rem;
}

.aimg-result-placeholder i {
  font-size: 2.4rem;
}

.aimg-result-wrap {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.aimg-result-wrap img {
  max-width: 50%;
  max-height: 300px;
  border-radius: 8px;
  object-fit: contain;
}

.aimg-download-row {
  text-align: center;
  margin-top: 16px;
}

.aimg-download-btn {
  font-family: 'Gowun Dodum', sans-serif;
  padding: 10px 30px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
}

.aimg-download-btn.disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}


/* 스타일 프롬프트 영역 */
.aimg-style-btn-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.aimg-style-input {
  font-family: 'Gowun Dodum', sans-serif;
  font-size: 0.9rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #f9fafb;
  cursor: pointer;
}

.aimg-style-clear-btn {
  font-family: 'Gowun Dodum', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 8px;
  border: 1px solid #dc2626;
  color: #dc2626;
  background: #fff;
  transition: all 0.2s ease;
}

.aimg-style-clear-btn:hover {
  background: #dc2626;
  color: #fff;
}

.aimg-copy-btn {
  font-family: 'Gowun Dodum', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 8px;
  border: 1px solid #457b9d;
  color: #fff;
  background: #457b9d;
  transition: all 0.2s ease;
}

.aimg-copy-btn .material-symbols-rounded {
  font-size: 16px;
}

.aimg-copy-btn:hover {
  background: #356584;
  border-color: #356584;
  color: #fff;
}

/* 스타일 프롬프트 모달 */
.aimg-modal-content {
  font-family: 'Gowun Dodum', sans-serif;
  border-radius: 14px;
}

.aimg-modal-header {
  background: #f0f4f8;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 14px 14px 0 0;
  padding: 14px 18px;
}

.aimg-modal-header .modal-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1d3557;
}

.aimg-modal-footer {
  border-top: 1px solid #e2e8f0;
  padding: 10px 18px;
}

.aimg-modal-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.aimg-modal-btn-add {
  font-family: 'Gowun Dodum', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid #457b9d;
  color: #457b9d;
  background: #fff;
  border-radius: 6px;
  padding: 4px 12px;
}

.aimg-modal-btn-add:hover {
  background: #457b9d;
  color: #fff;
}

.aimg-modal-btn-del {
  font-family: 'Gowun Dodum', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid #dc2626;
  color: #dc2626;
  background: #fff;
  border-radius: 6px;
  padding: 4px 12px;
}

.aimg-modal-btn-del:hover {
  background: #dc2626;
  color: #fff;
}

.aimg-sp-list {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fafbfc;
}

.aimg-sp-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  margin: 0;
  font-size: 0.88rem;
  color: #374151;
  transition: background 0.15s;
}

.aimg-sp-item:last-child {
  border-bottom: none;
}

.aimg-sp-item:hover {
  background: #eef2f7;
}

.aimg-sp-check {
  margin-top: 2px;
  flex-shrink: 0;
}

.aimg-sp-text {
  word-break: break-word;
  line-height: 1.4;
}

.aimg-sp-empty {
  text-align: center;
  padding: 28px 16px;
  color: #9ca3af;
  font-size: 0.88rem;
}


/* 비관리자 안내 */
.aimg-admin-notice {
  font-family: 'Gowun Dodum', sans-serif;
  text-align: center;
  padding: 40px 20px;
  color: #6b7280;
  font-size: 1rem;
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  border-radius: 12px;
}

.aimg-admin-notice i {
  color: #9ca3af;
}


/* ===== 반응형 ===== */

@media (max-width: 768px) {
  .ai-tool-body {
    padding: 18px;
    min-height: 320px;
  }

  .ai-tab {
    font-size: 0.9rem;
    padding: 9px 12px;
  }

  .aimg-card {
    padding: 20px 16px;
  }

  .aimg-upload-row {
    flex-direction: column;
  }

  .aimg-preview-wrap {
    width: 100px;
    height: 100px;
  }

  .aimg-generate-btn {
    width: 100%;
  }

}
