/* 업로드 페이지 전체 컨테이너 */
.upload-container {
    flex-grow: 1;
    /* 화면 높이 채우기 */
    display: flex;
    /* 플렉스 박스 적용 */
    justify-content: center;
    /* 가로축 중앙 정렬 */
    align-items: flex-start;
    /* 세로축 상단 정렬 */
    background-color: #f4f4f4;
    /* 배경색 */
    padding: 20px;
}

/* 업로드 폼 스타일 */
.upload-form {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 20px;
    width: 100%;
    max-width: 600px;
    /* 폼이 너무 넓어지지 않게 제한 */
}

/* 헤더 스타일 */
.header-with-back {
    display: flex;
    align-items: center;
    width: 100%;
}

.header-with-back .back-arrow {
    font-size: 1rem;
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
    padding: 5px 10px;
}

.header-with-back .header-title {
    font-size: 1.2rem;
    margin: 0 auto;
    padding-right: 50px;
}


/* 입력 필드 그룹 스타일  */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
    font-size: 1rem;
}

.input-group select,
.input-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    /* 폰트 상속 */
}

/* 숨겨진 파일 입력 필드 */
input[type="file"] {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    /* 투명하게 만듦 */
    overflow: hidden;
    position: absolute;
    /* 위치를 띄워서 흐름에서 제외 */
    z-index: -1;
    /* 맨 뒤로 보냄 */
}

/* 커스텀 업로드 UI (Label Styling) */
.file-label {
    display: flex;
    flex-direction: column;
    /* 아이콘 위, 텍스트 아래 */
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 120px;
    border: 2px dashed #ddd;
    /* 점선 테두리 */
    border-radius: 5px;
    cursor: pointer;
    /* 클릭 가능한 손가락 모양 */
    background: #f9f9f9;
    color: #888;
}

/* 마우스 올렸을 때 효과 */
.file-label:hover {
    background: #f1f1f1;
    border-color: #ccc;
}

/* 업로드 아이콘(+) 스타일 */
.file-label span {
    font-size: 3rem;
    font-weight: lighter;
    line-height: 1;
}

/* 제출버튼 스타일 */
.btn-submit {
    width: 100%;
    padding: 12px;
    background: #5cb85c;
    /* 초록색 */
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}

/* 이미지 미리보기 */
.image-preview {
    margin-top: 15px;
    width: 100%;
    display: flex;
    justify-content: center;
}


/* 업로드 히스토리 */
.history-section {
    width: 100%;
    max-width: 600px;
    margin-top: 40px;
    /* 폼과의 간격 */
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 20px;
}

.history-section h2 {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 15px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

/* 사진 그리드 레이아웃 */
.photo-grid {
    display: grid;
    /* 최소 140px 유지, 공간 남으면 늘어남 */
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    /* 사진 간격 */
}

/* 개별 사진 카드 */
.photo-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

/* 이미지 비율 */
.photo-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    /* 비율 유지하며 꽉 채움 */
    display: block;
}

.photo-item p {
    padding: 8px;
    font-size: 0.85rem;
    color: #555;
    margin: 0;
    line-height: 1.4;
}

/* 제목이 길 경우 말줄임표 처리 */
.photo-item strong {
    display: block;
    color: #333;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}