/* 전체 스타일 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #444;
}

/* 탭 스타일 */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
}

.tab-button {
    background-color: #f1f1f1;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 10px 20px;
    font-size: 16px;
    transition: background-color 0.3s;
}

.tab-button:hover {
    background-color: #ddd;
}

.tab-button.active {
    background-color: #4CAF50;
    color: white;
}

.tab-content {
    display: none;
    padding: 20px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.tab-content.active {
    display: block;
}

/* 업로드 영역 스타일 */
.upload-container {
    border: 2px dashed #ccc;
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 20px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.upload-container.dragover {
    background-color: #f0f8ff;
    border-color: #0066cc;
}

#selectButton {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 10px 2px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
}

#selectButton:hover {
    background-color: #45a049;
}

.progress-bar {
    width: 100%;
    background-color: #f0f0f0;
    border-radius: 4px;
    margin-top: 20px;
    display: none;
}

.progress {
    height: 20px;
    background-color: #4CAF50;
    border-radius: 4px;
    width: 0%;
    text-align: center;
    line-height: 20px;
    color: white;
    transition: width 0.3s ease;
}

.status {
    margin-top: 15px;
    font-weight: bold;
}

#preview {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

#preview img {
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* 갤러리 스타일 */
.gallery-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

#searchInput {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 70%;
}

#refreshButton {
    background-color: #008CBA;
    color: white;
    border: none;
    padding: 8px 16px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
}

#refreshButton:hover {
    background-color: #007A9E;
}

.gallery-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: flex-start;
}

.gallery-item {
    width: calc(25% - 15px);
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    cursor: pointer;
}

.gallery-item-info {
    padding: 10px;
    background-color: #f9f9f9;
}

.gallery-item-name {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
}

.gallery-item-date {
    font-size: 12px;
    color: #666;
}

/* 모달 스타일 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    margin: 5% auto;
    padding: 20px;
    max-width: 80%;
    max-height: 80%;
    background-color: white;
    border-radius: 5px;
    position: relative;
}

.close {
    position: absolute;
    top: 10px;
    right: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

#modalImage {
    max-width: 100%;
    max-height: 70vh;
    display: block;
    margin: 0 auto;
}

.modal-footer {
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#modalFilename {
    font-size: 16px;
    font-weight: bold;
}

#downloadButton {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
}

#downloadButton:hover {
    background-color: #45a049;
}

/* 반응형 스타일 */
@media screen and (max-width: 768px) {
    .gallery-item {
        width: calc(50% - 15px);
    }
    
    .modal-content {
        max-width: 95%;
    }
}

@media screen and (max-width: 480px) {
    .gallery-item {
        width: 100%;
    }
    
    .tabs {
        flex-direction: column;
    }
}