body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: #2c3e50;
    color: #ecf0f1;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.app-container {
    display: flex;
    width: 100%;
    max-width: 1600px;
    gap: 20px;
    height: 90vh;
}

/* 사이드 패널 (업로드/결과물 목록) */
.side-panel {
    background-color: #34495e;
    border-radius: 8px;
    padding: 20px;
    flex: 0 0 250px; /* 고정 너비 */
    display: flex;
    flex-direction: column;
}
.side-panel h2 {
    text-align: center;
    margin-top: 0;
    color: #95a5a6;
    flex-shrink: 0;
}
.thumbnail-list {
    overflow-y: auto; /* 목록이 길어지면 스크롤 */
    flex-grow: 1;
}
.thumbnail-list p {
    color: #7f8c8d;
    text-align: center;
}
.thumbnail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px;
    border-radius: 4px;
    margin-bottom: 5px;
    cursor: pointer;
    border: 2px solid transparent;
}
.thumbnail-item:hover {
    background-color: #2c3e50;
}
.thumbnail-item.active {
    border-color: #3498db;
    background-color: #2c3e50;
}
.thumbnail-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}
.thumbnail-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
   max-width: 150px;
}

/* 메인 작업 공간 (가운데) */
.main-workspace {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    text-align: center;
}
.app-header h1 {
    font-size: 2.5em;
    color: #3498db;
    margin: 0;
}
.canvas-wrapper {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #34495e;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}
#image-canvas {
    border: 2px dashed #7f8c8d;
    max-width: 100%;
    max-height: 100%;
    height: auto;
    cursor: crosshair;
}

/* 탐색 및 메인 컨트롤 버튼 */
.navigation-controls, .main-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}
#image-counter {
    font-size: 1.2em;
    font-weight: bold;
}
.upload-label {
    background-color: #27ae60;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 4px #219d55;
    transition: all 0.2s ease;
}
.upload-label:hover { background-color: #2cc36b; }
.upload-label:active { transform: translateY(2px); box-shadow: 0 2px #219d55; }
#upload-input { display: none; }

/* 다운로드 섹션 */
.download-section {
    margin-top: auto; /* 맨 아래에 붙이기 */
    padding-top: 15px;
    border-top: 1px solid #7f8c8d;
    display: flex;
    gap: 10px;
}
.download-section select { flex-grow: 1; }
#download-all-button { flex-shrink: 0; background-color: #e67e22; box-shadow: 0 4px #d35400; }
#download-all-button:hover { background-color: #f39c12; }
#download-all-button:active { box-shadow: 0 2px #d35400; }


button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s ease;
    box-shadow: 0 4px #2980b9;
}
button:hover { background-color: #4aa3df; }
button:active { transform: translateY(2px); box-shadow: 0 2px #2980b9; }
button:disabled { background-color: #7f8c8d; box-shadow: 0 4px #6c7a89; cursor: not-allowed; }
/* style.css 파일의 맨 아래에 이 내용을 추가해주세요 */

/* 처음부터 시작 버튼 스타일 */
#start-over-button {
    background-color: #e74c3c; /* 위험/초기화 의미의 붉은색 */
    box-shadow: 0 4px #c0392b;
}
#start-over-button:hover {
    background-color: #f16c5e;
}
#start-over-button:active {
    box-shadow: 0 2px #c0392b;
}
/* style.css 파일 맨 아래에 추가 */

/* 썸네일 아이템에 상대적 위치 설정 */
.thumbnail-item {
    position: relative;
}

/* 삭제 버튼 스타일 */
.delete-btn {
    position: absolute; /* 썸네일 아이템 기준으로 위치 고정 */
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background-color: rgba(231, 76, 60, 0.8); /* 반투명 붉은색 */
    color: white;
    border: none;
    border-radius: 50%; /* 동그란 모양 */
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    line-height: 20px; /* X 글자 수직 정렬 */
    text-align: center;
    padding: 0;
    opacity: 0; /* 평소에는 투명하게 */
    transition: all 0.2s ease;
}

/* 썸네일에 마우스를 올렸을 때 삭제 버튼 보이기 */
.thumbnail-item:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    background-color: #e74c3c;
}