/* SD 아이템 컨테이너 */
#sd_items_container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
    max-height: 500px;
    overflow-y: auto;
    padding: 5px;
}

/* SD 아이템 */
.sd-item {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.sd-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* SD 아이템 헤더 */
.sd-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(0,0,0,0.1);
}

.sd-item-number {
    font-weight: bold;
    font-size: 18px;
    color: #333;
    font-family: 'Pretendard-Regular', sans-serif;
}

.btn-remove-sd {
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
}

.btn-remove-sd:hover {
    background: #cc0000;
    transform: scale(1.1);
}

/* SD 아이템 바디 */
.sd-item-body {
    display: grid;
    grid-template-columns: 70px 1.5fr 1fr 1fr;
    gap: 12px;
    align-items: start;
}

/* SD 필드 */
.sd-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sd-field label {
    font-size: 13px;
    font-weight: bold;
    color: #555;
    font-family: 'Pretendard-Regular', sans-serif;
}

.sd-field input[type="number"],
.sd-field input[type="text"] {
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.sd-field input[type="number"]:focus,
.sd-field input[type="text"]:focus {
    border-color: #4CAF50;
    outline: none;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* 순서 필드 */
.sd-field-order input {
    text-align: center;
    font-weight: bold;
    font-size: 16px;
}

/* 이미지 필드 */
.sd-field-image {
    position: relative;
}

.sd-image-file {
    width: 100%;
    padding: 8px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.sd-image-file:hover {
    border-color: #4CAF50;
    background: #f0f9f0;
}

.sd-preview {
    margin-top: 10px;
    position: relative;
}

.sd-preview img {
    width: 100%;
    max-width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    border: 3px solid #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.sd-preview img:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.25);
}

.btn-remove-preview {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.btn-remove-preview:hover {
    background: #cc0000;
    transform: scale(1.15) rotate(90deg);
}

/* 색상 선택 */
.color-picker-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.sd-color {
    width: 60px;
    height: 40px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sd-color:hover {
    border-color: #4CAF50;
    transform: scale(1.05);
}

.sd-color-hex {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
}

/* 추가 버튼 */
.btn-add-sd {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-add-sd:hover {
    background: linear-gradient(135deg, #45a049 0%, #388e3c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(76, 175, 80, 0.4);
}

.btn-add-sd i {
    font-size: 16px;
}

/* 반응형 */
@media (max-width: 768px) {
    .sd-item-body {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .sd-field-order {
        order: -1;
    }
    
    .sd-preview img {
        max-width: 100px;
        height: 100px;
    }
}
