/* Image Display Improvements CSS */
/* 이미지 표시 개선을 위한 추가 스타일 */

/* 이미지 컨테이너 - 유연한 높이 설정 */
.image-container {
    width: 100%;
    position: relative;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    padding: 10px;
    box-sizing: border-box;
}

/* 메인 이미지 슬롯 - 자동 높이 조절 */
.image-slot-preview {
    width: 100%;
    min-height: 200px;
    height: auto !important;
    max-height: none !important;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    overflow: hidden !important;  /* Changed from visible to hidden */
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    padding: 10px;
    box-sizing: border-box;
}

.image-slot-preview img {
    width: auto !important;
    max-width: calc(100% - 20px) !important;  /* Account for padding */
    height: auto !important;
    max-height: 80vh !important;
    object-fit: contain !important;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

/* 참조 이미지 프리뷰 - 자동 높이 조절 */
.reference-preview {
    width: 100%;
    min-height: 160px;
    height: auto !important;
    max-height: none !important;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    overflow: hidden !important;  /* Changed from visible to hidden */
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    padding: 8px;
    box-sizing: border-box;
}

.reference-preview img {
    width: auto !important;
    max-width: calc(100% - 16px) !important;  /* Account for padding */
    height: auto !important;
    max-height: 60vh !important;
    object-fit: contain !important;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

/* 이미지 로딩 상태 - 애니메이션 제거 */
.image-loading {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    /* 애니메이션 효과 제거됨 */
}

/* 이미지 에러 상태 */
.image-error {
    width: 100%;
    min-height: 200px;
    background: rgba(255, 45, 58, 0.1);
    border: 1px solid rgba(255, 45, 58, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    color: rgba(255, 255, 255, 0.6);
}

/* 반응형 이미지 컨테이너 */
@media (max-width: 768px) {
    .image-slot-preview img,
    .reference-preview img {
        max-height: 50vh !important;
    }
}

/* 이미지 호버 효과 */
.image-slot-preview:hover,
.reference-preview:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
}

/* 이미지 액션 버튼 */
.image-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-slot-preview:hover .image-actions,
.reference-preview:hover .image-actions {
    opacity: 1;
}

.image-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.image-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* 이미지 줌 기능 */
.zoomable-image {
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.zoomable-image.zoomed {
    cursor: zoom-out;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.5);
    z-index: 2000;
    max-width: 90vw;
    max-height: 90vh;
}

/* 이미지 정보 오버레이 */
.image-info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 15px;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 0 0 6px 6px;
}

.image-slot-preview:hover .image-info-overlay,
.reference-preview:hover .image-info-overlay {
    opacity: 1;
}

/* 이미지 플레이스홀더 */
.image-placeholder {
    width: 100%;
    height: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
}

.image-placeholder-icon {
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.3;
}

/* 드래그 앤 드롭 영역 */
.drag-drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.drag-drop-zone:hover {
    border-color: var(--apple-blue);
    background: rgba(0, 122, 255, 0.05);
}

.drag-drop-zone.dragging {
    border-color: var(--apple-blue);
    background: rgba(0, 122, 255, 0.1);
    transform: scale(1.02);
}

/* 이미지 타입별 최적화 */
/* 세로 이미지 (9:16) */
.portrait-image img {
    max-width: 60% !important;
    margin: 0 auto;
}

/* 가로 이미지 (16:9) */
.landscape-image img {
    max-width: 100% !important;
}

/* 정사각형 이미지 (1:1) */
.square-image img {
    max-width: 70% !important;
    margin: 0 auto;
}

/* 포커스 모드 */
.image-focus-mode {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    cursor: zoom-out;
}

.image-focus-mode img {
    max-width: 95vw !important;
    max-height: 95vh !important;
    object-fit: contain !important;
}

/* 이미지 갤러리 그리드 개선 */
.image-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.image-gallery-item {
    aspect-ratio: 1;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-gallery-item:hover {
    transform: scale(1.05);
    background: rgba(0, 0, 0, 0.7);
}

.image-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}