@charset "UTF-8";
/*!
 * Quazar  v1.0.2
 * Copyright 2020-2025 Quazar Authors
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 */

:root {
    --primary-color: #007bff;
    /* #0099ff */
    --dark-bg: #000000;
    --card-bg: #1a1a1a;
    --border-color: #353535;
    --text-primary: #ffffff;
    --text-secondary: #a5a5a5;
    --success-color: #22c55e;
    --danger-color: #ef4444;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-primary);
    min-height: 100vh;
    padding-top: 70px;
    /* Adjust this value to match your header's height */
    padding-bottom: 80px;
    /* Adjust this value to match your footer's height */
    overflow-x: hidden;
}

/* Header */
.header {
    position: fixed;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.5rem 0 0.5rem 0;
    /* border-bottom: 0.1px solid var(--border-color); */
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    /* background-color: #000; */
}

.btn-profile {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(39, 39, 39, 0.5);
    border: 1px solid #141414;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: all 0.3s;
}

.btn-profile:hover {
    background: rgba(39, 39, 39, 0.8);
    color: var(--text-primary);
}

.btn-logout {
    background: rgba(39, 39, 39, 0.5);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: rgba(39, 39, 39, 0.8);
    color: var(--text-primary);
}

/* Main Content */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 80px);
}

.content-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.badge-ai {
    background: linear-gradient(135deg, var(--primary-color), #0066cc);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.main-title {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    font-weight: 300;
    margin-bottom: 2rem;
}

/* Upload Box */
.upload-box {
    border: 2px dashed #767676;
    border-radius: 15px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(0, 0, 0, 0.3);
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-box:hover,
.upload-box.dragging {
    border-color: var(--primary-color);
    background: rgba(0, 153, 255, 0.1);
}

.upload-icon {
    font-size: 4rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.upload-text {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 0.7rem;
    margin-bottom: 0.5rem;
}

.upload-subtext {
    color: #767676;
    font-size: 0.875rem;
}

.required-label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.required-label .text-danger {
    color: #ff2121 !important;
}

/* Preview Image */
.image-preview {
    position: relative;
    border: 3px solid var(--primary-color);
    border-radius: 15px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.5);
    margin-bottom: 1.5rem;
    max-height: 300px;
    display: none;
}

.image-preview.show {
    display: block;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-height: 300px;
}

.analyzing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

/* Buttons */
.btn-upload {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: var(--text-primary);
    padding: 0.875rem 3rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s;
    width: 100%;
    max-width: 300px;
}

.btn-upload:hover:not(:disabled) {
    background: #2a2a2a;
    color: var(--text-primary);
    transform: translateY(-2px);
}

.btn-upload:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-upload:not(:disabled) {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

#aiAuthText.active {
    color: var(--primary-color);
}

.info-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 300;
    margin-top: 1rem;
}

/* Preview Area */
.preview-area {
    /* background: #f7f7f6; */
    background: #f0f0f0;
    border-radius: 20px;
    overflow: hidden;
    height: 100%;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-area video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 991.98px) {
    .preview-area {
        height: auto;
    }
}

/* Modal */
.modal-content {
    background: linear-gradient(135deg, var(--card-bg) 0%, #0a0a0a 100%);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-primary);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
}

.result-badge {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.result-badge.authentic {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success-color);
}

.result-badge.fake {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}

.confidence-score {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.confidence-score.authentic {
    color: var(--success-color);
}

.confidence-score.fake {
    color: var(--danger-color);
}

.detail-item {
    margin-bottom: 1rem;
}

.detail-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    text-transform: capitalize;
}

.progress {
    height: 8px;
    background-color: #272727;
    border-radius: 10px;
}

.progress-bar {
    border-radius: 10px;
    transition: width 1s ease;
}

.progress-bar.high {
    background-color: var(--success-color);
}

.progress-bar.medium {
    background-color: #eab308;
}

.progress-bar.low {
    background-color: var(--danger-color);
}











/* 1. 이미지 박스와 사용자 입력 박스의 높이 통일 및 이미지 테두리 제거 */
.card {
    border: none;
    box-shadow: none;
    /* **핵심 수정:** 모서리 라운드 밖으로 내용이 번지는 것을 방지 */
    overflow: hidden;
    /* card 자체의 border-radius를 20px로 설정 */
    border-radius: 20px !important;
}

/* 이미지 노출 박스의 스타일 */
.card-body-image {
    /* var(--card-bg)가 정의되지 않았을 경우를 대비해 임의의 어두운 배경색 설정 */
    background: var(--card-bg, #343a40) !important;
    /* card에 border-radius를 적용했기 때문에 body에서는 제거 */
    border-radius: 0;
    min-height: 480px;
    display: flex;
    flex-direction: column;
}

/* AI Analysis (사용자 입력) 박스의 스타일 */
.card-body-analysis {
    background: var(--card-bg, #343a40) !important;
    /* card에 border-radius를 적용했기 때문에 body에서는 제거 */
    border-radius: 0;
    min-height: 480px;
    color: #ffffff;
}


/* 이미지 컨테이너의 높이를 제한하여 오른쪽 폼 박스와 균형을 맞춥니다. */
.image-container {
    /* AI Analysis 폼의 내용 높이에 맞춰 적절히 조정 */
    height: 400px;
    display: flex;
    align-items: center;
    /* 이미지를 수직 중앙 정렬 */
    justify-content: center;
    /* 이미지를 수평 중앙 정렬 */
    padding: 20px 0;
    /* 내부 여백 추가 */
}

/* 실제 이미지의 스타일 */
.image-container img {
    max-height: 100%;
    /* 컨테이너 높이에 맞춰 이미지 높이 제한 */
    width: auto;
    /* 너비는 자동으로 조정 */
    max-width: 100%;
    /* 부모 너비를 넘지 않도록 보장 */
    object-fit: contain;
    /* 이미지 비율 유지하며 컨테이너에 맞춤 */
    border-radius: 15px;
}

/* 3. 입력 필드 내부 텍스트가 잘 보이도록 수정 */
.card-body-analysis .form-label {
    color: #ffffff;
    /* 라벨 글자색 흰색으로 */
}

/* 입력 필드 (input) 스타일 조정 - 배경색과 텍스트 색상 */
.card-body-analysis .form-control {
    background-color: #495057;
    /* 입력 필드 배경색을 약간 어둡게 하여 구분이 되도록 */
    color: #ffffff;
    /* 입력 텍스트를 흰색으로 */
    border-color: #6c757d;
}

/* 제목 및 설명 스타일은 이전과 동일 */
.main-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.sub-message {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 2rem;
}






/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.9);
    /* Match header background */
    padding: 1rem 0;
    border-top: 1px solid #585858;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1030;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

/* Spinner */
.spinner-custom {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
}

.toast-custom {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    min-width: 300px;
}

.toast-custom.success {
    border-color: var(--success-color);
}

.toast-custom.error {
    border-color: var(--danger-color);
}

.toast-custom.info {
    border-color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .main-title {
        font-size: 2rem;
    }

    .content-card {
        padding: 1.5rem;
    }

    .upload-box {
        padding: 2rem 1rem;
        min-height: 200px;
    }

    .upload-icon {
        font-size: 3rem;
    }

    .btn-upload {
        max-width: 100%;
    }

    .preview-area {
        min-height: 300px;
        margin-top: 2rem;
    }
}

@media (max-width: 576px) {
    .logo {
        font-size: 1.25rem;
    }

    .btn-logout {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .main-title {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.loading-overlay.show {
    display: flex;
}

.loading-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    max-width: 400px;
}

/* Scan light effect for loading screen */
.scan-light {
    pointer-events: none;
    /* 이미지 클릭 방해 안함 */
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0) 0%,
            /* 투명 */
            rgba(255, 255, 255, 0.5) 50%,
            /* 밝은 빛 */
            rgba(255, 255, 255, 0) 100%
            /* 다시 투명 */
        );
    transform: translateY(-100%);
    /* 처음 위치: 위쪽 밖 */
    animation: scan 2s linear infinite;
}

@keyframes scan {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(100%);
    }
}

.gucci-logo {
    max-width: 140px;
}

.font-weight-600 {
    font-weight: 600;
}

.opacity-7 {
    opacity: 0.7;
}

.upload-grid {
    margin-top: 60px;
    border-bottom: 1px solid #252424;
    padding-bottom: 4rem;
}

.repair-history {
    margin-top: 50px;
}

.notice {
    opacity: 0.7;
    font-size: 0.85rem;
    border-top: 1px solid #383636;
    padding-top: 1rem;
}

.start-auth-btn {
    font-size: 1.1rem;
}

.detection-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 20px;
}

.panel {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    position: relative;
    margin-bottom: 20px;
}

.panel-header {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 15px;
}

/* Image Container */
.image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: transparent;
    border: none;
    border-radius: 8px;
    overflow: hidden;
}

.demo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.5s;
}

/* Grid Overlay */
.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.grid-cell {
    border: 1px solid rgba(100, 255, 218, 0.08);
    background: transparent;
    transition: all 0.05s;
}

.grid-cell.scanned {
    background: rgba(100, 255, 218, 0.15);
    border-color: rgba(100, 255, 218, 0.3);
}

.grid-cell.detected {
    background: rgba(255, 107, 107, 0.25);
    border-color: rgba(255, 107, 107, 0.5);
}

/* BBOX SVG */
.bbox-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.bbox-rect {
    stroke: var(--accent-red);
    stroke-width: 3;
    fill: none;
    filter: drop-shadow(0 0 8px rgba(255, 107, 107, 0.6));
}

/* Cropped Image */
.cropped-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    z-index: 100;
    background: var(--primary-color);
    border: 3px solid var(--highlight-color);
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(100, 255, 218, 0.5);
    overflow: hidden;
    transition: all 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cropped-image {
    display: block;
    width: 100%;
    height: 100%;
}

.crop-label {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--highlight-color);
    color: var(--primary-color);
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(100, 255, 218, 0.3);
}

/* VLM Log */
.vlm-check-log {
    margin-top: 20px;
    padding: 15px;
    background: transparent;
    border: none;
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    color: var(--text-muted);
    text-align: left;
}

.vlm-check-log p {
    margin: 0;
    padding: 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vlm-log-details {
    background: transparent;
    border: none;
    padding: 20px;
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

.vlm-log-details p {
    margin: 0;
    padding: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cursor {
    display: inline-block;
    width: 8px;
    height: 1em;
    background-color: var(--highlight-color);
    animation: blink 1s infinite;
    margin-left: 2px;
    vertical-align: middle;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 1200px) {
    .detection-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .panel {
        padding: 20px;
    }
}

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

.detection-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 20px;
}

.panel {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    position: relative;
    margin-bottom: 20px;
}

.panel-header {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary); /* 일관성을 위해 --text-primary 사용 제안 */
    margin-bottom: 15px;
}

/* Image Container */
.image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: transparent;
    border: none;
    border-radius: 8px;
    overflow: hidden;
}

.demo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.5s;
}

/* Grid Overlay */
.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.grid-cell {
    border: 1px solid rgba(100, 255, 218, 0.08);
    background: transparent;
    transition: all 0.05s;
}

.grid-cell.scanned {
    background: rgba(100, 255, 218, 0.15);
    border-color: rgba(100, 255, 218, 0.3);
}

.grid-cell.detected {
    background: rgba(255, 107, 107, 0.25);
    border-color: rgba(255, 107, 107, 0.5);
}

/* BBOX SVG */
.bbox-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.bbox-rect {
    stroke: var(--accent-red);
    stroke-width: 3;
    fill: none;
    filter: drop-shadow(0 0 8px rgba(255, 107, 107, 0.6));
}

/* Cropped Image */
.cropped-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    z-index: 100;
    background: var(--primary-color);
    border: 3px solid var(--highlight-color);
    border-radius: 12px; /* --primary-color가 #007bff일 경우 배경이 파란색이 됨. 의도 확인 필요 */
    box-shadow: 0 0 30px rgba(100, 255, 218, 0.5);
    overflow: hidden;
    transition: all 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cropped-image {
    display: block;
    width: 100%;
    height: 100%;
}

.crop-label {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--highlight-color); /* --highlight-color가 정의되지 않음. 상단 :root에 추가 필요 */
    color: var(--primary-color);
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(100, 255, 218, 0.3);
}

/* VLM Log */
.vlm-check-log {
    margin-top: 20px;
    padding: 15px;
    background: transparent;
    border: none;
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    color: var(--text-secondary); /* 일관성을 위해 --text-secondary 사용 제안 */
    text-align: left;
}

.vlm-check-log p {
    margin: 0;
    padding: 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vlm-log-details {
    background: transparent;
    border: none;
    padding: 20px;
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    color: var(--text-secondary); /* 일관성을 위해 --text-secondary 사용 제안 */
    line-height: 1.6;
}

.vlm-log-details p {
    margin: 0;
    padding: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cursor {
    display: inline-block;
    width: 8px;
    height: 1em;
    background-color: var(--success-color); /* --highlight-color 대신 --success-color 사용 제안 */
    animation: blink 1s infinite;
    margin-left: 2px;
    vertical-align: middle;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 1200px) {
    .detection-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .panel {
        padding: 20px;
    }
}

/* For step4 image upload preview */
.image-upload-preview {
    position: relative;
    width: 100%;
    max-width: 230px;
    /* Set max width for consistent size */
    padding-top: 100%;
    /* 1:1 비율의 정사각형 컨테이너 생성 */
    border-radius: 0.375rem;
    /* Bootstrap 'rounded' class와 유사한 값 */
    overflow: hidden;
    background-color: #1a1a1a;
    /* 아이콘 배경과 유사한 색상 */
    margin: auto;
    /* Center the element */
}

.image-upload-preview img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 이미지가 컨테이너를 꽉 채우도록 설정 (비율이 다르면 잘림) */
}

.image-upload-preview .delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 10;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    font-size: 14px;
    line-height: 1;
    text-align: center;
    padding: 0;
    cursor: pointer;
}

.image-upload-preview .image-title {
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 2px 5px;
    font-size: 10px;
    border-radius: 3px;
}