/* OOTD API Demo v6 스타일 */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    color: #333;
    background: #fafafa;
}

h1 { margin-bottom: 4px; }
h2 { margin-bottom: 12px; color: #222; }
h3 { margin-bottom: 8px; color: #444; }

.version {
    font-size: 14px;
    color: #888;
    font-weight: 400;
}

.subtitle {
    font-size: 13px;
    color: #888;
    margin-bottom: 16px;
}

/* 탭 */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 2px solid #ddd;
}
.tab {
    padding: 10px 20px;
    border: none;
    background: #eee;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    font-size: 14px;
}
.tab.active {
    background: #333;
    color: white;
}

/* 탭 콘텐츠 */
.tab-content { display: block; }
.tab-content.hidden { display: none; }

/* 단계별 섹션 */
.step {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}
.step-desc {
    color: #666;
    font-size: 13px;
    margin-bottom: 12px;
    line-height: 1.6;
}
.step-desc code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

/* 폼 */
form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
    margin-bottom: 12px;
}
label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
}
input[type="text"], select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}
input[type="file"] { font-size: 13px; }
button {
    padding: 8px 16px;
    border: 1px solid #ccc;
    background: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}
button:hover { background: #e8e8e8; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

/* 이미지 소스 선택 (파일 + URL) */
.image-source {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.image-source label { font-weight: 600; }
.image-source input[type="text"] { min-width: 300px; }

/* FaceID 체크박스 옵션 */
.face-id-option {
    width: 100%;
    margin-top: 4px;
}
.checkbox-label {
    flex-direction: row !important;
    align-items: center;
    gap: 8px !important;
    font-weight: 500;
    cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #333;
}

/* Face 상태 표시 */
.face-status {
    margin-top: 8px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
}
.face-status.hidden { display: none; }
.face-status.known {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
}
.face-status.unknown {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
}
.face-status.not_detected {
    background: #ffebee;
    border-left: 4px solid #f44336;
}

/* 결과 박스 */
.result {
    margin-top: 8px;
    padding: 10px;
    border-radius: 4px;
    font-size: 13px;
    white-space: pre-wrap;
}
.result:empty { display: none; }
.result.loading { background: #fff8e1; }
.result.success { background: #e8f5e9; }
.result.error { background: #ffebee; color: #c62828; }

/* 필터 행 */
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
    margin-bottom: 16px;
}

/* 액션 바 */
.action-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
}
.action-bar.hidden { display: none; }

/* 진행 텍스트 */
.progress-text {
    font-size: 12px;
    color: #888;
}

/* 이미지 모델 선택 (고스트 마네킹 / VTON) */
.model-select-label {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #666;
}
.image-model-select {
    font-size: 12px;
    padding: 6px 8px;
}

/* 사용자 카드 그리드 */
.user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.user-card {
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    cursor: pointer;
    text-align: center;
    position: relative;
}
.user-card:hover { border-color: #999; }
.user-card .name { font-weight: 600; }
.user-card .count { font-size: 12px; color: #888; margin-top: 4px; }

/* 사용자 삭제 버튼 */
.btn-delete-user {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    font-size: 14px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    color: #999;
}
.btn-delete-user:hover {
    background: #ffebee;
    color: #c62828;
    border-color: #ef9a9a;
}

/* 의류 카드 그리드 */
.garment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.garment-card {
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}
.garment-card:hover { border-color: #999; }
.garment-card.disabled-card { opacity: 0.5; }

/* VTON 결과 메타 */
.vton-meta {
    margin-top: 10px;
    padding: 10px 14px;
    background: #f6f9ff;
    border: 1px solid #d7e3f6;
    border-radius: 6px;
    font-size: 13px;
    color: #333;
}
.vton-meta p { margin: 4px 0; }
.garment-card img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    display: block;
    background: #f0f0f0;
}
.garment-card .info { padding: 10px; }
.garment-card .category { font-weight: 600; font-size: 13px; }
.garment-card .desc { font-size: 12px; color: #666; margin-top: 4px; }
.garment-card .tags { margin-top: 6px; }
.tag {
    display: inline-block;
    background: #e3e8f0;
    color: #555;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin: 2px;
}
.garment-card .owner { font-size: 11px; color: #999; margin-top: 4px; }

/* 분석 결과 카드 - 원본 + 고스트 2열 미리보기 */
.preview-images {
    display: flex;
    gap: 2px;
}
.preview-col {
    flex: 1;
    min-width: 0;
}
.preview-col img {
    width: 100%;
    height: 140px;
    object-fit: contain;
    display: block;
    background: #f0f0f0;
}
.preview-col .img-label {
    text-align: center;
    font-size: 10px;
    color: #999;
    padding: 2px 0;
}

/* 고스트 프리뷰 빈 슬롯 */
.ghost-placeholder {
    width: 100%;
    height: 140px;
    background: #f0f0f0;
}
.ghost-placeholder img {
    width: 100%;
    height: 140px;
    object-fit: contain;
    display: block;
}

/* 체크박스 */
.garment-card .select-check,
.garment-card .wardrobe-check {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #333;
    z-index: 1;
}

/* 고스트 마네킹 버튼 */
.ghost-btn {
    margin-top: 8px;
    background: #e3f2fd;
    border-color: #90caf9;
    font-size: 12px;
    text-decoration: none;
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #90caf9;
    border-radius: 4px;
    cursor: pointer;
    color: #333;
}
.ghost-btn:hover { background: #bbdefb; }

/* 삭제 버튼 */
.btn-danger {
    background: #ffebee;
    border-color: #ef9a9a;
    color: #c62828;
}
.btn-danger:hover { background: #ffcdd2; }

/* 의류 상세 */
.detail-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
    font-size: 13px;
}
.detail-grid dt { font-weight: 600; color: #555; }
.detail-grid dd { color: #333; }
.detail-images {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}
.detail-images img {
    max-width: 300px;
    max-height: 300px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid #ddd;
}
.detail-images .img-label {
    text-align: center;
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}
.detail-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* 페이지네이션 */
.pagination {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    font-size: 13px;
}
.pagination.hidden { display: none; }

/* 모달 */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.modal.hidden { display: none; }
.modal-content {
    background: white;
    border-radius: 8px;
    padding: 24px;
    min-width: 300px;
    text-align: center;
}
.modal-content p {
    margin-bottom: 16px;
    font-size: 14px;
    white-space: pre-line;
}
.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}
.modal-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    margin-bottom: 16px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* ================================================================
   스타일 분석 결과
   ================================================================ */

.style-preview {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}
.style-preview img {
    max-width: 280px;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.style-scores {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.score-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
}

.score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.score-title {
    font-weight: 700;
    font-size: 15px;
    color: #222;
}

.score-stars {
    font-size: 16px;
    letter-spacing: 2px;
}

.score-stars .filled { color: #ffc107; }
.score-stars .empty { color: #ddd; }

.score-value {
    font-size: 13px;
    color: #888;
    margin-left: 6px;
}

.score-comment {
    font-size: 13px;
    color: #555;
    line-height: 1.7;
}

.style-overall {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    padding: 20px;
}

.overall-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.overall-title {
    font-weight: 700;
    font-size: 16px;
    color: #222;
}

.overall-score-badge {
    background: #333;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
}

.overall-comment {
    font-size: 14px;
    color: #444;
    line-height: 1.8;
    margin-bottom: 12px;
}

.style-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.style-tag {
    display: inline-block;
    background: #333;
    color: white;
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 500;
}

/* ================================================================
   누끼 (배경 제거) 결과
   ================================================================ */

.seg-compare {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.seg-col {
    text-align: center;
    flex: 1;
    max-width: 400px;
}

.seg-col img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.seg-col .img-label {
    text-align: center;
    font-size: 12px;
    color: #999;
    margin-top: 6px;
}

/* 체커보드 배경 (투명 PNG 시각화) */
.checkerboard-bg {
    background: repeating-conic-gradient(#e8e8e8 0% 25%, #fff 0% 50%) 50% / 16px 16px;
}
