/* AI 이미지 메타데이터 뷰어 전용 스타일 */

/* 이미지 프리뷰 */
.preview-section {
  margin-top: 1.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.preview-image {
  width: 200px;
  height: 200px;
  object-fit: contain;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-info h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  word-break: break-all;
}

.file-info-table {
  width: 100%;
  font-size: 0.85rem;
}

.file-info-table td {
  padding: 0.25rem 0;
}

.file-info-table td:first-child {
  color: var(--text-sub);
  width: 100px;
  font-weight: 500;
}

/* 소스 뱃지 */
.source-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: 0.5rem;
}

/* 메타데이터 섹션 */
.meta-sections {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.meta-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.meta-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.meta-section-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
}

.btn-copy {
  padding: 0.3rem 0.7rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-sub);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-copy:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* 프롬프트 텍스트 영역 */
.meta-text {
  padding: 1rem;
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  max-height: 300px;
  overflow-y: auto;
}

/* 파라미터 테이블 */
.params-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.params-table tr:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.params-table td {
  padding: 0.6rem 1rem;
}

.params-table td:first-child {
  color: var(--text-sub);
  font-weight: 500;
  width: 140px;
  white-space: nowrap;
}

.params-table td:last-child {
  word-break: break-all;
}

/* Raw 메타데이터 (접기/펼치기) */
.raw-section {
  margin-top: 1rem;
}

.raw-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-sub);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
}

.raw-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.raw-toggle .arrow {
  transition: transform 0.2s;
  font-size: 0.7rem;
}

.raw-toggle.open .arrow {
  transform: rotate(90deg);
}

.raw-content {
  display: none;
  margin-top: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.raw-content.open {
  display: block;
}

.raw-content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.raw-content-header span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-sub);
}

.raw-text {
  padding: 1rem;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", "Consolas", monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text);
  max-height: 400px;
  overflow-y: auto;
}

/* 메타데이터 없음 */
.no-metadata {
  margin-top: 1.5rem;
  padding: 2rem 1.5rem;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-sub);
}

.no-metadata p {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.no-metadata .hint {
  font-size: 0.8rem;
}

/* 새 파일 버튼 */
.btn-new {
  margin-top: 1rem;
  padding: 0.5rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-sub);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-new:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* 반응형 */
@media (max-width: 480px) {
  .preview-section {
    flex-direction: column;
    align-items: center;
  }

  .preview-image {
    width: 160px;
    height: 160px;
  }

  .file-info {
    width: 100%;
  }

  .params-table td:first-child {
    width: 100px;
  }

  .meta-text {
    max-height: 200px;
  }

  .raw-text {
    max-height: 250px;
    font-size: 0.75rem;
  }
}
